# Automatically re-creating your world file

## kerframil

Lost your world file? Irritated by the fact that your world file only contains things you explicitly emerged but not their dependencies, but you'd like to know when these dependencies are updated too? This quick'n'dirty perl script will create a file called world.new containing a list of all of your installed packages in /var/cache/edb. Remove the bits you don't want, then copy it over your world file. This script depends on app-admin/gentoolkit being installed. It's fairly simple so I make no guarantee that it won't break completely when things change at some point   :Wink: 

Save it into a file such as makeworld.pl then perl makeworld.pl or mark the file as executable with chmod to avoid having to invoke it with the perl command. IMPORTANT: There may be line breaks where there shouldn't be as displayed here, copy and paste the text into a decent text editor and it should be fine

Ignore the next paragraph! - see Davide's post below.

Having certain builds in your world file makes emerge --update world do absolutely nothing it seems. If anyone knows why and/or which ones, let me know and I can make this work 100% without editing of the created world file being necessary.

EDIT: Updated for use with gentoolkit-0.1.11

```
#!/usr/bin/perl -w

use strict;

# 12/09/2002 - Updated for use with app-admin/gentoolkit-0.1.11

my %syspackages;  # System packages (filtered - shouldn't be in world)

my @array;        # Temp array

# Die if process owner isn't root

if ($< != 0) {

   print "You must be root to run this script.\n\n";

   exit 0;

}

# Determine which packages are part of the "system" set

print "Determining system packages for exclusion (use emerge system for updating such packages) ...\n";

my @temp = `emerge --pretend --emptytree system` or die "Problem invoking emerge!\n";

foreach (@temp) {

   # Push system packages into temporary array

   if (/\] .+\/(.+?)-.+\ /s) {

      push @array, $1 => 1;

   }

}

# Assign to hash for fast checking below

%syspackages = @array;

# Grab list of installed packages

print "Determining installed packages on your system ...\n";

my @packages = `qpkg -I` or die "Problem invoking qpkg, make sure you have gentoolkit installed!\n";

# Now filter and output to world.new

print "Lists compiled. Attempting to create /var/cache/edb/world.new ...\n";

open(FILE, '>/var/cache/edb/world.new') || die "Couldn't create /var/cache/edb/world.new - check permissions?\n";

foreach (@packages) {

   # Grab pure package name

   /^\x1B.+?m(.+)\/\x1B.+?m(.+)\ /s;

   my $package = "$1\/$2";

   my $name = $2;

   # Output package to world.new unless it is a system package

   unless ($syspackages{$name}) {

      print FILE "$package\n" || die "Could not output $package to /var/cache/edb/world.new";

       print "Added: $package\n";

   }

}

close(FILE);

# Finished

print "Success. Please edit the world.new file to your satisfaction. Then rename to world.\n\n";

1;
```

Last edited by kerframil on Wed Jun 12, 2002 7:32 pm; edited 5 times in total

----------

## Tatonet

 *kerframil wrote:*   

> ...
> 
> Having certain builds in your world file makes emerge --update world do absolutely nothing it seems. If anyone knows why and/or which ones, let me know and I can make this work 100% without editing of the created world file being necessary. ...

 

Sorry but my English is very limited:

I think that happends because it writes '\' instead of '/' in package name.

It works for me if I modify line 41, from:

```
my $package = "$1\\$2";
```

to:

```
my $package = "$1\/$2";
```

P.s.: really nice script  :Smile: 

Best regards,

Davide Guerri

----------

## kerframil

 :Embarassed:  Doh! Thanks very much Davide - I'll alter the post!

----------

## PhadeRunner

Source code has a typo meaning you can't invoke the script directly (e.g. ./makeworld.pl).  

```
#/usr/bin/perl -w
```

Should read: 

```
#!/usr/bin/perl -w
```

Sorry for being pedantic but someone might not notice when simply copying and pasting the script.  Although I only had to try to run it once before I noticed.  

Nevertheless this is a cool script.  Kudos to you kerframil!  :Cool: 

Phade...

----------

## kerframil

 *Quote:*   

> Source code has a typo meaning you can't invoke the script directly

 It certainly did, sorry about that everyone. You know I was just too tired the day I posted that   :Laughing: 

Edited, fixed - along with another typo in one of the status messages, and some additional (redundant) dogma removed which had no need to be there, so it's a little shorter now.

----------

## psionix

The updated version of qpkg in gentoolkit-0.1.11-r1 causes the script to puke.  :Sad: 

----------

## Tatonet

Simply change the invocation of qpkq from:

	my $packages = 'qpkg -I' ...

to:

	my $packages = 'qpkg -I -v' ...

(or you can modify the regular expression in the last foreach statement  :Smile:  )

----------

## psionix

 *Tatonet wrote:*   

> Simply change the invocation of qpkq from:
> 
> 	my $packages = 'qpkg -I' ...
> 
> to:
> ...

 

Yeah, I ended up doing the latter before checking back here.  Wish I had known about "-v" before wasting that time.   :Confused: 

----------

## psionix

Actually, changing 'qpkg -I' to 'qpkg -I -v' caused some problems.  It doesn't list versions for everything.  I was able to get things to work by changing line 6 to:

```

my $lastpackage = "";

```

and line 36 to:

```

  /^\x1B.+?m(.+)\/\x1B.+?m(.+)\ /s;

```

I'm sure there's a better way but this appears to work so far.

----------

## kerframil

Tatonet, psionix ... thanks very much. Edited and fixed. I've been busy with a few other things, hence you guys noticed before I did. The new qpkg is much better, and actually simplifies matters. Also, the regexps were a bit mucky, so they've been tidied up. AFAIK, it's perfect now ... I'm sure you'll let me know if it isn't.   :Smile: 

----------

## sibbe

Found this (ancient :) thread while searching things related to world-file. The script seems to work just fine, but i modified it a bit to suit my personal needs; removed uid root -checking, added ability to save output wherever i want it (including stdout) with -o flag. Also, -v flag turns on verboseness - which is disabled by default.

http://www.kruu.org/jvtm/files/genworldfile.pl

```

#!/usr/bin/perl -w

# Script for regenerating world-file in Gentoo Linux

# http://forums.gentoo.org/viewtopic.php?t=2480

#

# 2002-09-12 - Updated for use with app-admin/gentoolkit-0.1.11

#

# 2003-01-31 - jyrki muukkonen (sibbe@localhost)

#   - proper date format :P

#   - removed root-uid check

#   - added some command line parameters (uses Getopt::Std)

#       -o file,    print output to file, defaults to "-" (stdout)

#       -v,         be verbose, turned off by default

#       -h          print usage

#

use strict;

use Getopt::Std;

my %syspackages;    # System packages (filtered - shouldn't be in world)

my @array;          # Temp array

my %opts;           # hash for command line options

# parse command line options

getopts("hvo:", \%opts);

$opts{o} = "-"  unless defined $opts{o}; # print to stdout if no file given

$opts{v} = 0    if $opts{o} eq "-";      # be non-verbose if writing to stdout

# print usage and exit if we got -h as a parameter

if($opts{h}) {

    print "usage: $0 [-h] [-v] [-o filename]\n";

    print "\t-h\t\tthis help screen\n";

    print "\t-v\t\tbe verbose\n";

    print "\t-o filename\twrite output to \"filename\", "

          ."defaults to \"-\" (stdout)\n";

    print "\t\t\t-v flag is disabled when using stdout\n";

    print "\n";

    exit 0;

}

print "Writing output to \"$opts{o}\".\n" if($opts{v});

# Determine which packages are part of the "system" set

print "Determining system packages for exclusion (use emerge system for "

      ."updating such packages)...\n" if($opts{v});

my @temp = `emerge --pretend --emptytree system`

    or die "Problem invoking emerge!\n";

foreach (@temp) {

    # Push system packages into temporary array

    if (/\] .+\/(.+?)-.+\ /s) {

        push @array, $1 => 1;

    }

}

# Assign to hash for fast checking below

%syspackages = @array;

# Grab list of installed packages

print "Determining installed packages on your system...\n" if($opts{v});

my @packages = `qpkg -I`

    or die "Problem invoking qpkg, make sure you have gentoolkit installed!\n";

# Now filter and output to world.new

print "Lists compiled. "

      ."Attempting to write to \"$opts{o}\"...\n" if($opts{v});

open(FILE, "> $opts{o}")

    or die "Couldn't write to \"$opts{o}\" - check permissions?\n";

foreach (@packages) {

    # Grab pure package name

    /^\x1B.+?m(.+)\/\x1B.+?m(.+)\ /s;

    my $package = "$1\/$2";

    my $name = $2;

    # Output package to world.new unless it is a system package

    unless ($syspackages{$name}) {

        print FILE "$package\n" or

            die "Could not output $package to \"$opts{o}\"";

        print "Added: $package\n" if($opts{v});

    }

}

close(FILE);

# Finished

print "Success. Please edit the \"$opts{o}\" file to your satisfaction. "

      ."Then copy it to \"/var/cache/edb/world\"\n\n" if($opts{v});

1;

```

Feel free to comment.

----------

## rac

I'm currently advising people not to add things to the world file manually (deleting is OK), because of some reports of Portage errors saying "Error: package in world file not installed".  Can anybody verify that this is or is not a problem (and if it is, is there a way around it so that manual adding to the world file can be made safe)?

----------

## iKiddo

 *rac wrote:*   

> I'm currently advising people not to add things to the world file manually (deleting is OK), because of some reports of Portage errors saying "Error: package in world file not installed".  Can anybody verify that this is or is not a problem (and if it is, is there a way around it so that manual adding to the world file can be made safe)?

 

Doesn't portage have a second place where it stores which apps are installed using something like /var/db/app-name/ ?? (It's where all the sizes of the files that are installed by packages are stored. I can't check, as I'm using windows right now). It might be used for backing up a lost world file, but portage might use it to make sure the world file is OK. I guess portage uses both locations, so that the world file can be used for updating (and not updating) without losing information necessary to unmerge stuff.

----------

## rac

 *iKiddo wrote:*   

> Doesn't portage have a second place where it stores which apps are installed using something like /var/db/app-name/ ??

 I think you're referring to /var/db/pkg.  Yes, that directory is really the crucial one for Portage.  However, the world file is more selective.  You can have things on your machine that aren't in your world file, because they may have been brought in as dependencies.  Also, one of the main tricks for people mixing stable and unstable packages is removing unstable things from the world file, so it's not necessarily a one-to-one correspondence between /var/cache/edb/world and the contents of /var/db/pkg.

----------

## iKiddo

 *rac wrote:*   

>  *iKiddo wrote:*   Doesn't portage have a second place where it stores which apps are installed using something like /var/db/app-name/ ?? I think you're referring to /var/db/pkg.  Yes, that directory is really the crucial one for Portage.  However, the world file is more selective.  You can have things on your machine that aren't in your world file, because they may have been brought in as dependencies.  Also, one of the main tricks for people mixing stable and unstable packages is removing unstable things from the world file, so it's not necessarily a one-to-one correspondence between /var/cache/edb/world and the contents of /var/db/pkg.

 

I'm sorry if I wasn't being clear, but that was what I wanted to say, plus that portage stores what's being installed in /var/db/pkg. The world file (just like the gnome and kde files in /var/cache/edb/) are simply files which can be used to collect different packages so you can update or install more easy.

----------

## kerframil

 *Quote:*   

> The world file (just like the gnome and kde files in /var/cache/edb/) are simply files which can be used to collect different packages so you can update or install more easy.

 

Yes, that is correct. The only inherent danger of densely populating your world file is that Portage may upgrade libraries (when issuing emerge world or emerge -u world) before applications that depend on those libraries have been re-written to cope with them. In the case where the API for these libraries has been changed substantially, or in a way that breaks compatibility - that could cause a problem. That is why I propose adding a switch to the script that filters anything from ".+\-lib\/.+" from going into the world file.

BTW, some nice changes sibbe.

----------

## rac

mjc was kind enough to discuss this issue with me on IRC, and here's the official word - you can add anything to the world file manually that you want, but after adding things, the very next thing you should do is "emerge world".  Otherwise, you may get the "package in world file not installed" error when doing other emerges.

----------

## kerframil

 *Quote:*   

> you can add anything to the world file manually that you want, but after adding things, the very next thing you should do is "emerge world"

 

Very interesting; thank you for sharing that. I must be fortunate not to have been afflicted by this already. Would you happen to know if this is considered as a bug, and whether it has been filed as such?

----------

## rac

 *kerframil wrote:*   

> Would you happen to know if this is considered as a bug, and whether it has been filed as such?

 mjc seemed to pretty much shrug off the "package in world file not installed error", saying that it wasn't a big deal because you could just "emerge world".  I speculate that it's considered a feature, because of the following case: you add A to the world file manually, but don't actually have it installed yet.  Now you "emerge B", which has a dependency on A.  Portage looks and sees that A is in the world file, so it doesn't need to install it, but then realizes that it's not actually on the system.  I supposed the kind thing to do would be to install A, but maybe we're talking about a broken contract between two parts of Portage.

I took mjc's statement to mean "running emerge in general in a state where the world file contains things that aren't on the system is not such a great idea, and "emerge world" after adding them manually avoids this".  If all you're doing is adding things to the world file that are installed already, there should be no problem.

----------

## frodo

I accidently deleted my /var/cache/edb/world file, so I tried this script, with some disconcerting results.  Clearly, I have a lot to learn about the world file, and portage.  Anyway, just prior to stupidly, accidentally deleting /var/cache/edb/world file, I had this in my xterm:

```

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[ebuild    U ] app-admin/gentoolkit-0.1.19-r1 [0.1.18-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/cpio-2.5 [2.4.2-r4] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3] 

```

After running the script, I get this:

```

Calculating world dependencies ...done!

[ebuild  N   ] net-libs/linc-1.0.1  

[ebuild  N   ] gnome-base/ORBit2-2.6.0  

[ebuild    U ] gnome-base/gconf-1.2.1 [1.0.8-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] net-print/cups-1.1.18-r4 [1.1.17_pre20021025] 

[ebuild    U ] media-gfx/gimp-print-4.2.4 [4.2.2] 

[ebuild    U ] dev-java/ant-1.5.1-r3 [1.5.1-r2] 

[ebuild  N   ] gnome-base/bonobo-activation-2.2.1  

[ebuild  N   ] gnome-base/libbonobo-2.2.0  

[ebuild  N   ] net-nds/portmap-5b-r6  

[ebuild  N   ] app-admin/fam-oss-2.6.9-r1  

[ebuild    U ] gnome-base/gnome-vfs-2.2.2 [1.0.5-r3] 

[ebuild  N   ] media-libs/libart_lgpl-2.3.10  

[ebuild  N   ] gnome-base/libgnomecanvas-2.2.0.1  

[ebuild  N   ] gnome-base/libgnome-2.2.0.1  

[ebuild  N   ] gnome-base/libbonoboui-2.2.0  

[ebuild  N   ] x11-themes/gnome-icon-theme-1.0.0  

[ebuild  N   ] x11-themes/gtk-engines-metal-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-thinice-2.0.2  

[ebuild  N   ] x11-themes/gtk-engines-redmond95-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-pixbuf-2.2.0  

[ebuild  N   ] x11-themes/gnome-themes-2.2  

[ebuild  N   ] gnome-base/libgnomeui-2.2.0.1  

[ebuild  N   ] x11-libs/startup-notification-0.5  

[ebuild  N   ] gnome-base/gnome-desktop-2.2.0.1  

[ebuild  N   ] x11-wm/metacity-2.4.34  

[ebuild    U ] gnome-base/control-center-2.2.0.1 [1.4.0.5-r1] 

[ebuild    U ] net-ftp/curl-7.10.2 [7.9.7] 

[ebuild    U ] dev-util/gob-2.0.2 [1.0.12] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3]

[ebuild    U ] app-text/gnome-spell-0.5 [0.4.1-r3]

```

This looks to me like my new world file is now grossly overpopulated.  What are the guidelines regarding what should be in the world file?  I have read that the world file contains a list of packages that I have expressly emerged.  Most of the files on the second list do not fall into this category.

I have also read that it can be dangerous to add things to the world file, but that it is OK to delete things.  I guess what I'm looking for is a little help and guidance in trying to get back to where I was before (or at least close).  Thanks.

Bob

----------

## frodo

I accidently deleted my /var/cache/edb/world file, so I tried this script, with some disconcerting results.  Clearly, I have a lot to learn about the world file, and portage.  Anyway, just prior to stupidly, accidentally deleting /var/cache/edb/world file, I had this in my xterm:

```

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[ebuild    U ] app-admin/gentoolkit-0.1.19-r1 [0.1.18-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/cpio-2.5 [2.4.2-r4] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3] 

```

After running the script, I get this:

```

Calculating world dependencies ...done!

[ebuild  N   ] net-libs/linc-1.0.1  

[ebuild  N   ] gnome-base/ORBit2-2.6.0  

[ebuild    U ] gnome-base/gconf-1.2.1 [1.0.8-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] net-print/cups-1.1.18-r4 [1.1.17_pre20021025] 

[ebuild    U ] media-gfx/gimp-print-4.2.4 [4.2.2] 

[ebuild    U ] dev-java/ant-1.5.1-r3 [1.5.1-r2] 

[ebuild  N   ] gnome-base/bonobo-activation-2.2.1  

[ebuild  N   ] gnome-base/libbonobo-2.2.0  

[ebuild  N   ] net-nds/portmap-5b-r6  

[ebuild  N   ] app-admin/fam-oss-2.6.9-r1  

[ebuild    U ] gnome-base/gnome-vfs-2.2.2 [1.0.5-r3] 

[ebuild  N   ] media-libs/libart_lgpl-2.3.10  

[ebuild  N   ] gnome-base/libgnomecanvas-2.2.0.1  

[ebuild  N   ] gnome-base/libgnome-2.2.0.1  

[ebuild  N   ] gnome-base/libbonoboui-2.2.0  

[ebuild  N   ] x11-themes/gnome-icon-theme-1.0.0  

[ebuild  N   ] x11-themes/gtk-engines-metal-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-thinice-2.0.2  

[ebuild  N   ] x11-themes/gtk-engines-redmond95-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-pixbuf-2.2.0  

[ebuild  N   ] x11-themes/gnome-themes-2.2  

[ebuild  N   ] gnome-base/libgnomeui-2.2.0.1  

[ebuild  N   ] x11-libs/startup-notification-0.5  

[ebuild  N   ] gnome-base/gnome-desktop-2.2.0.1  

[ebuild  N   ] x11-wm/metacity-2.4.34  

[ebuild    U ] gnome-base/control-center-2.2.0.1 [1.4.0.5-r1] 

[ebuild    U ] net-ftp/curl-7.10.2 [7.9.7] 

[ebuild    U ] dev-util/gob-2.0.2 [1.0.12] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3]

[ebuild    U ] app-text/gnome-spell-0.5 [0.4.1-r3]

```

This looks to me like my new world file is now grossly overpopulated.  What are the guidelines regarding what should be in the world file?  I have read that the world file contains a list of packages that I have expressly emerged.  Most of the files on the second list do not fall into this category.

I have also read that it can be dangerous to add things to the world file, but that it is OK to delete things.  I guess what I'm looking for is a little help and guidance in trying to get back to where I was before (or at least close).  Thanks.

Bob

----------

## frodo

I accidently deleted my /var/cache/edb/world file, so I tried this script, with some disconcerting results.  Clearly, I have a lot to learn about the world file, and portage.  Anyway, just prior to stupidly, accidentally deleting /var/cache/edb/world file, I had this in my xterm:

```

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[ebuild    U ] app-admin/gentoolkit-0.1.19-r1 [0.1.18-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/cpio-2.5 [2.4.2-r4] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3] 

```

After running the script, I get this:

```

Calculating world dependencies ...done!

[ebuild  N   ] net-libs/linc-1.0.1  

[ebuild  N   ] gnome-base/ORBit2-2.6.0  

[ebuild    U ] gnome-base/gconf-1.2.1 [1.0.8-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] net-print/cups-1.1.18-r4 [1.1.17_pre20021025] 

[ebuild    U ] media-gfx/gimp-print-4.2.4 [4.2.2] 

[ebuild    U ] dev-java/ant-1.5.1-r3 [1.5.1-r2] 

[ebuild  N   ] gnome-base/bonobo-activation-2.2.1  

[ebuild  N   ] gnome-base/libbonobo-2.2.0  

[ebuild  N   ] net-nds/portmap-5b-r6  

[ebuild  N   ] app-admin/fam-oss-2.6.9-r1  

[ebuild    U ] gnome-base/gnome-vfs-2.2.2 [1.0.5-r3] 

[ebuild  N   ] media-libs/libart_lgpl-2.3.10  

[ebuild  N   ] gnome-base/libgnomecanvas-2.2.0.1  

[ebuild  N   ] gnome-base/libgnome-2.2.0.1  

[ebuild  N   ] gnome-base/libbonoboui-2.2.0  

[ebuild  N   ] x11-themes/gnome-icon-theme-1.0.0  

[ebuild  N   ] x11-themes/gtk-engines-metal-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-thinice-2.0.2  

[ebuild  N   ] x11-themes/gtk-engines-redmond95-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-pixbuf-2.2.0  

[ebuild  N   ] x11-themes/gnome-themes-2.2  

[ebuild  N   ] gnome-base/libgnomeui-2.2.0.1  

[ebuild  N   ] x11-libs/startup-notification-0.5  

[ebuild  N   ] gnome-base/gnome-desktop-2.2.0.1  

[ebuild  N   ] x11-wm/metacity-2.4.34  

[ebuild    U ] gnome-base/control-center-2.2.0.1 [1.4.0.5-r1] 

[ebuild    U ] net-ftp/curl-7.10.2 [7.9.7] 

[ebuild    U ] dev-util/gob-2.0.2 [1.0.12] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3]

[ebuild    U ] app-text/gnome-spell-0.5 [0.4.1-r3]

```

This looks to me like my new world file is now grossly overpopulated.  What are the guidelines regarding what should be in the world file?  I have read that the world file contains a list of packages that I have expressly emerged.  Most of the files on the second list do not fall into this category.

I have also read that it can be dangerous to add things to the world file, but that it is OK to delete things.  I guess what I'm looking for is a little help and guidance in trying to get back to where I was before (or at least close).  Thanks.

Bob

----------

## frodo

I accidently deleted my /var/cache/edb/world file, so I tried this script, with some disconcerting results.  Clearly, I have a lot to learn about the world file, and portage.  Anyway, just prior to stupidly, accidentally deleting /var/cache/edb/world file, I had this in my xterm:

```

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[ebuild    U ] app-admin/gentoolkit-0.1.19-r1 [0.1.18-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/cpio-2.5 [2.4.2-r4] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3] 

```

After running the script, I get this:

```

Calculating world dependencies ...done!

[ebuild  N   ] net-libs/linc-1.0.1  

[ebuild  N   ] gnome-base/ORBit2-2.6.0  

[ebuild    U ] gnome-base/gconf-1.2.1 [1.0.8-r3] 

[ebuild    U ] sys-kernel/gentoo-sources-2.4.20-r1 [2.4.19-r10] 

[ebuild    U ] net-print/cups-1.1.18-r4 [1.1.17_pre20021025] 

[ebuild    U ] media-gfx/gimp-print-4.2.4 [4.2.2] 

[ebuild    U ] dev-java/ant-1.5.1-r3 [1.5.1-r2] 

[ebuild  N   ] gnome-base/bonobo-activation-2.2.1  

[ebuild  N   ] gnome-base/libbonobo-2.2.0  

[ebuild  N   ] net-nds/portmap-5b-r6  

[ebuild  N   ] app-admin/fam-oss-2.6.9-r1  

[ebuild    U ] gnome-base/gnome-vfs-2.2.2 [1.0.5-r3] 

[ebuild  N   ] media-libs/libart_lgpl-2.3.10  

[ebuild  N   ] gnome-base/libgnomecanvas-2.2.0.1  

[ebuild  N   ] gnome-base/libgnome-2.2.0.1  

[ebuild  N   ] gnome-base/libbonoboui-2.2.0  

[ebuild  N   ] x11-themes/gnome-icon-theme-1.0.0  

[ebuild  N   ] x11-themes/gtk-engines-metal-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-thinice-2.0.2  

[ebuild  N   ] x11-themes/gtk-engines-redmond95-2.2.0  

[ebuild  N   ] x11-themes/gtk-engines-pixbuf-2.2.0  

[ebuild  N   ] x11-themes/gnome-themes-2.2  

[ebuild  N   ] gnome-base/libgnomeui-2.2.0.1  

[ebuild  N   ] x11-libs/startup-notification-0.5  

[ebuild  N   ] gnome-base/gnome-desktop-2.2.0.1  

[ebuild  N   ] x11-wm/metacity-2.4.34  

[ebuild    U ] gnome-base/control-center-2.2.0.1 [1.4.0.5-r1] 

[ebuild    U ] net-ftp/curl-7.10.2 [7.9.7] 

[ebuild    U ] dev-util/gob-2.0.2 [1.0.12] 

[ebuild    U ] x11-libs/qt-3.1.0-r3 [3.1.0-r1] 

[ebuild    U ] app-office/openoffice-1.0.2 [1.0.1-r1] 

[ebuild    U ] sys-apps/pcmcia-cs-3.2.1-r4 [3.2.1-r3]

[ebuild    U ] app-text/gnome-spell-0.5 [0.4.1-r3]

```

This looks to me like my new world file is now grossly overpopulated.  What are the guidelines regarding what should be in the world file?  I have read that the world file contains a list of packages that I have expressly emerged.  Most of the files on the second list do not fall into this category.

I have also read that it can be dangerous to add things to the world file, but that it is OK to delete things.  I guess what I'm looking for is a little help and guidance in trying to get back to where I was before (or at least close).  Thanks.

Bob

----------

## hachre

Why did you post that 4 times?!?!

Well what I dont understand is:

earlier when I installed kde by "emerge kde" and did a emerge -u world after some days it updated all kde packages to newer versions...

nowadays my world file has about 20 entries, one of them is kde but no single kde part is in there (like kdeedu kdebase kdemedia and whatever) so when a new kde is out today emerge -u world does nothing...

also I have following problem: I have samba in use so kde installed samba for me... but samba doesnt appear in the world file so emerge -u world doesn't update samba...

emerge -uD is worse... It installs a 1_beta8 version of xine-libs and afterwards downgrades again because xine doesn't seem to work with it.... I really don't know what to do...

Someone told me not to use this script cause having libs in world will damage my system or something... But wasn't that the way it was some portage versions ago??

"cat world | wc -l" results in 45...

"cat world.new | wc -l" results in 211...

That means my original world file has got 45 entries - my new one created by this script has got 211 entries... Why doesn't world simply contain ALL stuff that has been installed??

----------

## kerframil

I presume some of the concerns raised here have been put to rest since. But just in case, let me point out a few things:The use of this script is largely superceded by:

```
emerge regenworld
```

which is safer.Also, the emerge -u --deep options help to apply extra depth when searching for possible things to update. This wasn't supported by Portage at the time of the postYes, it can be dangerous to update a shared library. A given package may only be coded to work properly with a particular version of a shared library. If this library is updated, then the package which depends upon it can (in theory) break, whereas other dependent packages may continue to work fine. Furthermore, you may need to recompile some apps so that they get linked against the new libs for best results.That is why world only contains what you explicitly ask to be emerged, unless you use the --oneshot option.emerge -u ... will upgrade all dependencies that satisfy a given ebuild as and when it is OK to update them. Negating the -u option will simply check if the named package is updateable itself.

I would also add that this script still has some interesting uses. For example, I wanted to re-install my system from scratch, but using binary packages which were built on a separate, fresh machine. This script provides a handy list that I could edit, then iterate through. For example, to roll back to a stage 3 state I could simply issue:

```
for p in `makeworld.pl`; do emerge -C ${p}; done
```

Its usefulness here is primarily in its method of separating system packages from non-system packages.

----------

## t0nik

are you can why this happen:

```
~> $ emerge -Dup world

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[ebuild    U ] media-video/avifile-0.7.34.20030319 [0.7.32.20030219] 

[ebuild    U ] app-text/docbook-sgml-utils-0.6.12 [0.6.11-r2] 

[ebuild    U ] media-libs/gstreamer-0.6.1-r1 [0.6.0-r2] 

[ebuild    U ] media-libs/gst-plugins-0.6.1 [0.6.0-r4] 

[ebuild    U ] gnome-base/gnome-desktop-2.2.1-r1 [2.2.1] 

[ebuild  N   ] app-dicts/aspell-en-0.50.2  

[ebuild    U ] x11-libs/vte-0.10.27 [0.10.26] 

[ebuild    U ] media-libs/libao-0.8.3-r1 [0.8.3] 

[ebuild    U ] gnome-extra/acme-2.0.3 [2.0.2] 

[ebuild    U ] sys-libs/lib-compat-1.1 [1.0-r2] 

[ebuild    U ] media-libs/id3lib-3.8.3-r1 [3.8.3] 

[ebuild    U ] dev-libs/libpcre-4.2 [3.9-r2] 

[ebuild  N   ] x11-wm/WindowMaker-0.80.2  

[ebuild  N   ] media-gfx/xv-3.10a-r3  

[ebuild    U ] media-libs/xine-lib-1_beta11 [1_beta9] 

~> $ emerge -up `qpkg -I -nc | grep -v ld\.so | grep -v rsync | grep -v gal2 | sort | uniq`

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild    U ] app-misc/rox-1.3.7 [1.3.4] 

[ebuild    U ] app-text/docbook-sgml-dtd-4.2 [4.1-r1] 

[ebuild    U ] app-text/docbook-sgml-utils-0.6.12 [0.6.11-r2] 

[ebuild    U ] dev-libs/libpcre-4.2 [3.9-r2] 

[ebuild    U ] dev-libs/libsigc++-1.2.3 [1.0.4-r2] 

[ebuild    U ] dev-util/cvs-1.11.5-r1 [1.11.2] 

[ebuild    U ] gnome-base/gnome-desktop-2.2.1-r1 [2.2.1] 

[ebuild    U ] gnome-extra/acme-2.0.3 [2.0.2] 

[ebuild  N   ] dev-db/edb-1.0.3.20030220-r1  

[ebuild  N   ] dev-libs/eet-0.0.1.20030310-r1  

[ebuild  N   ] x11-libs/evas-1.0.0.20030220_pre5-r1  

[ebuild    U ] media-libs/ebits-1.0.1.20030220-r1 [1.0.1.20030220] 

[ebuild    U ] media-libs/gstreamer-0.6.1-r1 [0.6.0-r2] 

[ebuild    U ] media-libs/gst-plugins-0.6.1 [0.6.0-r4] 

[ebuild    U ] media-libs/id3lib-3.8.3-r1 [3.8.3] 

[ebuild    U ] media-libs/libao-0.8.3-r1 [0.8.3] 

[ebuild    U ] media-libs/libdvdnav-0.1.7 [0.1.3] 

[ebuild    U ] media-libs/xine-lib-1_beta11 [1_beta9] 

[ebuild    U ] media-sound/sox-12.17.3-r3 [12.17.3-r2] 

[ebuild    U ] media-video/avifile-0.7.34.20030319 [0.7.32.20030219] 

[ebuild    U ] net-firewall/iptables-1.2.8 [1.2.7a-r3] 

[ebuild    U ] sys-libs/lib-compat-1.1 [1.0-r2] 

[ebuild    UD] net-www/netscape-flash-6.0.79 [6.0b] 

[ebuild    U ] sys-apps/supersed-3.60 [3.58-r2] 

[ebuild    U ] x11-libs/gtkmm-2.2.1 [1.2.9-r2] 

[ebuild    U ] x11-libs/vte-0.10.27 [0.10.26] 

[ebuild    U ] x11-plugins/wmnetload-1.3 [1.1] 

[ebuild    U ] x11-themes/redhat-artwork-0.65 [0.47] 

~> $ 
```

regenworld skip my favorite packages & don't put it in my world-file: e.g.  chromium leave the world-file, but still in my gentioo-box! 

it bestest for me --

```
~> $ emerge -up `qpkg -I -nc | grep -v ld\.so | grep -v rsync | grep -v gal2 | sort | uniq`
```

note:

```
grep -v somepackage
```

rejects the line with "somepackage"(for masked packages or special words like "rsync") from stdin to stdout

----------

