# [HOWTO] Hassle-free emerge -uD world (update-world v1.8)

## count_zero

New Version 1.8 (2/16/07)

I've added a lot of new features to the newest version of update-world.  It seems pretty stable (to me).  Let me know if there are any problems.

Changelog v1.8:

-Cleaned up and modularized code.  It should be a lot more readable now.

-Script now sources /etc/make.conf.  Several portage variables are used by this script now.

-Added ability to 'emerge -p <package> | update-world.  (realize that this is really only meant for updating existing packages...if you're installing a new one, you probably can't just skip a package failure, as it's likely a required dependency)

-Added interface with portage 2.1's elog capability.  You can type 'update-world --log' to view build messages after updating (mesages stored in ~/update-world/<date>/notice/.  Check out http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1#doc_chap4. if you haven't set up elog yet.

-Added interface with revdep-rebuild.  You can run it alone (update-world --revdep) to prepare a list of packages to install from revdep rebuild, or you can use it in conjunction with --install (update-world --revdep --install) to automatically run revdep-rebuild when the update is complete.

About update-world

If your experience is anything like mine, the process of updating a Gentoo system is no small endeavour.  Typing 'emerge -uD world' is an almost guaranteed day or two periodically checking on the process to make sure it hasn't died because of a compile failure.  I recently updated my system (680 packages !!!), which took literally 3 days because I would find that after I started the process and went to bed/work/etc., it would die within a few hours of starting it.  10 packages wouldn't compile properly, causing me to have to restart the emerge process 10 times.  This is obviously not very efficient.

This nightmarish update process led me to come up with something that makes things easier.  "update-world" is a bash script that controls the update process and forces portage to skip past failed builds and compile until the update is finished.  Failed builds are added to a list for review once the update is finished.

The script does depend on the 'equery' command, part of app-portage/gentoolkit.

Here's how to do it:

First, make the script executable and put it somewhere in your $PATH.

Then, run the script.

```
update-world --prepare

or

update-world --empty

or

emerge <package> | update-world
```

This begins the update process by creating a list of packages to be emerged, as produced by 'emerge -uD world'. (Alternatively, you can use 'update-world --empty' to create a list of all packages on the system, akin to 'emerge -e world').  This command creates a list called 'emergelist' in ~/.update-world/.  Now, you can use your favorite editor to modify this list how you like--remove packages, change versions, etc.  When you have the emergelist how you like it, you're ready to move onto the next step:

```
update-world --install
```

This command actually starts the build process, just as if you had typed emerge -uD world.  The difference is, if a package fails for some reason or another, that package is added to a list 'failedlist' in ~/.update-world/.  Also, a link to the portage log file for that package (usually located in /var/log/portage) is created in ~/.update-world/<date>/log/.  Once the process is done, you'll be presented with a list of failed packages to take care of all at once, saving much time.

Now you can automatically run revdep-rebuild whenever you update with update-world.  You can use it alone or in conjunction with --install.

```
update-world --revdep

or

update-world --revdep --install
```

Take advantage of portage 2.1's elog feature by running 'update-world --log' after an update to get those important messages that whiz by when doing a large update.

Look at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1#doc_chap4. for more information on setting this up.  These notices are stored in ~/.update-world/notice.

```
update-world --log
```

If you ever need to stop the process, just hit 'Control-C' to abort the process.  The update can then be restarted at any time, just where it left off, by retyping update-world --install.

I've only tested this on my machine, but it worked flawlessly, taking only 16 hours to compile all 680 packages.  And the ten packages that wouldn't compile were waiting for me to fix at my leisure.

So, you can download the latest stable version of the script here: http://dixieflatline.homelinux.org/files/gentoo/update-world

Mirror 1: http://dixieflatline.homelinux.org/files/gentoo/

Mirror 2 (thanks ryker!): http://www.mindlesstechie.net/gentoo/update-world/

Featured in Gentoo Weekly Newsletter 12/04/06   :Cool: 

http://www.gentoo.org/news/en/gwn/20061204-newsletter.xml

Here's the code:

```

#!/bin/bash

# update-world 1.8

# count_zero 2007

# Licensed under the GPLv2

#

# update-world is a bash script that forces an emerge -uD world to continue, even

# in the face of (inevitable) compile failures.  Failed builds are added to a list,

# and the script jumps to the next package in the queue.

#

# just run update-world --prepare (or --empty) followed by update-world --install.

#

# Release Notes:

# v1.8: Cleaned and modularized code.  Added ability to utilize revdep-rebuild if wished.  Can now pipe other

#       emerges into update-world.  Sources /etc/make.conf.  Added interfacing with elog.  Some bugfixes.

# v1.7  broken.

# v1.6.1: Bugfixes, added utf-8 support

# v1.6: Script preserves colored output.  Fixed version numbering in help output.

# v1.5: now handles 'fetch restriction' properly

# v1.4: uses '--newuse' for emerges to respect new use flags

# v1.3: uses '--oneshot' for emerges so they don't get added to the world file.

# v1.2: Script now detects log directly instead of accepting only /var/log/portage

# v1.1: minor bugfix to allow package without version to be added to 'emergelist'

# v1.0: Release

#

#

#### Help ####

# Help information

displayhelp ()

{

echo "update-world 1.8

count_zero 2007

licensed under the GPLv2

http://www.fsf.org/licensing/licenses/gpl.txt

Description:

This is a bash script to automate the 'emerge -uD world' process.

The default program directory is ~/.update-world.

Error logs are filed in ~/.update-world/<date>/log.

Ebuild notices (elogs) are filed in ~/.update-world/<date>/notice.

Usage:

update-world [ --help | -h ]

   Display this help file and exit.

update-world [ --prepare | -p ]

   Prepares a list of packages produced by 'emerge -puvD world'

   and outputs them to the file 'emergelist' in the current directory.

   Add, remove, or change the version of any of the packages listed

   in this file with your favorite editor before continuing.

update-world [ --empty | -e ]

   Same as --prepare except it performs 'emerge -ev world' to recompile

   all packages on a system.

update-world [ --install | -i ]

   Begins the emerge process based upon the 'emergelist' file created 

   from running 'update-world --prepare'.  Once finished, failed builds

   will be saved in the file 'failedlist' in the program directory.

update-world [ --revdep | -r ]

   Run revdep-rebuild to prepare the emergelist.  Can be used alone

   or in conjunction with --install.

emerge -p <package> | update-world

   Let portage produce an emergelist determined by a package.  This can be

   useful for large packages with lots of dependencies (kde, gnome, xorg, etc.).

   Once complete, run update-world --install.

update-world [ --log | -l ]

   View the ebuild notices (elogs) of packages installed by update-world,

   sorted by date.

"

}

#### end help ####

# Set the program directory and important variables

source /etc/make.conf

export EMERGE_DEFAULT_OPTS=""

homedir=~/.update-world

workdir="$homedir/`date +%F`"

logdir="$workdir/log"

noticedir="$workdir/notice"

mkdir -p $logdir

mkdir -p $noticedir

touch $homedir/failedlist

emergelist=$homedir/emergelist

emergetemp=$workdir/emergetemp

failedlist=$homedir/failedlist

parameter="-puvD --newuse"

#### error-check ####

# make sure there are no errors in the emerge process.

errorcheck ()

{

cat $emergelist | xargs emerge -p > $emergetemp

if [[ -n `cat $emergetemp | grep '\[blocks'` ]]

   then echo "WARNING: You have a blocking package.  Fix this before continuing."; exit 1

   exit 1

   elif grep -q "masked by:" $emergetemp

   then echo "WARNING: You may need to unmask some packages before continuing."; exit 1

   elif grep -q "emerge: there are no ebuilds to satisfy" $emergetemp

   then echo "WARNING: One of the specified packages doesn't exist"; exit 1

   elif [[ -n `cat $emergetemp | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*F[[:upper:][:lower:] ]*\].*/&/p'` ]]

   then fetchrestricted=`cat $emergetemp | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*F[[:upper:][:lower:] ]*\].*/&/p' | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/\1/p'`

   echo -e "\nWARNING: The following packages have Fetch Restriction turned on:\n$fetchrestricted"

   for each in $fetchrestricted

   do emerge =$each

   done

   exit 1

   else :

fi

}

#### end error-check ####

#### empty ####

# parameter for '--empty' to emerge -e world

empty ()

{

parameter='-pev'

}

#### end empty

#### prepare ####

# Prepare the list of packages to emerge into emerglist

prepare ()

{

if [[ -e "$emergelist" ]]

   then echo -en "The file 'emergelist' already exists and will be overwritten.\nContinue anyway? (Y/n) "

   read continue

   if [[ "$continue" = 'y' || "$continue" = 'yes' || "$continue" = 'Y' || "$continue" = 'Yes' || "$continue" = 'YES' || "$continue" = '' ]]

      then :

      else echo exiting.

      exit 0

   fi

   else :

fi

emerge $parameter world > $emergelist

errorcheck

emerge $parameter world

echo -e "\nThese are the packages that will be installed.  If you want to alter this list,\njust edit the file 'emergelist' in $homedir. When finished,\nrun 'update-world --install'"

cat $emergelist | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/\1/p' | sed 's/.*/=&/' | sort -d > $emergetemp

cp $emergetemp $emergelist

rm -f $failedlist

}

#### end prepare ####

#### installworld ####

# Install the packages listed in emergelist

installworld ()

{

# Make sure there's an emergelist

if [[ -s "$emergelist" ]]

   then :

   else echo "WARNING: no 'emergelist' exists.  Did you run 'update-world --prepare' first?"; exit 1

fi

errorcheck

condition=false

# set begin time

before_time="${before_time:=`date +%s`}"

# Until loop to make portage continue until finished

until [[ $condition = true ]]

do

   cat $emergelist | xargs emerge -1

   # Detect which packages have been successfully emerged and remove from the queue

   installed=`tac /var/log/emerge.log | sed '/Started\ emerge/,$d' | grep "completed emerge" | sed 's/^.*)\ //' | sed 's/\ to.*//'`

   for each in `cat "$emergelist" | sed 's/^=//'`

   do

      if [[ -n `echo "$installed" | grep "$each"` ]]

         then

         # Checking emerge logs for any ebuild notices

         einfo=""

         notice="$noticedir/${each/\//:}-notice.log"

         elog="${PORT_LOGDIR}/elog/`ls -lt $PORT_LOGDIR/elog | grep ${each/\//:} | sed '2,$ d' | sed 's/.*\ //'`"

         if [[ -n "$PORTAGE_ELOG_SYSTEM" ]] && [[ -n "${einfo:=`cat $elog | sed '/^$/d' | sed '/^[ ]*$/d' | sed 's/.*/ * &/'`}" ]]

            then 

            echo ------------------------ > $notice

            echo -e "$each \n" >> $notice

            echo "$einfo" >> $notice

            echo ------------------------ >> $notice

            else :

         fi

         # Removing successful emerges 

         each=`echo ${each//\//\\/} | sed 's/\-[0-9].*//'`

         cat $emergelist | sed "/${each//\//\\/}/d" > $emergetemp

         mv $emergetemp $emergelist

      fi

   done

   # See if all packages have been emerged.  If so, exit function "installworld"

   if [[ -z `cat "$emergelist"` ]]

      then condition=true

      break

      else :

   fi

   ## If there are remaining packages, find why the emerge stopped

   errorlog=`ls -t $PORT_LOGDIR | sed '2,$d'`

   # if user-initiated "control-c" just exit.

   if [[ -n `cat $PORT_LOGDIR/$errorlog | grep 'signal 2'` ]]

      then echo -e "\n*** User hit 'Control-C' ... exiting.\n"

      exit 1

      else :

   fi

   # if package failed, give user chance to stop update-world

   sleep 5

   echo

   echo "*** Hit Control-C to exit, or just wait to continue with emerge."

   echo

   sleep 10

   echo "*** Continuing with emerge."

   # Detect failed emerge and add to failedlist, remove failed package from emergelist

   failedpkg=`tac /var/log/emerge.log | sed '1d' | sed '/terminating/,$d' | sed '/completed\ emerge/,$d' | grep ">>>" | sed 's/.*)\ //' | sed 's/\ to.*//'`

   #### uh-oh, stop if something's really wrong to prevent infinite emerge (tried to emerge same package again)

   if [[ -n `tail -n 1 $failedlist | grep $failedpkg` ]]

      then echo "The failed package $failedpkg could not be merged and must be successfully installed before continuing."

      exit 1

      else :

   fi

   

   echo $failedpkg >> $failedlist

   # if package added to emergelist manually doesn't have a version, make sure it's still removed if it fails

   if [[ -z `cat "$emergelist" | grep "$failedpkg"` ]]

      then failedpkg2=`equery which =$failedpkg | sed 's/\/[^/]*$//' | sed -n 's/.*\/\([^/]*\/[^/]*\)/\1/p'`

      cat $emergelist | sed "/^${failedpkg2//\//\\/}/d" > $emergetemp

      else cat $emergelist | sed "/${failedpkg//\//\\/}/d" > $emergetemp

   fi

   mv $emergetemp $emergelist

   # link to the log file of the failed package

   ln -s $PORT_LOGDIR/$errorlog $logdir/${errorlog}_error-log

   echo

   echo

   echo "*** $failedpkg compile failed, skipping."

   # Is there a package in 'emergelist' that REQUIRES the failed package as a dep? If so, remove it too.

   failedpkgdeps=`equery which =$failedpkg | sed 's/\/[^/]*$//' | sed -n 's/.*\/\([^/]*\/[^/]*\)/\1/p'`

   deps=`equery depends $failedpkgdeps | sed '/^\[/d' | sed 's/.*/=&/'`

   for each in `echo $deps`

   do

      if [[ -n `cat $emergelist | grep "$each"` ]]

         then

         if [[ -n `emerge -p $each | grep "$failedpkg"` ]]

            then

            each2=`cat $emergelist | grep $each | sed 's/\=//'`

            echo "$each2 (depends on $failedpkg)" >> $failedlist

            cat $emergelist | sed "/${each//\//\\/}/d" > $emergetemp

            mv $emergetemp $emergelist

            echo "*** $each depends on $failedpkg, skipping."

            else :

         fi

         else :

      fi

   done

   if [[ -z `cat "$emergelist"` ]]

      then condition=true

      break

      else :

   fi

   echo "*** Continuing with emerge world"

done

}

#### end installworld ####

#### revdep-rebuild ####

# this script can call revdep-rebuild and get it's emergelist from there.

# useful to run in conjunction with update-world --install, it will automatically

# run revdep-rebuild after the emerge -uD world is complete

revdep ()

{

rm /root/.revdep-rebuild*.?_*

revdep-rebuild --package-names --pretend | tee $emergelist

cat $emergelist | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/\1/p' | sed 's/.*/=&/' > $emergetemp

mv $emergetemp $emergelist

}

#### end revdep-rebuild ####

#### piped ####

# emergelist is piped from another emerge (i.e., emerge kde | update-world)

piped ()

{

echo "$piped" > $emergelist

errorcheck

cat $emergelist | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/\1/p' | sed 's/.*/=&/' > $emergetemp

mv $emergetemp $emergelist

cat $emergelist | xargs emerge -p

echo -e "\nThese are the packages that will be installed.  If you want to alter this list,\njust edit the file 'emergelist' in $homedir. When finished, run\n'update-world --install'"

}

#### end piped ####

#### finished ####

# Display closing messages

finished ()

{

echo -e "\n\nCongratulations!  'update-world' complete."

elapsed_time

echo

# All done! display the failed packages, if any

if [[ -z `cat $failedlist` ]]

   then echo "All packages emerged successfully"

   else echo "These packages couldn't be merged due to compile errors:"

   echo

   cat $failedlist

   echo

   echo -e "Look in $logdir/ for the portage log files of the failed builds.\nCheck bugs.gentoo.org or the Gentoo Forums for help."

fi

if [[ -n "$PORTAGE_ELOG_SYSTEM" ]]

   then echo -e "\n * To review portage elog notices, type \"update-world --log\"\n"

   else echo " * To enable portage notice viewing with elog, check out http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1#doc_chap4."

fi

}

#### end finished ####

#### elapsed_time ####

# just for fun let's see how long the process takes...

elapsed_time ()

{

after_time=`date +%s`

time=$(( after_time - before_time ))

days=$(( time / 86400 ))

time=$(( time - ( days * 86400 ) ))

hours=$(( time / 3600 ))

time=$(( time - ( hours * 3600 ) ))

minutes=$(( time / 60 ))

time=$(( time - ( minutes * 60 ) ))

seconds=$time

if [[ "$days" -eq 0 ]]

   then days=""

elif [[ "$days" -eq 1 ]]

   then days="$days day, "

elif [[ "$days" -gt 1 ]]

   then days="$days days, "

fi

if [[ "$hours" -eq 0 ]]

   then hours=""

elif [[ "$hours" -eq 1 ]]

   then hours="$hours hour, "

elif [[ "$hours" -gt 1 ]]

   then hours="$hours hours, "

fi

if [[ "$minutes" -eq 0 ]]

   then minutes=""

elif [[ "$minutes" -eq 1 ]]

   then minutes="$minutes minute, and "

elif [[ "$minutes" -gt 1 ]]

   then minutes="$minutes minutes, and "

fi

seconds="$seconds seconds"

echo -e "Total compiling time: $days$hours$minutes$seconds.\n"

}

#### end elapsed_time ####

#### What should the script do when invoked? ####

# I have nine functions: displayhelp, empty, prepare, errorcheck, installworld, revdep, piped, elapsed_time, and finished

arguments="$@"

# update-world --help

if [[ -n `echo "$arguments" | sed -n 's/-h/&/p'` || -n `echo "$arguments" | sed -n 's/--help/&/p'` ]]

   then

   displayhelp

   exit 0

   else :

fi

# update-world --empty

if [[ -n `echo -e \\t "$arguments" | sed -n 's/-e/&/p'` || -n `echo "$arguments" | sed -n 's/--empty/&/p'` ]]

   then echo Preparing list of packages...

   empty

   prepare

   exit 0

   else :

fi

# update-world --prepare

if [[ -n `echo "$arguments" | sed -n 's/-p/&/p'` || -n `echo "$arguments" | sed -n 's/--prepare/&/p'` ]]

   then echo Preparing list of packages...

   prepare

   exit 0

   else :

fi

# update-world --install

if [[ -n `echo "$arguments" | sed -n 's/-[[:lower:]]*i/&/p'` || -n `echo "$arguments" | sed -n 's/--install/&/p'` ]]

   then

   installworld

   check=true

   else :

fi

# update-world --revdep

if [[ -n `echo "$arguments" | sed -n 's/-[[:lower:]]*r/&/p'` || -n `echo "$arguments" | sed -n 's/--revdep/&/p'` ]]

   then

   revdep

   if [[ -s "$emergelist" ]]

      then installworld

      else :

   fi

   check=true

   else :

fi

# emerge -p <package> | update-world

# piped command MUST include --pretend !!!

if [[ "$arguments" = "" ]]

   then echo "No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information."

   until [[ `echo "$piped" | wc -l` -eq 10 ]] && [[ -z `echo "$piped" | grep 'Calculating dependencies'` ]] || [[ -z `echo "${piped:-1}" | tail -n 4` ]]

   do read line

   piped="${piped}

$line"

   done

   else :

fi

if [[ -n `echo "$piped" | sed -n 's/Calculating\ dependencies/&/p'` ]]

   then

   piped

   exit 0

   else :

fi

# update-world --log

if [[ -n `echo "$arguments" | sed -n 's/-l/&/p'` || -n `echo "$arguments" | sed -n 's/--log/&/p'` ]]

then echo "Choose a date: "

select directory in `ls -Al | grep ^d | sed 's/.*\ //'`

do 

   if [[ -n "$directory" ]]

      then date=$directory

      break

      else echo "invalid selection"

   fi

done

rm -f $homedir/$date/notice/log

for each in `ls $homedir/$date/notice/`

do cat $homedir/$date/notice/$each >> $homedir/$date/notice/log

done

less $homedir/$date/notice/log

check=true

exit 0

else :

fi

# Check if arguments were valid

if [[ ${check:-false} == false ]]

   then echo -e "Error: Invalid Command.\nRun 'update-world --help' for usage."

   exit 1

   else :

fi

# done! Display closing text

finished

exit 0

```

Let me know if you find any bugs or have feedback.  Good luck!   :Very Happy: 

[Update] 9/13/06 (version 1.1)

Fixed script to prevent errors when adding a package without specifying a version number to 'emergelist'.

[Update] 10/27/06 (version 1.2)

Script now automatically detects the portage log directory instead of just assuming /var/log/portage.

[Update] 11/22/06 (version 1.4) I guess my edit didn't take yesterday for v1.3...  :Shocked: 

Added --newuse and --oneshot to emerge variables.

[Update] 11/22/06 (version 1.5)

Now handles 'fetch restriction' properly, prompting user to download sources before continuing.

[Update] 12/06/06 (version 1.6)

Script preserves colored emerge output.  Fixed version numbering in help output.

[Update] 12/09/06 (version 1.7)

Cleaned up the code a little, fixed some bugs.  Check out the new feature for managing USE flags!

Edit: seems to be broken  :Sad: 

[Update] 12/10/06 (version 1.6.1)

bugfixes and utf-8 support.

[Update] 2/16/07 (version 1. :Cool: 

Cleaned and modularized code.  Added ability to utilize revdep-rebuild if wished.  Can now pipe other

emerges into update-world.  Sources /etc/make.conf.  Added interfacing with elog.  Some bugfixes.

----------

## therealkurisu

I'm fairly new to Gentoo (and linux in general ^_^) but I find this script to be VERY useful. I've ran it 5 or so times so far and haven't had any problems at all. It saves SO much time from compiling errors and general problems (and allows for skipping updates on known problematic areas!). 

Automated skipping, ftw. I reccomend that everyone try it out.

Good job count_zero.

(Also, <3 Crono and therefore, through association, you  :Razz: )

----------

## Doogman

This looks like a good idea.

While my dual-core system can compile packages at a good clip, rebuilding world always stalls out at some point requiring user intervention.  Instead of grinding away at the build list while I'm at work, the computer spends a good deal of time at idle until I get home again.  With this script, most of the work should be done while I'm away.

Maybe I'll finally tackle that gcc upgrade I've been putting off.

----------

## devsk

Removing deps of the failed pkgs is definitely better idea than portage's 'emerge --resume --skipfirst' which can break your system in no time.

----------

## count_zero

It was discussed in another thread about combining this script with emerging packages in the correct order, a la this thread by Guenther Brunthaler (thanks for a job well done, Guenther  :Very Happy: ).  

If you run Guenther's script up until the point at which you will start rebuilding your system (gcc already emerged), you'll end up with a file '/root/recompile-remaining-packages'.  This file contains all of the packages to be emerged, in the order to best rebuild the toolchain and the rest of the system.  It's pretty easy to interface this with update-world:

```
grep "item " /root/recompile-remaining-packages | sed 's/item\ .*\ //' > ~/.update-world/emergelist
```

and then 

```
update-world --install
```

Have fun with interruption-free emerging of your system in the "correct" order.  :Cool: 

----------

## Bynds

This script has just cured every headache I had with my Gentoo box (I'm not a heavy user   :Very Happy:  )

It took me weeks to update my old compaq server when I dusted it off after about 2 years in the cupboard, this would have saved me about half my time.

Fantastic!

----------

## bender02

Great script, thanks!

I have one thing though, while running "update-world --install", I get an error like

```
cat: /var/log/portage/elog: Is a directory
```

and the dir inside .update-world which is supposed to contain the logs for failed packages contains only a link to /var/log/portage/elog.

My logs structure for elog is that /var/log/portage/elog is a directory containing logs for various emerges. Is there an easy way to fix this? Thanks.

----------

## count_zero

The problem was that the script assumed that /var/log/portage was the portage log directory.  I've updated the script so that it detects the setting of PORT_LOGDIR in /etc/make.conf.  I've updated the code in the first post, but my (free) webhost is giving me some problems so I can't update the download yet  :Sad: 

----------

## bender02

Great! Thanks! (But I'm gonna get to test it only next time I sync...)

----------

## count_zero

Download link fixed!

----------

## ryker

This script needs more exposure!  This is the most useful emerge wrapper that I have seen yet.  They should feature it on GWN sometime.

Thank you for your time and effort on this.

----------

## richfish

Shouldn't this script use --oneshot for merging packages so it doesn't pollute the world file with all the packages it updates?

----------

## count_zero

Good idea!

Easy to implement too.  I just added '-1' to the end of line 101 in the script.

----------

## RageOfOrder

Wow, this is just awesome. I've been putting this off for weeks. I think I'll finally update everything on wednesday night.

Thanks for all your hard work!

----------

## dkure

It would be great if there was two more features.

This script should include --newuse, to make sure use flags are respected.

Second is more of a request, and is a package fetch option. This would fetch the packages selected in the .update_world file. Allowing packages to be downloaded in the background overnight before packages are selected if need be.

I agree that this script should certainly get featured on GNN, makes updating simpler and more specialized to peoples needs.

----------

## count_zero

 *Quote:*   

> This script should include --newuse, to make sure use flags are respected. 

 

I guess the meaning of "--newuse" has changed since I last read the man page...I thought that (when used in conjunction with --update world) it updated ONLY those packages that would be affected by recently changed USE flags.

From the Gentoo Wiki (http://gentoo-wiki.com/MAN_emerge):

 *Quote:*   

> --newuse (-N) 
> 
> Tells emerge to include installed packages where USE flags have changed since compilation. An asterisk marks when a USE flag has changed since the package was compiled. 

 

However, the gentoo handbook suggests that it might be useful in better updating an entire system.

From the installation handbook (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1):

 *Quote:*   

> Code Listing 14: Updating your entire system
> 
> # emerge --update --deep world
> 
> Since security updates also happen in packages you have not explicitly installed on your system (but that are pulled in as dependencies of other programs), it is recommended to run this command once in a while. 
> ...

 

So i guess I'm a little confused about whether --newuse would be helpful in this situation, where all packages will be updated anyway.  Doesn't portage look a new use flags anyway?  Maybe someone could clarify this?  Implementing this in the script is pretty trivial.

 *Quote:*   

> Second is more of a request, and is a package fetch option. This would fetch the packages selected in the .update_world file. Allowing packages to be downloaded in the background overnight before packages are selected if need be. 

 

I'll look into this, parallel fetching would be a useful feature. I believe it is going to be built into portage sometime in the future, but it could probably be implemented here.  I'll let you know.

 *Quote:*   

> I agree that this script should certainly get featured on GNN, makes updating simpler and more specialized to peoples needs.

 

Thanks for all the helpful feedback everyone, it makes doing stuff like this very enjoyable.  :Very Happy: 

----------

## ryker

I believe --newuse also implies --update.  Of course, you can always add additional parameters such as -D to catch more packages.  I added --newuse to the update-world script on my system and it works fine.

I just changed

```

# parameter for '--empty' to emerge -e world

if [[ $1 == '--empty' || $1 == '-e' ]]

   then parameter='-pev'

   else parameter='-puvD'
```

to 

```

# parameter for '--empty' to emerge -e world

if [[ $1 == '--empty' || $1 == '-e' ]]

   then parameter='-pev'

   else parameter='-puvD --newuse'
```

I love this script so much, I was planning on writing and submitting a tip to the GWN this weekend.

----------

## padoor

this is looking good for me too.

please instruct how do i install and run this .

which script do i download and how i can use it?

i need codes for full proceedure.

i am still newbee for these operations.

----------

## ryker

It's pretty straight forward and the instructions are clearly given in the first post.

Basically, all you have to do is:

1.  Download the latest version of the script from here. and save it as /usr/bin/update-world.

2.  chmod +x /usr/bin/update-world

That's it.  Now just type update-world and it tells you what to do.

----------

## padoor

that  was pretty easy

and it works noww.

i am due for world update in 2 days.

i will post the result , thanks for direction ryker   :Smile: 

----------

## padoor

i did an emerge --sync

then emerge -Du systaem.

update-world -p made a file list as follows

localhost ramaswamy # update-world -p

The file 'emergelist' already exists and will be overwritten.

Continue anyway? (y/n) y

These are the packages that would be merged, in order:

Calculating world dependencies  ..... ..... ..

!!! Ebuilds for the following packages are either all

!!! masked or don't exist:

net-im/ymessenger

... done!

[ebuild     U ] dev-java/sun-jdk-1.5.0.09-r1 [1.5.0.08] USE="X alsa -doc -examples -jce -nsplugin" 32,469 kB

[ebuild  N    ] virtual/jdk-1.5.0  0 kB

[ebuild     U ] x11-themes/gnome-backgrounds-2.16.2 [2.16.1] USE="-debug" 1,172 kB

[ebuild     U ] dev-java/sun-jre-bin-1.5.0.09-r1 [1.5.0.08-r1] USE="X alsa -nsplugin" 0 kB

[ebuild     U ] dev-cpp/gtkmm-2.10.2-r1 [2.8.3] USE="-accessibility% -debug -doc% -examples%" 0 kB

[ebuild    FU ] dev-java/sun-jdk-1.4.2.13 [1.4.2.12-r2] USE="X alsa -doc -examples -jce -nsplugin" 35,509 kB

[ebuild     U ] www-client/mozilla-firefox-bin-2.0 [1.5.0.7] LINGUAS="-ar -bg% -ca -cs -da -de -el -en_GB -es -es_AR -es_ES -eu% -fi -fr -fy% -fy_NL% -ga -ga_IE -gu% -gu_IN% -hu -it -ja -ko -lt% -mk -mn% -nb -nb_NO -nl -nn% -nn_NO% -pl -pt% -pt_BR -pt_PT% -ru -sk -sl -sv -sv_SE -tr -zh% -zh_CN -zh_TW (-he%) (-ro%)" 0 kB

[ebuild     U ] gnome-base/gnome-vfs-2.16.3 [2.16.2] USE="hal ipv6 ssl -avahi -debug -doc -gnutls -samba" 1,855 kB

[ebuild     U ] gnome-base/gnome-desktop-2.16.2 [2.16.1] USE="-debug -doc" 1,202 kB

[ebuild     U ] gnome-base/eel-2.16.3 [2.16.1] USE="X -debug" 657 kB

[ebuild     U ] gnome-base/nautilus-2.16.3 [2.16.2-r1] USE="X gnome -beagle -debug" 4,168 kB

[ebuild     U ] gnome-extra/evolution-data-server-1.8.2 [1.8.1-r1] USE="ipv6 ldap ssl -debug -doc -kerberos -keyring -krb4 -nntp" 6,800 kB

[ebuild     U ] gnome-extra/nautilus-cd-burner-2.16.2 [2.16.1-r1] USE="cdr dvdr -debug" 698 kB

[ebuild     U ] media-libs/xine-lib-1.1.3_pre20061119 [1.1.3_pre20061112] USE="X aac aalib alsa arts dvd esd gnome gtk ipv6 mad nls opengl oss sdl truetype vorbis win32codecs xv -a52 (-altivec) -debug -directfb -dts -dxr3 -fbcon -flac -imagemagick -libcaca -mmap -mng -modplug -pulseaudio -samba -speex -theora -v4l -vcd -vidix -xinerama -xvmc" 6,814 kB

[ebuild     U ] gnome-base/control-center-2.16.2 [2.16.1] USE="alsa eds -debug" 1,975 kB

[ebuild     U ] gnome-extra/gnome-games-2.16.2 [2.16.1.1] USE="-artworkextra -debug -guile (-avahi%)" 5,134 kB

[ebuild     U ] www-client/epiphany-2.16.2 [2.16.1] USE="python -debug -doc" 4,130 kB

[ebuild     U ] media-sound/sound-juicer-2.16.2 [2.16.1] USE="ogg -debug -flac" 1,236 kB

[ebuild     U ] app-arch/file-roller-2.16.2 [2.16.1] USE="gnome%* -debug" 1,105 kB

[ebuild     U ] gnome-extra/gtkhtml-3.12.2 [3.12.1] USE="-debug -static" 1,255 kB

[ebuild     U ] mail-client/evolution-2.8.2.1 [2.8.1.1] USE="crypt dbus hal ipv6 ldap spell ssl -bogofilter -debug -doc -kerberos -krb4 -mono -nntp -pda -profile" 12,618 kB

[ebuild     U ] net-misc/knemo-0.4.6 [0.4.5] USE="arts -debug -wifi -xinerama" 589 kB

[ebuild     U ] kde-base/nsplugins-3.5.5-r1 [3.5.5] USE="arts -debug -kdeenablefinal -kdehiddenvisibility -xinerama" 0 kB

Total: 23 packages (22 upgrades, 1 new), Size of downloads: 119,393 kB

Fetch Restriction: 1 package (1 unsatisfied)

These are the packages that will be installed.  If you want to alter this list,

just edit the file 'emergelist' in /root/.update-world. When finished, run

'update-world --install'

localhost ramaswamy #          

localhost ramaswamy # update-world --install

Calculating dependencies

emerge: there are no ebuilds to satisfy "=Fetch".

cat: /wget-log.3: No such file or directory

*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

sed: -e expression #1, char 0: no previous regular expression

ln: creating symbolic link `/root/.update-world/2006-11-23/log/wget-log.3_error-log': File exists

***  compile failed, skipping.

grep: invalid option -- ,

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unrecognized option `--all-packages'

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unknown directories method

grep: option `--direct' requires an argument

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unknown devices method

grep: unrecognized option `--indirect'

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

*** Continuing with emerge world

Usage:

   emerge [ options ] [ action ] [ ebuildfile | tbz2file | dependency ] [ ... ]

   emerge [ options ] [ action ] < system | world >

   emerge < --sync | --metadata | --info >

   emerge --resume [ --pretend | --ask | --skipfirst ]

   emerge --help [ system | world | config | --sync ]

Options: -[abBcCdDefgGhikKlnNoOpqPsStuvV] [--oneshot] [--newuse] [--noconfmem]

                                          [ --color < y | n >  ] [ --columns ]

                                                                 [--nospinner]

                                          [ --deep  ] [--with-bdeps < y | n > ]

Actions: [ --clean | --depclean | --prune | --regen | --search | --unmerge ]

   For more help try 'emerge --help' or consult the man page.

Congratulations!  'emerge world' complete.

All packages emerged successfully

localhost ramaswamy #                    

is this my options error or the fetch has some problem?

regular emerge -Du world does fetch the files and started with jdk

what mistake i am doing??

----------

## count_zero

 *ryker wrote:*   

> I believe --newuse also implies --update.  Of course, you can always add additional parameters such as -D to catch more packages.  I added --newuse to the update-world script on my system and it works fine.
> 
> I just changed
> 
> ```
> ...

 

Done!

I tested it also, and seems to work well.

Version 1.4 now reflects these changes.  The script above and the download link are updated.

----------

## count_zero

@padoor:

you've uncovered a couple of problems, I think they are pretty easily fixed.

 *Quote:*   

> Calculating world dependencies ..... ..... .. 
> 
> !!! Ebuilds for the following packages are either all 
> 
> !!! masked or don't exist: 
> ...

 

Portage isn't finding this package for your system.  It's probably masked on your system, and *could* (though maybe it shouldn't, find out why it's masked) be unmasked by adding 'net-im/ymessenger' to /etc/portage/package.unmask.

 *Quote:*   

> 
> 
> [ebuild FU ] dev-java/sun-jdk-1.4.2.13 [1.4.2.12-r2] USE="X alsa -doc -examples -jce -nsplugin" 35,509 kB
> 
> . . .
> ...

 

You'll need to download the sources for sun-jdk from the website and copy to /usr/portage/distfiles/ before running the script.

Fix these problems before re-running update-world.

I should be able to make some changes to the script so it handles these errors better.

----------

## padoor

i will finish emerge of jdk and stop the emerge -Du world and try again.

ymessenger is full masked and i have the latest version installed. so it can skip this file

lets see after i finish this jdk emerge,

----------

## count_zero

The script version 1.5 (second one tonight  :Shocked: ) properly handles "Fetch Restriction" now, prompting you to download the sources before continuing.

----------

## ASID

Great script count_zero!

Keep up the good work!

----------

## count_zero

Thanks to ryker for submitting the update-world script to the GWN for this week's Tips & Tricks section.

http://www.gentoo.org/news/en/gwn/20061204-newsletter.xml

I appreciate all of the support and helpful feedback from everyone!  :Very Happy: 

count_zero

----------

## Phlogiston

It will be nice if the script keeps the colored output of emerge.

Thanks anyway...

----------

## Phlogiston

Furthermore could you please add an option for choosing -N (--newuse) or not, because I don't like to update my UseFlags on every world update.   :Cool: 

----------

## ryker

Adding --newuse should only recompile packages with use flags that have changed.  If none have changed, nothing extra is compiled.  If they some use flags have changed, you really should recompile the package anyway.

Of course, I don't see any harm in offering the option to not use --newuse, but why would you intentionally not recompile a package with the proper use flags?

If it's because you just add use flags to your /etc/make.conf without regard for it's impact on other packages, that's a totally different issue.  :Wink: 

----------

## Mine GO BOOM

 *Phlogiston wrote:*   

> It will be nice if the script keeps the colored output of emerge.

 

Along these lines, I generally like to look at the -v USE flags, so whenever compiling I know if some use flag is off when it should be on. Sometimes when projects upgrade, they'll add a new use flag or another and it is nice to see it in the -vDu list.

----------

## colourblindangus

Great script, thanks!

Just a small thing:

When you run the script with no arguments and you get the about page, the version number is still 1.0

I only mention it as it is useful for keeping track of which version I have installed (and I am a bit of a perfectionist).

----------

## bunkacid

Thanks for the script.  This is something that is definitely needed for those long compile times we all love to hate.

I like the above suggestions about keeping color output, when preparing the list of packages.

I took the liberty to make a diff patch file for update-world which includes the correct version in the usage output.

The patch also uses sudo for the main emerge operation which requires root privileges.  Obviously this will require you to enter your password at least once depending on your sudo configuration.

http://px.ns1.net:81/~px/files/update-world.patch

I would also suggest that this script be added to the gentoolkit package as it is another great tool like elog.

----------

## count_zero

I just updated the script to preserve colored output from the emerge command.  I also fixed the version numbering (sorry colourblindangus!) in the help output.

@bunkacid:

I don't usually use sudo while using this script (just su -), but can't you just 

```
sudo update-world --install
```

to get it to work with sudo?  I don't think the script needs to be modified to do this properly.

----------

## bunkacid

 *count_zero wrote:*   

> 
> 
> @bunkacid:
> 
> I don't usually use sudo while using this script (just su -), but can't you just 
> ...

 

@count_zero

Ideally you should only be using root privileges which are needed for the actual emerge install.

Most of the stuff your script is doing from what I can tell is creating lists, which in my eyes should be done by the user, if he/she has the correct privileges to do so.

There's an old sysadmin adage about using a lightsaber to open a can of soup, when all you need is a pocket knife, but I forget how it goes.

----------

## capira

Hi all!

After reading this thread it's come to mi mind a very useful thread in the Spanish subforum (here).

Although the script is completely write in spanish, the code is easy to read  :Wink: . Mainly, what this script do is:

Sync your system

Download all the sources

Create a package for every ebuild

Send you an email, noticing which packages are ready an which need a manual emerging

I have improved it in several, making it more clever (the last post by capira)

If you find it useful, I would not mind to translated it in English.

----------

## tschenturs

Thanks for the script, capira.

I have found an issue with my make.conf. It still contains comments with the word PORT_LOGDIR in it. Hence the grep is not successful. I'd suggest the following change:

```

--- update-world.orig   2006-12-07 09:17:39.000000000 +0100

+++ update-world        2006-12-07 09:18:08.000000000 +0100

@@ -28,7 +28,7 @@

 emergelist=$homedir/emergelist

 emergetemp=$workdir/emergetemp

 failedlist=$homedir/failedlist

-portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`

+portlogdir=`cat /etc/make.conf | grep "^PORT_LOGDIR" | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`

 masked=$homedir/masked

 # parameter for '--empty' to emerge -e world

 if [[ $1 == '--empty' || $1 == '-e' ]]

```

HTH, Urs

----------

## capira

I think that the variables should be check before doing anything.

A good way is:

```

...

  source /etc/make.conf

...

   if [ ${PORT_LOGDIR}NORL = 'NORL' ]

   then

      echo "ERROR: PORT_LOGDIR should be set in your /etc/make.conf"

      exit 1

   fi

```

----------

## Phlogiston

 *count_zero wrote:*   

> I just updated the script to preserve colored output from the emerge command.  I also fixed the version numbering (sorry colourblindangus!) in the help output. 

 

Thanks thats great to hear!

----------

## drjimmy42

Fantastic script.  Truly very useful.  One more suggestion.  

To make this a nice complete package for keeping your system up to date and healthy it might be good to have a revdep-rebuild call at the end.  So that if everything works out well you have updated all your packages, with new use flags taken into account (very good addition btw) and all dynamic linking is happy.  

It almost takes all the fun out of running Gentoo;-)

----------

## tejing

this should definitely be put in gentoolkit once it's been tested and worked on for a while. great work.

Tejing

----------

## trupoet

 *tejing wrote:*   

> this should definitely be put in gentoolkit once it's been tested and worked on for a while. great work.
> 
> Tejing

 

I second that notion. Was just going to post that myself

----------

## ArNiS

Many thanks, count_zero! It's excellent and very usefull stuff.

----------

## mci_nano

hey, i'm trying to get this thing running

but failed on first try. cause sed seems not to work as supposed to. check that for you too...

```
[ebuild     U ] sys-libs/timezone-data-2006p [2006o] USE="nls" 336 kB 
```

sed'ed into emergelist gives 

```
=USE="nls"
```

this seems to happen because of my utf8 settings (i figured that out with a guy from #sed on freenode, thx to redduck676)...

so if we replace the regexp we could get it better also for utf8 people... see that diff... maybe you could think about it

```

83c83

<    cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' > $emergetemp

---

>    cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ [:upper:]]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' > $emergetemp

```

that gives the supposed

```
=sys-libs/timezone-data-2006p
```

finaly i'll go to update my system  :Wink: 

----------

## RCGodward

Thank you so much.  Lately I've found myself updating my systems once a week so that it doesn't take too much time and I can watch it the whole time.  Can't wait to try it out on a major update.

----------

## baldo

hi guys,

found another bug.

when emerge says it will update portage the following output will break emergelist

```
*** Portage will stop merging at this point and reload itself,

    then resume the merge.
```

it will result in

```
=***
```

i would consider to replace

```
cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' | > $emergetemp
```

(line 83) with

```
cat $emergelist | grep "^\[" | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' | > $emergetemp
```

works fine for me so far. nice script.

by the way: i also noticed the bug above. will try this fix

----------

## count_zero

 *Quote:*   

> found another bug. 
> 
> when emerge says it will update portage the following output will break emergelist

 

Thanks!

I've actually already fixed this with a much more elegant sed command than the one in the original version, which will be included in the next release (along with a pretty useful improvement, but you'll just have to wait and see  :Wink: )

----------

## drjimmy42

I found that if you have the line

```
portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
```

will catch a comment with PORT_LOGDIR in it which is what is in make.conf.example.  Since I used that as a template the variable portlogdir was getting the value of the line with the comment at the beginning.

To fix this I change the command above to specify the beginning of the line to be sure you are grabbing the variable name.

```
portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
```

Fantastic script.  Truly awesome.  Thanks.

----------

## count_zero

 *drjimmy42 wrote:*   

> I found that if you have the line
> 
> ```
> portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
> ```
> ...

 

Fixed in next release!

----------

## drjimmy42

Thanks.  Did you think any about integrating revdep-rebuild into the script?  I haven't really looked into how, it would just be cool to have only one script to run to keep things humming along.

----------

## ryker

 *drjimmy42 wrote:*   

> Thanks.  Did you think any about integrating revdep-rebuild into the script?  I haven't really looked into how, it would just be cool to have only one script to run to keep things humming along.

 

I don't know that integrating revdep-rebuild would be much more than tacking it on the end of this script and adding an option to invoke it.  Since that is the case, why not just create your own little script that first calls the update-world script and then revdep-rebuild afterwards?

What I would much rather see, is this update-world script integrated with the wonderful emwrap script.  That would be great.  So, not only would it be easier to update the world, when it was done, the tool chain would be properly built as well.  And, with the least amount of compiling necessary.  Obviously, this is a huge request and would take poor count_zero a sizable chunk of his free time.   :Wink: 

----------

## lngndvs

I think I fell into a pit: when a power outage sent my machine South, upon restarting (having already installed some 80% of the packages on the list), update-world --install started from the very beginning of the iist.  

I know, I know: I should invest in an UPS, but I've seldom come across any problems (that I knew about) restarting after a power outage.  We have alot of them in my location.

Alan

----------

## ryker

Just a guess, but I would think that another update-world --pretend followed by update-world --install should work fine.  It should ask you if you want to overwrite the existing emerge list, which you would say yes to.  If not, you can always just delete your .update-world folder and try again.

----------

## drjimmy42

 *ryker wrote:*   

>  *drjimmy42 wrote:*   Thanks.  Did you think any about integrating revdep-rebuild into the script?  I haven't really looked into how, it would just be cool to have only one script to run to keep things humming along. 
> 
> I don't know that integrating revdep-rebuild would be much more than tacking it on the end of this script and adding an option to invoke it.  Since that is the case, why not just create your own little script that first calls the update-world script and then revdep-rebuild afterwards?
> 
> 

 

I did.  And it works fine. But while we're all here fawning over a cool script that makes our lives easier, why not make everyone's life easier by actually having all your libraries consistent when you think you are done merging.  I personally think that revdep should be built into emerge as it seems silly to me to allow emerge to look as if it finished successfully while silently breaking lots of other things.  The next best thing might be to have it in a cool script like this that takes care of upgrading for you from end to end.

----------

## count_zero

Version 1.7 is released which features USE flag management.  When the emergelist is created in the first step, a list of USE flags will show up next to the package and can be turned on and off with by adding or removing '-'.  It doesn't work for slotted builds yet, but otherwise it works pretty well for me.  Test it and let me know any problems.

----------

## BigMichi1

i recently loaded the 1.7 version of the script but now i got this when running "update-world -p" followed by "update-world -i"

```
bigmichi1 tool # ./update-world -p

These are the packages that would be merged, in order:

Calculating world dependencies... done!

[ebuild     U ] sys-apps/portage-2.1.2_rc3 [2.1.2_rc2-r5] USE="doc epydoc -build (-selinux)" LINGUAS="-pl" 328 kB

*** Portage will stop merging at this point and reload itself,

    then resume the merge.

[ebuild     U ] app-arch/gzip-1.3.8 [1.3.7] USE="nls pic -static" 533 kB

[ebuild     U ] media-libs/libsamplerate-0.1.2-r1 [0.1.2] USE="fftw sndfile" 0 kB

[ebuild     U ] net-libs/gnutls-1.6.0 [1.4.4-r1] USE="doc nls zlib" 4,127 kB

[ebuild   R   ] kde-base/kopete-3.5.5-r2  USE="addbookmarks alias arts autoreplace connectionstatus contactnotes crypt gadu groupwise highlight history irc jingle kdeenablefinal* kdehiddenvisibility latex netmeeting nowlistening sametime* slp sms ssl statistics texteffect translator webpresence winpopup xinerama xscreensaver yahoo -debug" 0 kB

Total: 5 packages (4 upgrades, 1 reinstall), Size of downloads: 4,986 kB

These are the packages that will be installed.  If you want to alter this list,

just edit the file 'emergelist' in /root/.update-world. When finished, run

'update-world --install'

bigmichi1 tool # cat /root/.update-world/emergelist

=app-arch/gzip-1.3.8  USE="nls pic -static"

=kde-base/kopete-3.5.5-r2  USE="addbookmarks alias arts autoreplace connectionstatus contactnotes crypt gadu groupwise highlight history irc jingle kdeenablefinal* kdehiddenvisibility latex netmeeting nowlistening sametime* slp sms ssl statistics texteffect translator webpresence winpopup xinerama xscreensaver yahoo -debug"

=media-libs/libsamplerate-0.1.2-r1  USE="fftw sndfile"

=net-libs/gnutls-1.6.0  USE="doc nls zlib"

=sys-apps/portage-2.1.2_rc3  USE="doc epydoc -build"

bigmichi1 tool # ./update-world -i

Checking use flags.....done!

WARNING: no 'emergelist' exists.  Did you run 'update-world --prepare' first?

bigmichi1 tool #

```

some help would be nice, i like this sript

----------

## thomasvk

Hey I haven't tried the script yet (I'm not that kind of user that starts emerge and goes away, I just leave an ssh session open to watch.  :Razz: ) but I noticed something and I just wanted to give a suggestion. It's about:

 *count_zero wrote:*   

> The script version 1.5 (second one tonight ) properly handles "Fetch Restriction" now, prompting you to download the sources before continuing.

 

If the use of this script is to just run along at one go, wouldn't it be better to skip packages with fetch restriction if the files are absent (if they are present they can just be installed) and then install those at the end or just don't install them and in the logs make note that you need to download them first, or something so it won't hold up the script. Or is this already what's happening?  :Smile: 

Out of interest I will surely try this script next time I'm updating. Good work.

----------

## count_zero

 *BigMichi1 wrote:*   

> i recently loaded the 1.7 version of the script but now i got this when running "update-world -p" followed by "update-world -i"
> 
> ```
> bigmichi1 tool # ./update-world -p
> 
> ...

 

That's strange.  I just tried it with your packages on my system and it works without problem.  Try deleting the emergelist and workdirectory and trying again.

----------

## BigMichi1

ok there is something i found

the line in the install section

```
cat $emergelist | sed 's/\ .*//' > $emergelist
```

produces an empty list for me

----------

## count_zero

 *BigMichi1 wrote:*   

> ok there is something i found
> 
> the line in the install section
> 
> ```
> ...

 

You're right!  I'm not sure why that's even there...

Fixed the code and the download.

@t0maz

You might try version 1.7b to see if it fixes your issue.

----------

## slackline

Hi,

Thanks for the script, looks like a great idea, so frustrating setting things running before going to bed only to wake up and find that things fell over on package 2 out of 68   :Evil or Very Mad: 

Tried it out (v1.7b) and found a conflict with my default emerge options.  I have --ask and --verbose set in /etc/make.conf...

```

## Default options for emerge

EMERGE_DEFAULT_OPTS="--ask --verbose"

```

This appears to stop things running as after preparing the install went...

```

# update-world -i

Checking use flags...................done!

!!! "--ask" should only be used in a terminal. Exiting.

cat: /dead.letter: No such file or directory

*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

sed: -e expression #1, char 0: no previous regular expression

***  compile failed, skipping.

grep: invalid option -- ,

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unrecognized option `--all-packages'

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unknown directories method

grep: option `--direct' requires an argument

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

grep: unknown devices method

grep: unrecognized option `--indirect'

Usage: grep [OPTION]... PATTERN [FILE]...

Try `grep --help' for more information.

*** Continuing with emerge world

!!! "--ask" should only be used in a terminal. Exiting.

Congratulations!  'emerge world' complete.

All packages emerged successfully

```

in about 30 seconds for 27 packages (I wish I had a comp that was that quick!!!).

Is there anyway of checking the global options and removing this flag if its set?

The other options is simply to remove the --ask from my global options, but I'm lazy and can't be bothered using it (or -p) when I want to look at what emerging a package will pull in.

Thanks again for a useful tool,

slack

----------

## count_zero

 *slack---line wrote:*   

> Hi,
> 
> Thanks for the script, looks like a great idea, so frustrating setting things running before going to bed only to wake up and find that things fell over on package 2 out of 68  
> 
> Tried it out (v1.7b) and found a conflict with my default emerge options.  I have --ask and --verbose set in /etc/make.conf...
> ...

 

Hmm, this is a portage feature that I didn't even know existed...I'll have to look into it, but I'm sure that if it is possible to disable the default flags from the command line, it's a pretty trivial addition.  Maybe something like 

```
EMERGE_DEFAULT_OPTS="" emerge -uD world
```

or something similar.

----------

## bunkacid

@count_zero

Hey, I dont think you should be playing with the USE flags.  I felt that the previous version I was using was pretty damn stable.

The latest, 1.7b just hosed the very complex USE flags from my /etc/portage/package.use.

(It would have been nice of you to make a backup file first.)

@users, Lesson for the day, ALWAYS remember to keep a nice pretty backup of your files and configuration settings before making changes and or playing with developing scripts.

Now it's time to restore from a rather old but more complete version of my package.use. Hahaha, I said rather old, but looking at what I have it's only 44 days, could have been much worse.

OI

----------

## count_zero

Ouch!  Sorry for that...I'll take 1.7b down until I can figure what's wrong...  :Sad: 

(you can still download it on http://countzero.amidal.com/files/update-world-1.7b)

----------

## mci_nano

Hi...

It seems not working for packages without USE Flags... they are not in emergelist because of 

```
sed -n 's/.*\(^.*USE=\"[a-zA-Z0-9_\ *%()-]*\"\).*/\1/p'
```

I actualy dont have time to fix that but wanted to point you to it... my examples are 

```
[ebuild     U ] mail-client/mozilla-thunderbird-bin-1.5.0.8 [1.0.7] 10,368 kB 

[ebuild     U ] www-client/mozilla-firefox-bin-1.5.0.8 [1.5.0.3] LINGUAS="de%* -ar% -ca% -cs% -da% -el% -en_GB% -es% -es_AR% -es_ES% -fi% -fr% -ga% -ga_IE% -he% -hu% -it% -ja% -ko% -mk% -nb% -nb_NO% -nl% -pl% -pt_BR% -ro% -ru% -sk% -sl% -sv% -sv_SE% -tr% -zh_CN% -zh_TW%" 8,419 kB 

```

And also... maybe you will add utf8 support? as i mentioned in my last post otherwise it wount work for some packages ending with a letter in the version brackets... example [2006o]

ahh, now i see v1.7 is reseted... ok then

----------

## baldo

perhaps it would be nice to have an comandline-argument to enable/disable use-flag support...

----------

## count_zero

I fixed a few bugs for a minor 1.6.1 release.

EMERGE_DEFAULT_OPTS set in make.conf shouldn't cause any more options.

I wrote a new way for getting packages out of the raw emerge output, so there shouldn't be any more gibberish like =*** ending up in the emergelist.

There's no USE flag support in this version, hopefully I'll fix 1.7 in the next few days.

Happy testing!  (and remember to make backups! works for me, but that doesn't mean it works for you!)

 *mci_nano wrote:*   

> 
> 
> And also... maybe you will add utf8 support? as i mentioned in my last post otherwise it wount work for some packages ending with a letter in the version brackets... example [2006o]
> 
> 

 

Try this version out, I made some changes which should help utf-8 problems.  I can't test utf-8 problems myself, so you'll have to help.

----------

## roseZ

If you want to do things cleanly, don't try to parse make.conf variables with sed like this:

```
portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
```

Just let bash parse it for you by adding as first line

```
source /etc/make.conf
```

and use PORT_LOGDIR casually after that. Since make.conf should only be used to declare variables, sourcing it ought to be safe.

Compared to using sed, this could save you a lot of hassle, e.g. make.conf might contain

```
PORT_LOGDIR="${SOMEDIR}/SUBDIR"

PORT_LOGDIR="/hmm/i/changed/my/mind/and/will/instead/use/this/\

very/long/path/with/line/breaks/in/it"

```

As to whether the variable should be checked like capira suggests, let me just refer to make.conf's man page for portage behavior  :Wink: 

Cheers

----------

## count_zero

 *roseZ wrote:*   

> If you want to do things cleanly, don't try to parse make.conf variables with sed like this:
> 
> ```
> portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
> ```
> ...

 

True, this is a much easier way to do it.  I'll include it in the next release.

----------

## bunkacid

 *roseZ wrote:*   

> If you want to do things cleanly, don't try to parse make.conf variables with sed like this:
> 
> ```
> portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
> ```
> ...

 

Also by sourcing the make.conf file, users who have their make.conf source other files they will be sourced accordingly.

I myself broke up the portions of my make.conf into separate easier to manage files, which live in /etc/portage/make.conf.d/

----------

## bunkacid

just had another thought.

```
update-world -p

The file 'emergelist' already exists and will be overwritten.

Continue anyway? (y/n) 

```

since by default just hitting enter here, perhaps, capitalization of Y to signify the default option.

----------

## float-

a nice addon would be to check if genlop is installed, and if it is, print the estimated compile time.

maybe this fits best when you issue --prepare

btw, tried to download your script from the instructions in the GWN, and got a 404 error, my guess is that you renamed your script,

perhaps you should make a symlink from the last stable version to ./update-world

----------

## count_zero

 *float- wrote:*   

> btw, tried to download your script from the instructions in the GWN, and got a 404 error, my guess is that you renamed your script,
> 
> perhaps you should make a symlink from the last stable version to ./update-world

 

Link fixed, thanks!

By the way, genlop has never been very accurate at predicting compile times for me, but I'll see how it works...

----------

## roseZ

Once more about reading portage variables: I just noticed there's a tool that can do it (and more). So instead of sourcing make.conf to get PORT_LOGDIR (along with everything else), you could do

```
portlogdir=`portageq envvar PORT_LOGDIR`
```

which feels a tad better to me. Append 2>/dev/null within backquotes if you don't like the warning message for users not in portage group.

----------

## yamamushi

Thank you Thank you THANK YOU!!!

This script has made my life 1000x easier, I was just thinking a few weeks back "man, portage would be cooler if it set aside packages that wont compile and moved onto the next ones". 

 :Laughing:   :Laughing:   :Laughing: 

----------

## mci_nano

 *count_zero wrote:*   

> 
> 
> Try this version out, I made some changes which should help utf-8 problems.  I can't test utf-8 problems myself, so you'll have to help.

 

It works  :Very Happy: 

----------

## iBormuth

This is a nice one which I happen to use frequently. Thanks a lot.

Anyway, why do you sort the list before you write to emergelist? I always thought there was a logic behind the order portage handles packages.

Think you have an 'emerge -e world' that died on its way. If your script didn't sort, you could easily run 'update-world -p' and manually remove the first whatever lines from emergelist.

I'd remove the sort command or at least make it optional.

----------

## count_zero

 *iBormuth wrote:*   

> This is a nice one which I happen to use frequently. Thanks a lot.
> 
> Anyway, why do you sort the list before you write to emergelist? I always thought there was a logic behind the order portage handles packages.
> 
> Think you have an 'emerge -e world' that died on its way. If your script didn't sort, you could easily run 'update-world -p' and manually remove the first whatever lines from emergelist.
> ...

 

Nah.  The sort command is to make it easier to find packages that you want to edit out.  When you run update-world --install, the entire list gets sent back to portage, which then reorders it again anyway.  Check the sorted emergelist, and then check it again once the world starts compiling--you'll find that it's back in the order that portage wants it in.  And you can still remove/change packages if the process dies for some reason without running update-world --prepare again.  Just edit the emergelist how you like, and restart the update-world --install.  

If you REALLY want things compiled in the "right" order, check out how to use Guenther's script to make your emerglist here.  

I don't think that there should be any problem with the way things are now.  If you can find a circumstance in which I'm wrong, let me know!   :Cool: 

----------

## ryker

@count_zero, I notice your website with the update-world file has been down for a while.  Did your server get hammered because of this script?  Will it be back up soon?

----------

## count_zero

 *ryker wrote:*   

> @count_zero, I notice your website with the update-world file has been down for a while.  Did your server get hammered because of this script?  Will it be back up soon?

 

Yeah, looks like my webhost is flaking out again.

I've put up a mirror on the front page in case the main website is down.

You can access it here: http://dixieflatline.homelinux.org/files/gentoo

----------

## massysett

Countzero: thanks. I saw your script in the GWN. This script is a great idea. I will try it next time I update my system (which I put off as long as possible.)

I was just emerging the latest GNOME, which is a ton of packages. One of them failed because a package it depended on needed to be emerged with a different USE flag. That got me thinking that it would have been neat if I could use your script to do any big emerge, not just world updates.

Maybe in the future it would be possible to use piped in output from emerge -p? Then any sort of emerge--just a single package with tons of dependencies, or a world update. For instance:

```
# emerge -p gnome | update-world
```

Or

```
# emerge -puDN world | update-world
```

Of course then you might not call the script update-world anymore  :Smile:  This feature should be a part of emerge, or gentoolkit, or something, because it's very useful. Thanks for the script.

----------

## count_zero

 *massysett wrote:*   

> Countzero: thanks. I saw your script in the GWN. This script is a great idea. I will try it next time I update my system (which I put off as long as possible.)
> 
> I was just emerging the latest GNOME, which is a ton of packages. One of them failed because a package it depended on needed to be emerged with a different USE flag. That got me thinking that it would have been neat if I could use your script to do any big emerge, not just world updates.
> 
> Maybe in the future it would be possible to use piped in output from emerge -p? Then any sort of emerge--just a single package with tons of dependencies, or a world update. For instance:
> ...

 

Good idea!

This is something that can already be done, with some sed filtering:

```
emerge -p gnome | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/=\1/p' > ~/.update-world/emergelist

update-world --install

```

Not as easy as

```
emerge -p gnome | update-world
```

but it works.  

I'll try to make it easier to do this in the future.

Happy updating!   :Very Happy: 

----------

## 12345moon12345

Love this script, thanks Countzero  :Smile: 

I changed it a little bit so it doesn't use emerge on the final install but uses temerge instead.

Temerge is a script that mounts /var/tmp/portage as tmpfs which:

 - greatly improves speed 

-  reduces noice of harddisk 

-  keeps my harddisk good for more years of reliable duty

it's a very simple change to update-world script:

cat $emergelist | xargs emerge -1   

becomes: cat $emergelist | xargs temerge -1

off course the temerge script needs to be on your pc, 

download or look for more info on temerge here

maybe more people would like my idea or the two scripts could also be combined (with a commandline option or variable in the script)

another idea: after everything has compiled, run prelink -a ??

another suggestion: at the beginning of the script: emerge --sync ??

just trying to think with you, do your own thing, I like it.

----------

## STEDevil

 *drjimmy42 wrote:*   

> I personally think that revdep should be built into emerge as it seems silly to me to allow emerge to look as if it finished successfully while silently breaking lots of other things.

 

Amen to that. For years I have been amazed at the intuitiv stupidity in not automatically have emerge run a revdep-rebuild after finishing. I would think it goes without saying that 99,9% of users would like an updated WORKING system instead of an updated half BROKEN one. 

So please, here is another plea for revdep-rebuild being auto-integrated into your excellent script. I just simply cant think of a reason why a normal user would like to stop with a halfbroken system when updating if the update script could just as well finish all the way to the end.

[rant]

I must say that the last 6 months have brought me several greate tools that for me has been missing badly in Gentoo since the very start. eix, cfg-update and now update-world is finally adding to emerge some of the huge pieces its missing to qualify as a modern useroriented packagemanager. I really like Gentoo in general, but sometimes the last years I have just wanted to bang my head against the desk in frustration of how aqward and userunfriendly some things are handled. These 3 new tools fixes a lot of those constantly reoccuring annoyances and enable me to use more of my computertime for work and entertainment instead of maintainace.

Hurray for a brighter, more userfriendly Gentoo future!  :Smile: 

[/rant]

----------

## count_zero

@12345moon12345:

A variable is easy to set, I can include it with the next release so you can more easily choose which emerge-wrapper to use in this script.  I've never tried (or heard of) temerge, but I'll have to check it out!

@STEDevil:

You're right, revdep-rebuild is something that should be run after updating a system.  I'll have to see how I can make it work with update-world, it's probably not going to be a trivial thing.

Merry Christmas, all!

count_zero

----------

## riaanho

Hi count_zero

I used your script for the 1st time and ran into a problem where a KDE application KDAR was rebuild before KDELIBS.

I then used the script provided by Guenther Brunthaler and recompiled my entire system after upgrading to GCC 4.1.1

I also think that the generated file should be in the correct emerge sequence or did I do something wrong.

I think your script has great potential to be used whenever one wants to stay current with World.

Regards

Adriaan

----------

## ryker

@12345moon12345

Thanks for the temerge tip.  It works nicely on my machine.  Although, it's probably not very useful if your machine has <1G RAM.

@count_zero

I notice that the server and the mirror are both down.  I have webspace for a mirror and I'd be happy to donate some of it for this script.  Just pm or email me if you would like me to mirror the files.

----------

## vinboy

hi

sorry for being a noob.

so this script is used for normal updating? like the one we do every 2 weeks.

I assume this script is not used for upgrading GCC (having to compile everything).

----------

## count_zero

 *vinboy wrote:*   

> hi
> 
> sorry for being a noob.
> 
> so this script is used for normal updating? like the one we do every 2 weeks.
> ...

 

This script can be used for compiling any number of packages, but is most useful when you're updating a large number of packages that you don't want to supervise.  So yes, you can use it for both normal updates (emerge -uD world) and complete system updates (emerge -e world).  If you're updating GCC, you should probably update that first and switch to the new profile (gcc-config) before using this script, or you might just be recompiling your world with your old GCC.

----------

## vinboy

why not include this in portage or in the portage repository with an ebuild?

this is something useful for many of us.

great job!   :Razz: 

----------

## KevinLarson

I realized my problem was related to emerge, not this script.

----------

## ryker

 *vinboy wrote:*   

> why not include this in portage or in the portage repository with an ebuild?
> 
> this is something useful for many of us.
> 
> great job!  

 

It would be nice to see this as part of the gentoolkit package.  Having a seperate ebuild for it seems kind of silly since it's just a small script.

----------

## ASID

If it's possible, could you please add something like 

```
update-world --resume
```

 to use in case of an unexpected shutdown?

Keep up the great job!

 :Wink: 

----------

## count_zero

 *ASID wrote:*   

> If it's possible, could you please add something like 
> 
> ```
> update-world --resume
> ```
> ...

 

This script has --resume built in.  If for some reason the emerge gets halted (power failure, control-c, etc.), the 'emergelist' and 'failed list' are preserved.  All you have to do to continue on is to run update-world --install, and the process will pick up right back where it left off.

----------

## ASID

 *Quote:*   

> This script has --resume built in. If for some reason the emerge gets halted (power failure, control-c, etc.), the 'emergelist' and 'failed list' are preserved. All you have to do to continue on is to run update-world --install, and the process will pick up right back where it left off.

 

Great! Thanx for the tip...   :Very Happy: 

----------

## drjimmy42

If one of that packages that needs updating has an unsatisfied patch restriction, I get the message

```

WARNING: The following packages have Fetch Restriction turned on:

app-emulation/crossover-office-bin-6.0.0

Please download the sources to /usr/portage/distfiles/ and rerun this script.

```

From the changelog at the top of the script it says that fetch restriction is handled properly in 1.5.  I was wondering why this behavior is like this.  IMHO it would be better for the script to go over unsatisfied fetch restrictions as any other failure and report it at the end.  Is there a reason this was changed?

-------------------------------------------

Also, this brings up another point.  I have noticed that if the last package in emergelist is the one to fail, update-world attempts to start up again and gets errors from emerge because it didn't pass it a package name.  No harm done since its all done anyway, but a check here would make the output a lot prettier and easier to understand.

Thanks again for the fabulous script

----------

## count_zero

 *Quote:*   

> If one of that packages that needs updating has an unsatisfied patch restriction, I get the message 
> 
> Code: 
> 
> WARNING: The following packages have Fetch Restriction turned on: 
> ...

 

That's how it's supposed to work--it lets you know there is a fetch restriction so you can download the file before proceeding.  Did you download the file and put it in your disfiles directory? If you did and it still gives the warning, then there's a problem.

----------

## drjimmy42

 *count_zero wrote:*   

> 
> 
> That's how it's supposed to work--it lets you know there is a fetch restriction so you can download the file before proceeding.  Did you download the file and put it in your disfiles directory? If you did and it still gives the warning, then there's a problem.

 

Yeah, I saw the code where you check for it.  It works as designed and if the file is there it works, its just that I use this script so that I can update unattended and deal with issues like breakages later.  To me, a fetch restriction is as good as a break and I don't want to hold up the rest of the update for either one.  I haven't gotten around to buying crossover-office yet and it just sits there glaring at me.  

Its no big deal, I just commented the check out of the copy of the script I had, I was just wondering why this block to updating is different than others.  Thanks again.

----------

## count_zero

 *drjimmy42 wrote:*   

>  *count_zero wrote:*   
> 
> That's how it's supposed to work--it lets you know there is a fetch restriction so you can download the file before proceeding.  Did you download the file and put it in your disfiles directory? If you did and it still gives the warning, then there's a problem. 
> 
> Yeah, I saw the code where you check for it.  It works as designed and if the file is there it works, its just that I use this script so that I can update unattended and deal with issues like breakages later.  To me, a fetch restriction is as good as a break and I don't want to hold up the rest of the update for either one.  I haven't gotten around to buying crossover-office yet and it just sits there glaring at me.  
> ...

 

You can always add '>=app-emulation/crossover-office-bin-6.0.0' (or greater than your installed version) to package.mask if you don't want to upgrade it.  I saw this as a better solution than not reporting a fetch restriction, which can often be resolved using wget or downloading it from the website.

----------

## TehZeppelin

 *count_zero wrote:*   

> 
> 
>  *Quote:*   
> 
> [ebuild FU ] dev-java/sun-jdk-1.4.2.13 [1.4.2.12-r2] USE="X alsa -doc -examples -jce -nsplugin" 35,509 kB
> ...

 

Where can you get those sources?  :Sad: 

----------

## count_zero

 *Quote:*   

> Where can you get those sources? 

 

Just try to emerge the package, and it gives instructions:

```
emerge  =dev-java/sun-jdk-1.4.2.13

>>> cfg-update-1.8.0-r5: Building checksum index... (takes a few seconds) done!

Calculating dependencies... done!

>>> Emerging (1 of 1) dev-java/sun-jdk-1.4.2.13 to /

!!! dev-java/sun-jdk-1.4.2.13 has fetch restriction turned on.

!!! This probably means that this ebuild's files must be downloaded

!!! manually.  See the comments in the ebuild for more information.

 * Please download j2sdk-1_4_2_13-linux-i586.bin from:

 * http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=j2sdk-1.4.2_13-oth-JPR&SiteId=JSC&TransactionId=noreg

 * (first select 'Accept License', then click on 'self-extracting file'

 * under 'Linux Platform - Java(TM) 2 SDK, Standard Edition')

 * and move it to /usr/portage/distfiles

```

----------

## count_zero

Just updated the script to version 1.8, implementing a bunch of new features.  I tried to get in most requests, but forgive me if I missed yours.  Remind me and I'll try to get it into the next version.

Happy updating!   :Cool: 

----------

## d2_racing

Pretty good script  :Smile: 

----------

## drjimmy42

I think the addition of revdep-rebuild now makes this the single best gentoo script ever.  This script alone increases stability and ease of frequent or infrequent updates enormously.  Thanks a lot.

Feature request: Can you add a "-a" like flag that does what emerge -a does, where it shows you what its about to do and then you hit enter to do it. Holy crap am I lazy, but running the prepare and install in a single step makes it easier to script too.  Instead of two whole lines, I can write only one:-) Thanks again.

----------

## count_zero

 *drjimmy42 wrote:*   

> I think the addition of revdep-rebuild now makes this the single best gentoo script ever.  This script alone increases stability and ease of frequent or infrequent updates enormously.  Thanks a lot.
> 
> Feature request: Can you add a "-a" like flag that does what emerge -a does, where it shows you what its about to do and then you hit enter to do it. Holy crap am I lazy, but running the prepare and install in a single step makes it easier to script too.  Instead of two whole lines, I can write only one:-) Thanks again.

 

Easily done.  I'll include it in the next release (hopefully sometime next week).   :Very Happy: 

----------

## jeremykoppel

I definitely want to try this out.  When I do an 'update-world --prepare' however, I get 'WARNING: One of the specified packages doesn't exist'.  How can I tell which package is causing the problem?

--Jeremy

'

----------

## vinboy

hi

can I do a 

```
emerge -uDNav world
```

 using this script?

btw, very nice work.

----------

## drjimmy42

 *vinboy wrote:*   

> hi
> 
> can I do a 
> 
> ```
> ...

 

It already does.  It was added in version 1.4

----------

## vinboy

 *drjimmy42 wrote:*   

>  *vinboy wrote:*   hi
> 
> can I do a 
> 
> ```
> ...

 

thx for reply.

are those parameters implicit when I run update-world ?

or I have to specify it explicitly?

such as 

```
update-world -uDNav
```

----------

## count_zero

 *vinboy wrote:*   

>  *drjimmy42 wrote:*    *vinboy wrote:*   hi
> 
> can I do a 
> 
> ```
> ...

 

They're assumed:

--prepare == -uDNpv

or

--empty == -evp

The next release is almost ready!  It's got some great new features, including the return of USE flag management.

Just a little more testing to go...

----------

## jerann

I've used this script quite a bit - it is extremely helpful   :Very Happy:  . One thing I noticed, though, is that if I try to install a large package (in this case, Gnome) by going emerge -p gnome | update-world, it gives me an error (Error: Invalid Command). I figured out that I had to do emerge -p gnome > temp, then nano temp and remove the first blank line. Then, I could cat temp | update-world, and it worked just fine. I can't imagine that using update-world to install large packages is done much, but it is handy in cases like this. I think it's a bug in the script here, so you might want to look into that. Just a thought - thanks!

----------

## Borgond

Hi there,

After running --prepare and trying to --install (after modifying the emerglist) the script is telling me that I have to "unmask" some packages. In a previous try it told me that I need to resolve issues with blocking packages. 

What it doesn't tell are the packages (in both cases) in question. Am I the only one who would find that information useful? 

What would be the easiest way to determine blockers and resolve them?

e.g. calling 

```
emerge -uvp world
```

 and see what's blocking - unmerging those packages?

Any help is welcome!

Thanks in advance!

----------

## baldo

hi,

1.8 looks nice.

but doing an emerge -p xfce4 | update-world will result in: 

```
$ emerge -p xfce4 | update-world 

No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information.

Error: Invalid Command.

Run 'update-world --help' for usage.
```

----------

## count_zero

@Borgond:

I'm working on a better handling of blocked packages, it'll be in the next release.

@jerann & baldo:

I've improved the code for piped emerges, hopefully it will produce fewer errors now.

----------

## steveL

 *count_zero wrote:*   

> I'm working on a better handling of blocked packages, it'll be in the next release.

 Perhaps we could collaborate?

----------

## mrscratch

I try to use the script, but on package 13 of 996 it gets stuck on compiling sys-apps/hal-0.5.7.1-r5 with the following message:

```

checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool

!!! Please attach the following file when filing a report to bugs.gentoo.org:

!!! /var/tmp/portage/sys-apps/hal-0.5.7.1-r5/work/hal-0.5.7.1/config.log

!!! ERROR: sys-apps/hal-0.5.7.1-r5 failed.

Call stack:

  ebuild.sh, line 1614:   Called dyn_compile

  ebuild.sh, line 971:   Called qa_call 'src_compile'

  environment, line 3747:   Called src_compile

  hal-0.5.7.1-r5.ebuild, line 151:   Called econf '--with-doc-dir=/usr/share/doc/hal-0.5.7.1-r5' '--with-os-type=gentoo' '--with-pid-file=/var/run/hald.pid' '--with-hwdata=/usr/share/misc' '--enable-hotplug-map' '--disable-verbose-mode' '--disable-pcmcia-support' '--disable-acpi-proc' '--enable-docbook-docs' '--enable-doxygen-docs' '--disable-selinux'

  ebuild.sh, line 577:   Called die

!!! econf failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! A complete build log is located at '/var/tmp/portage/sys-apps/hal-0.5.7.1-r5/temp/build.log'.

cat: /tmp: Is a directory

*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

The failed package sys-apps/hal-0.5.7.1-r5 could not be merged and must be successfully installed before continuing.

```

It tells me I first must build hal before it can continue, but wasn't the whole purpose of the script that it would continue even when some packages fail? Did I do something wrong?

Well it seems it dies with every package that goes wrong. Some package fails, then it says it will continue with the emerge. After that it calculates dependencies again and will try the same package again. This fails again obviously for the same reason as before. Then it will stop for good.

----------

## baldo

hi,

thx for fixing, but did you upload the changes? i don't find a changed version...

cheers

baldo

----------

## count_zero

@mrscratch:

The script has a *limited* ability to deal with failed packages--in other words, if a package fails, it will remove it from the list, and try to catch any packages that depend on it.  However, if a large number of packages depend on the package that failed (like hal), the script will stop.  This is to prevent another package from trying to pull in the failed package, causing an infinite loop of emerging the failed package.

To get past this, you need to fix your specific problem.  

```
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
```

It looks like you have an XML-Parser problem.  Try reinstalling XML-Parser and then emerge hal.  Then you should be able to continue with the script.

@baldo:

Sorry about that, I'm currently working a string of nights and haven't been able to finish the release.  I should be back on days this weekend, maybe I can do it then.

----------

## 12345moon12345

Hi I'd like to be able to use update-world with some different LDFLAGS for some specific packages.

For instance openoffice fails wilt my standard LDFLAGS="-Wl,-O1 -Wl,--as-needed" (from /etc/make.conf) but succeeds with LDLFAGS=""

Then i found an interesting post ( https://forums.gentoo.org/viewtopic-t-67777-postdays-0-postorder-asc-start-25.html ):

 *Quote:*   

> 
> 
> Mine are currently
> 
> Code:
> ...

 

I'm not a script-expert but it some logic from this could be translated to be of use in the update-script.

Would you be willing to include this feature ( per-package-LDFLAGS ) ?

In theory it would even be possible for update-world to first try the standard LDLAGS for each package and if package fails try again with a simpeler LDFLAGS.... this seems much more complex though. Maybe in some far future version?

keep up the good work, love your script !

----------

## steveL

 *12345moon12345 wrote:*   

> For instance openoffice fails wilt my standard LDFLAGS="-Wl,-O1 -Wl,--as-needed" (from /etc/make.conf) but succeeds with LDLFAGS=""

 

Um, just wanted to ask, when OO.o fails with -as-needed, is that during the emerge itself, or does it just crash afterwards?

BTW the easy way to do this is outlined here.

----------

## 12345moon12345

 *Quote:*   

> 12345moon12345 schreef:
> 
> For instance openoffice fails wilt my standard LDFLAGS="-Wl,-O1 -Wl,--as-needed" (from /etc/make.conf) but succeeds with LDLFAGS=""
> 
> Um, just wanted to ask, when OO.o fails with -as-needed, is that during the emerge itself, or does it just crash afterwards?
> ...

 

during the emerge off-course, otherwise I wouldn't have posted in this thread...

----------

## heilong

Howdy.

I'd like to note that the elog view support doesn't work if PORT_LOGDIR variable is unset. It's not necessary to have this variable to use elog, the default elog path is /var/log/portage/elog.

I guess this is an update-world bug.

Thanks for this useful script.

--Gene

----------

## haubi

why not have an ebuild for update-world ?

So one can say:

$ emerge update-world

$ update-world ...

/haubi/

----------

## drjimmy42

Has anyone gotten the piped output to update-world to work?  Ever time I try I get this

```

# emerge -puD | update-world 

No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information.

Error: Invalid Command.

Run 'update-world --help' for usage.

```

I'm pretty sure the problem is that the until line below.  I can't figure out what its trying to do with all that but it doesn't seem to be working.  

```
# piped command MUST include --pretend !!!

if [[ "$arguments" = "" ]]

then echo "No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information."

    until [[ `echo "$piped" | wc -l` -eq 10 ]] && [[ -z `echo "$piped" | grep 'Calculating dependencies'` ]] || [[ -z `echo "${piped:-1}" | tail -n 4` ]]

    do read line

   piped="${piped}

$line"

    done

else :

fi
```

Any ideas?

----------

## ryker

 *haubi wrote:*   

> why not have an ebuild for update-world ?
> 
> So one can say:
> 
> $ emerge update-world
> ...

 

I don't see the point of an ebuild.  I see what you are saying, but you have to remember, update-world is just a simple script.  There's not much point in maintaining an ebuild for installing 1 file.

----------

## mahler

 *ryker wrote:*   

> 
> 
> I don't see the point of an ebuild.  I see what you are saying, but you have to remember, update-world is just a simple script.  There's not much point in maintaining an ebuild for installing 1 file.

 

Ebuilds have one major advantage, for even the smallest scripts: automatic updates.

Without an ebuild people keep having to remember to check for updates,

and keep track of which version they have actually got.

----------

## haubi

 *ryker wrote:*   

> I don't see the point of an ebuild.  I see what you are saying, but you have to remember, update-world is just a simple script.  There's not much point in maintaining an ebuild for installing 1 file.

 

That's true from ebuild-maintainer's POV.

Thing is is that this file has versions, and sometimes receives upgrades which I don't want to miss.

Currently, I manually have to find the link and see if there is a new version. This is what the portage-tree is for IMO...

----------

## MrVahn

I agree. This is such a great script that it could even be included in portage someday. Having to check back the forums for updates of a script you use quite so often is a hassle. A portage ebuild will be fine for us.

----------

## mgorny

I modified the script a little, adding support for 'genlop -p'. That is, if genlop is available on the system (checked with 'which'), then 'update-world -p' passes ebuild list to it, and outputs estimated build time.

http://mgorny.pastebin.ca/460914

----------

## vithar

 *count_zero wrote:*   

> This command creates a list called 'emergelist' in ~/.update-world/.

 

I suggest to replace ~/.update-world with $XDG_CONFIG_HOME/update-world according to XDG Base Directory Specification.

----------

## DancesWithWords

 *count_zero wrote:*   

> New Version 1.8 (2/16/07)
> 
> I've added a lot of new features to the newest version of update-world.  It seems pretty stable (to me).  Let me know if there are any problems.
> 
> Changelog v1.8:
> ...

 

snip...

Started using this a week ago and boy am I happy to have found this script.  It will make looking after my Gentoo boxes easier.  I've three here at home and 2 at work.  Thanks for this it is appreciated.

--

bruce

----------

## merlijn

VERY nice script indeed, just a small suggestion:

```

prepare ()

{

if [[ -e "$emergelist" ]]

   then echo -en "The file 'emergelist' already exists and will be overwritten.\nContinue anyway? (Y/n) "

   read continue

   if [[ "$continue" = 'y' || "$continue" = 'yes' || "$continue" = 'Y' || "$continue" = 'Yes' || "$continue" = 'YES' || "$continue" = '' ]]

      then :

      else echo exiting.

      exit 0

   fi

   else :

fi

```

can this condition be changed to "if !(emergelist doesnt exist || emergelist file is empty)" ?

In most cases a world update works hassle free for me, but if there are no packages to be fixed the emergefile is still there with nothing in it, thus giving this error on a new `update-world -p`.

Thank you for your time and effort on this!

----------

## Gerben

In version 1.8 of the script update-world --log only works after a cd into $homedir (~/.update-world)

If the command is issued in another directory it will present the directories in your current directories as options instead of the date directories in $homedir

 current code is

...

# update-world --log

if [[ -n `echo "$arguments" | sed -n 's/-l/&/p'` || -n `echo "$arguments" | sed -n 's/--log/&/p'` ]]

then echo "Choose a date: "

select directory in `ls -Al | grep ^d | sed 's/.*\ //'`

do

...

The reason is the absence of $homedir in the ls command of:

select directory in `ls -Al | grep ^d | sed 's/.*\//'`

Changing this into:

select directory in `ls -Al $homedir| grep ^d | sed 's/.*\//'`

will make update-world --log work from any directory

----------

## wrc1944

Tried this script, and got this- it bails out. The new one in GWN bails out too, and doesn't work, at least on my system.

```
gentoo wrc # update-world --prepare

Preparing list of packages...

These are the packages that would be merged, in order:

Calculating world dependencies... done!

[ebuild   R   ] x11-proto/evieext-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/trapproto-3.4.3  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xf86dgaproto-2.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] sys-apps/sed-4.1.5  USE="nls -static" USERLAND="(GNU%*)" 0 kB [?=>0]

[ebuild   R   ] sys-apps/pciutils-2.2.6-r1  USE="zlib* -network-cron" 0 kB [0]

[ebuild  N    ] dev-util/boost-build-1.34.1  0 kB [0]

[ebuild   R   ] x11-misc/xorg-cf-files-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXprintUtil-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xcursorgen-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/bigreqsproto-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/resourceproto-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xf86rushproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xcmiscproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xf86bigfontproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/scrnsaverproto-1.1.0  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] app-text/ghostscript-gpl-8.57  USE="X cups gtk -bindist -cjk -djvu -jpeg2k (-emacs%)" 0 kB [?=>0]

[ebuild   R   ] sys-apps/dbus-1.0.2-r2  USE="X -debug -doc (-selinux)" KERNEL="(linux%*) (-FreeBSD)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xdriinfo-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libFS-1.0.0  USE="ipv6 -debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xmodmap-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/setxkbmap-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/liboldX-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-misc/gccmakedep-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] dev-python/qscintilla-1.7.1  USE="-debug% -doc" 0 kB [?=>0]

[ebuild   R   ] media-libs/libdvdread-0.9.7  USE="(-static%)" 0 kB [?=>0]

[ebuild  N    ] dev-libs/boost-1.34.1  USE="-debug -doc -icu -pyste -tools" 0 kB [0]

[ebuild     U ] sys-apps/hal-0.5.9.1-r1 [0.5.9-r1] USE="crypt -acpi -debug -dell -disk-partition -doc -pcmcia (-selinux)" 0 kB [?=>0]

[ebuild   R   ] x11-misc/imake-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXprintAppUtil-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-themes/xcursor-themes-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXevie-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXTrap-1.0.0  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-base/xorg-server-1.3.0.0  USE="dri ipv6 nptl sdl xorg -3dfx -debug -dmx -kdrive -minimal -xprint" INPUT_DEVICES="evdev keyboard mouse -acecad -aiptek -calcomp -citron -digitaledge -dmc -dynapro -elo2300 -elographics -fpit -hyperpen -jamstudio -joystick -magellan -microtouch -mutouch -palmax -penmount -spaceorb -summa -synaptics -tek4957 -ur98 -vmmouse -void -wacom" VIDEO_CARDS="fbdev radeon vesa vga -apm -ark -chips -cirrus -cyrix -dummy -epson -fglrx% -glint -i128 -i740 -i810 (-impact) -imstt -mach64 -mga -neomagic (-newport) -nsc -nv -nvidia -r128 -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -v4l -via -vmware -voodoo" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXxf86dga-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] gnome-base/gnome-menus-2.18.2  USE="python -debug" KERNEL="(linux%*)" 0 kB [?=>0]

[ebuild     U ] media-sound/ardour-2.0.3 [0.99.3] USE="nls sse (-altivec) -debug -fftw%" 0 kB [?=>0]

Total: 36 packages (2 upgrades, 2 new, 32 reinstalls), Size of downloads: 0 kB

Portage tree and overlays:

 [0] /usr/portage

 [?] indicates that the source repository could not be determined

These are the packages that will be installed.  If you want to alter this list,

just edit the file 'emergelist' in /root/.update-world. When finished,

run 'update-world --install'

gentoo wrc #

gentoo wrc # update-world --install

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> starting parallel fetching

>>> Emerging (1 of 36) dev-util/boost-build-1.34.1 to /

 * boost_1_34_1.tar.bz2 RMD160 ;-) ...                                                                              [ ok ]

 * boost_1_34_1.tar.bz2 SHA1 ;-) ...                                                                                [ ok ]

 * boost_1_34_1.tar.bz2 SHA256 ;-) ...                                                                              [ ok ]

 * boost_1_34_1.tar.bz2 size ;-) ...                                                                                [ ok ]

 * checking ebuild checksums ;-) ...                                                                                [ ok ]

 * checking auxfile checksums ;-) ...                                                                               [ ok ]

 * checking miscfile checksums ;-) ...                                                                              [ ok ]

 * checking boost_1_34_1.tar.bz2 ;-) ...                                                                            [ ok ]

>>> Unpacking source...

>>> Unpacking boost_1_34_1.tar.bz2 to /var/tmp/portage/dev-util/boost-build-1.34.1/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/dev-util/boost-build-1.34.1/work/boost_1_34_1/tools ...

###

### Using 'cc' toolset.

###

rm -rf bootstrap

mkdir bootstrap

i686-pc-linux-gnu-gcc -o bootstrap/jam0 -Os -march=athlon-xp -frename-registers -fweb -pipe -fomit-frame-pointer -ftree-vectorize -funit-at-a-time -freorder-blocks -fno-ident -freorder-blocks-and-partition -fmerge-all-constants -combine -fno-strict-aliasing command.c compile.c debug.c execunix.c expand.c fileunix.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execnt.c filent.c

make1.c: In function 'alloc_state':

make1.c:131: error: incompatible implicit declaration of function 'profile_memory'

debug.c:64: error: previous definition of 'profile_memory' was here

make1.c: In function 'call_timing_rule':

make1.c:706: error: incompatible implicit declaration of function 'evaluate_rule'

compile.c:910: error: previous definition of 'evaluate_rule' was here

newstr.c: In function 'newstr':

newstr.c:130: error: incompatible implicit declaration of function 'profile_memory'

debug.c:64: error: previous definition of 'profile_memory' was here

builtins.c: In function 'append_if_exists':

builtins.c:679: error: incompatible implicit declaration of function 'timestamp'

timestamp.c:73: error: previous definition of 'timestamp' was here

native.c: In function 'declare_native_rule':

native.c:27: error: incompatible implicit declaration of function 'lol_build'

builtins.c:1574: error: previous definition of 'lol_build' was here

modules/set.c: At top level:

modules/set.c:35: warning: conflicting types for 'init_set'

builtins.c:342: warning: previous implicit declaration of 'init_set' was here

modules/path.c:26: warning: conflicting types for 'init_path'

builtins.c:343: warning: previous implicit declaration of 'init_path' was here

modules/regex.c:91: warning: conflicting types for 'init_regex'

builtins.c:344: warning: previous implicit declaration of 'init_regex' was here

modules/property-set.c:103: warning: conflicting types for 'init_property_set'

builtins.c:345: warning: previous implicit declaration of 'init_property_set' was here

modules/sequence.c:35: warning: conflicting types for 'init_sequence'

builtins.c:346: warning: previous implicit declaration of 'init_sequence' was here

modules/order.c:137: warning: conflicting types for 'init_order'

builtins.c:347: warning: previous implicit declaration of 'init_order' was here

 *

 * ERROR: dev-util/boost-build-1.34.1 failed.

 * Call stack:

 *   ebuild.sh, line 1648:   Called dyn_compile

 *   ebuild.sh, line 988:   Called qa_call 'src_compile'

 *   ebuild.sh, line 44:   Called src_compile

 *   boost-build-1.34.1.ebuild, line 57:   Called die

 *

 * building bjam failed

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/log/portage/dev-util:boost-build-1.34.1:20070802-231443.log'.

 *

*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

*** dev-util/boost-build-1.34.1 compile failed, skipping.

*** Continuing with emerge world

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> starting parallel fetching

>>> Emerging (1 of 36) dev-util/boost-build-1.34.1 to /

 * boost_1_34_1.tar.bz2 RMD160 ;-) ...                                                                              [ ok ]

 * boost_1_34_1.tar.bz2 SHA1 ;-) ...                                                                                [ ok ]

 * boost_1_34_1.tar.bz2 SHA256 ;-) ...                                                                              [ ok ]

 * boost_1_34_1.tar.bz2 size ;-) ...                                                                                [ ok ]

 * checking ebuild checksums ;-) ...                                                                                [ ok ]

 * checking auxfile checksums ;-) ...                                                                               [ ok ]

 * checking miscfile checksums ;-) ...                                                                              [ ok ]

 * checking boost_1_34_1.tar.bz2 ;-) ...                                                                            [ ok ]

>>> Unpacking source...

>>> Unpacking boost_1_34_1.tar.bz2 to /var/tmp/portage/dev-util/boost-build-1.34.1/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/dev-util/boost-build-1.34.1/work/boost_1_34_1/tools ...

###

### Using 'cc' toolset.

###

rm -rf bootstrap

mkdir bootstrap

i686-pc-linux-gnu-gcc -o bootstrap/jam0 -Os -march=athlon-xp -frename-registers -fweb -pipe -fomit-frame-pointer -ftree-vectorize -funit-at-a-time -freorder-blocks -fno-ident -freorder-blocks-and-partition -fmerge-all-constants -combine -fno-strict-aliasing command.c compile.c debug.c execunix.c expand.c fileunix.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execnt.c filent.c

make1.c: In function 'alloc_state':

make1.c:131: error: incompatible implicit declaration of function 'profile_memory'

debug.c:64: error: previous definition of 'profile_memory' was here

make1.c: In function 'call_timing_rule':

make1.c:706: error: incompatible implicit declaration of function 'evaluate_rule'

compile.c:910: error: previous definition of 'evaluate_rule' was here

newstr.c: In function 'newstr':

newstr.c:130: error: incompatible implicit declaration of function 'profile_memory'

debug.c:64: error: previous definition of 'profile_memory' was here

builtins.c: In function 'append_if_exists':

builtins.c:679: error: incompatible implicit declaration of function 'timestamp'

timestamp.c:73: error: previous definition of 'timestamp' was here

native.c: In function 'declare_native_rule':

native.c:27: error: incompatible implicit declaration of function 'lol_build'

builtins.c:1574: error: previous definition of 'lol_build' was here

modules/set.c: At top level:

modules/set.c:35: warning: conflicting types for 'init_set'

builtins.c:342: warning: previous implicit declaration of 'init_set' was here

modules/path.c:26: warning: conflicting types for 'init_path'

builtins.c:343: warning: previous implicit declaration of 'init_path' was here

modules/regex.c:91: warning: conflicting types for 'init_regex'

builtins.c:344: warning: previous implicit declaration of 'init_regex' was here

modules/property-set.c:103: warning: conflicting types for 'init_property_set'

builtins.c:345: warning: previous implicit declaration of 'init_property_set' was here

modules/sequence.c:35: warning: conflicting types for 'init_sequence'

builtins.c:346: warning: previous implicit declaration of 'init_sequence' was here

modules/order.c:137: warning: conflicting types for 'init_order'

builtins.c:347: warning: previous implicit declaration of 'init_order' was here

 *

 * ERROR: dev-util/boost-build-1.34.1 failed.

 * Call stack:

 *   ebuild.sh, line 1648:   Called dyn_compile

 *   ebuild.sh, line 988:   Called qa_call 'src_compile'

 *   ebuild.sh, line 44:   Called src_compile

 *   boost-build-1.34.1.ebuild, line 57:   Called die

 *

 * building bjam failed

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/log/portage/dev-util:boost-build-1.34.1:20070802-231551.log'.

 *

*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

The failed package dev-util/boost-build-1.34.1 could not be merged and must be successfully installed before continuing.

gentoo wrc #
```

COMMENT:

Apparently, it just bails out after the second try at boost, and didn't continue the -uD world, as advertised.  I then tried the other script in the latest Gentoo Weekly News (see below), and it too bails out with Dependency Errors, and "installed when not in list" problems. What am I missing here, or don't any of these type scripts actually work in all cases? Do I need to edit the script or somehow pass an option for a special case?

```
gentoo wrc # updatescript.sh

Emerging -uDN world then running revdep-rebuild.

You will be asked for confirmation; CTRL-C to abort at any time.

Resolving...

These are the packages that would be merged, in order:

Calculating world dependencies  ..... ..... ..... done!

[ebuild   R   ] sys-apps/sed-4.1.5  USE="nls -static" USERLAND="(GNU%*)" 0 kB [?=>0]

[ebuild   R   ] sys-apps/pciutils-2.2.6-r1  USE="zlib* -network-cron" 0 kB [0]

[ebuild  N    ] dev-util/boost-build-1.34.1  0 kB [0]

[ebuild   R   ] x11-misc/xorg-cf-files-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXprintUtil-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xcursorgen-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/bigreqsproto-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/resourceproto-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xf86rushproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xcmiscproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/xf86bigfontproto-1.1.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-proto/scrnsaverproto-1.1.0  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] app-text/ghostscript-gpl-8.57  USE="X cups gtk -bindist -cjk -djvu -jpeg2k (-emacs%)" 0 kB [?=>0]

[ebuild   R   ] sys-apps/dbus-1.0.2-r2  USE="X -debug -doc (-selinux)" KERNEL="(linux%*) (-FreeBSD)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xdriinfo-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libFS-1.0.0  USE="ipv6 -debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXevie-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXTrap-1.0.0  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/xmodmap-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXxf86dga-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-apps/setxkbmap-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/liboldX-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-misc/gccmakedep-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] dev-python/qscintilla-1.7.1  USE="-debug% -doc" 0 kB [?=>0]

[ebuild   R   ] media-libs/libdvdread-0.9.7  USE="(-static%)" 0 kB [?=>0]

[ebuild  N    ] dev-libs/boost-1.34.1  USE="-debug -doc -icu -pyste -tools" 0 kB [0]

[ebuild     U ] sys-apps/hal-0.5.9.1-r1 [0.5.9-r1] USE="crypt -acpi -debug -dell -disk-partition -doc -pcmcia (-selinux)" 0 kB [?=>0]

[ebuild   R   ] x11-misc/imake-1.0.2  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-libs/libXprintAppUtil-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-themes/xcursor-themes-1.0.1  USE="-debug (-X%*)" 0 kB [?=>0]

[ebuild   R   ] x11-base/xorg-server-1.3.0.0  USE="dri ipv6 nptl sdl xorg -3dfx -debug -dmx -kdrive -minimal -xprint" INPUT_DEVICES="evdev keyboard mouse -acecad -aiptek -calcomp -citron -digitaledge -dmc -dynapro -elo2300 -elographics -fpit -hyperpen -jamstudio -joystick -magellan -microtouch -mutouch -palmax -penmount -spaceorb -summa -synaptics -tek4957 -ur98 -vmmouse -void -wacom" VIDEO_CARDS="fbdev radeon vesa vga -apm -ark -chips -cirrus -cyrix -dummy -epson -fglrx% -glint -i128 -i740 -i810 (-impact) -imstt -mach64 -mga -neomagic (-newport) -nsc -nv -nvidia -r128 -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -v4l -via -vmware -voodoo" 0 kB [?=>0]

[ebuild   R   ] gnome-base/gnome-menus-2.18.2  USE="python -debug" KERNEL="(linux%*)" 0 kB [?=>0]

[ebuild     U ] media-sound/ardour-2.0.3 [0.99.3] USE="nls sse (-altivec) -debug -fftw%" 0 kB [?=>0]

Total: 33 packages (2 upgrades, 2 new, 29 reinstalls), Size of downloads: 0 kB

Portage tree and overlays:

 [0] /usr/portage

 [?] indicates that the source repository could not be determined

* 33 in total.

About to cancel (Y to proceed)?

** Rebuilding sys-apps/sed-4.1.5 - 1 of 33.

Patching:...done

Completed compile

* IMPORTANT: 1 config files in '/usr/kde/3.5/share/config' need updating.

** sys-apps/sed-4.1.5 installed successfully.

Packages installed so far: 0 of 0.      33 remaining.

!! Unable to resolve sys-apps/pciutils-2.2.6-r1.

** Installing dev-util/boost-build-1.34.1 - 1 of 33.

* ERROR: dev-util/boost-build-1.34.1 failed.

* Call stack:

*   ebuild.sh, line 1648:   Called dyn_compile

*   ebuild.sh, line 988:   Called qa_call 'src_compile'

*   ebuild.sh, line 44:   Called src_compile

*   boost-build-1.34.1.ebuild, line 57:   Called die

* building bjam failed

* If you need support, post the topmost build error, and the call stack if relevant.

* A complete build log is located at '/var/log/portage/dev-util:boost-build-1.34.1:20070802-232855.log'.

Completed compile

** dev-util/boost-build-1.34.1 failed to install.

Packages installed so far: 0 of 1.      32 remaining.

** Failed so far: dev-util/boost-build-1.34.1.

!! Unable to resolve x11-misc/xorg-cf-files-1.0.2.

** Rebuilding x11-libs/libXprintUtil-1.0.1 - 2 of 33.

Checking dependencies..done

* Elibtoolize: libXprintUtil-1.0.1

Patching:..done

Completed compile

* IMPORTANT: 1 config files in '/usr/kde/3.5/share/config' need updating.

** x11-libs/libXprintUtil-1.0.1 installed successfully.

Packages installed so far: 0 of 1.      32 remaining.

** Failed so far: dev-util/boost-build-1.34.1.

** Rebuilding x11-apps/xcursorgen-1.0.1 - 2 of 33.

Checking dependencies..done

** updatescript.sh: Dependency Error - x11-apps/xcursorgen-1.0.1 requires waiting which is not in the install list!

sys-apps/sed-4.1.5 installed when not in list

x11-libs/libXprintUtil-1.0.1 installed when not in list

!! ** Config file updates pending **.

gentoo wrc #
```

----------

## bluecog6

@wrc1944 - this may be a completely dumb thing to ask (I'm a noob), but couldn't you edit the file that contains the list of packages to be emerged and remove boost-build?

I am very new to this -- I can't wait to try this script though -- I have to have 630+ packages complied to be world updated -- that's a lot, but I have a weekend roadtrip coming up...  we'll see what happens

----------

## thermal

I`ve added support for using genlop to estimate the build time when preparing the emergelist. Here`s the patch:

```

--- update-world        2007-08-30 11:54:25.000000000 +0200

+++ update-world-new    2007-08-30 11:54:53.000000000 +0200

@@ -133,6 +133,11 @@

 emerge $parameter world > $emergelist

 errorcheck

 emerge $parameter world

+if [ -x "$(which genlop 2> /dev/null)" ]; then

+       genlop -p < $emergelist | grep "Estimated update time"

+else

+       echo "Emerge genlop to calculate approximate update time"

+fi

 echo -e "\nThese are the packages that will be installed.  If you want to alter this list,\njust edit the file 'emergelist' in $homedir. When finished,\nrun 'update-world --install'"

 cat $emergelist | sed -n 's/^\[ebuild[[:upper:][:lower:] ]*\]\ \([[:lower:][:upper:]0-9._+\/-]*\).*/\1/p' | sed 's/.*/=&/' | sort -d > $emergetemp

 cp $emergetemp $emergelist

```

----------

## sLumpia

 *count_zero wrote:*   

> It was discussed in another thread about combining this script with emerging packages in the correct order, a la this thread by Guenther Brunthaler (thanks for a job well done, Guenther )

 

has you combine it? it would be great

thanks for this great script  :Very Happy:   :Very Happy: 

----------

## steveL

 *wrc1944 wrote:*   

> 
> 
> Apparently, it just bails out after the second try at boost, and didn't continue the -uD world, as advertised.  I then tried the other script in the latest Gentoo Weekly News (see below), and it too bails out with Dependency Errors, and "installed when not in list" problems. What am I missing here, or don't any of these type scripts actually work in all cases? Do I need to edit the script or somehow pass an option for a special case?
> 
> 

 

Er, that looks like a bug in update (interesting one too) but you really should have reported it in the update thread. We're on version 0.1.4_beta2a atm. We also hang in #friendly-coders on IRC for bugfixing, if anyone wants to help out or needs BASH help and has been mangled by #bash ;)

----------

## cbart

 *wrc1944 wrote:*   

> 
> 
> ```
> 
> modules/property-set.c:103: warning: conflicting types for 'init_property_set'
> ...

 

I had this problem too. In my case it was a bad CFLAG, -combine; if it is it simply add a file:

```

# nano -w /etc/portage/env/dev-utils/boost-build

CFLAGS="(your cflags here without the -combine CFLAG)"

CXXFLAGS="${CFLAGS} (your additional cxxflags here)"

```

Hope I helped   :Smile: 

----------

## wrc1944

Thanks cbart,

I did have -combine (it was a default in the Conrad install I used on this box. Come to think of it, I think I recall reading that Conrad did have second thoughts about this and remove remove this flag.  I'll give your solution a try, or remove -combine completely from make.conf..

----------

## dioon

Is this script still available,cannot seem to find a site to download from.

----------

## ryker

 *dioon wrote:*   

> Is this script still available,cannot seem to find a site to download from.

 

Both sites seem to be working fine for me.

http://www.mindlesstechie.net/gentoo/update-world/

http://dixieflatline.homelinux.org/files/gentoo/

----------

## trapdoor

Thanks for your work. Just tried it, and it's a nice solution. Simple and functional!

----------

## .arris

The pipe feature does not seem to work for me: 

```

gentoo ~ # emerge -p nano | update-world

No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information.

Error: Invalid Command.

Run 'update-world --help' for usage.

```

I'm planning to pull in all packages listed in the world file of a different machine by running a command like this: 

```

emerge -p $(<world) | update-world

```

Of course this won't work wothout the piping feature of update-world   :Confused: 

Anyone have an idea how to fix this?

----------

## Kasumi_Ninja

update-world fails with dev-haskell/filepath   :Sad: 

```
*** Hit Control-C to exit, or just wait to continue with emerge.

*** Continuing with emerge.

The failed package dev-haskell/filepath-1.0 could not be merged and must be successfully installed before continuing.
```

----------

## muhsinzubeir

thanks for the script....save me lots of hours...  :Razz: 

----------

## pjv

I couldn't succeed in doing something like 'emerge -p <package> | update-world'. By the way, in the first post, in the green code text you forgot '-p'.

I was trying:

```
emerge -p coreutils | update-world.sh
```

Your script says:

```
No arguments supplied.  If you're piping from the emerge command (emerge -p <package> | update-world), this is fine.  Otherwise, cancel and type 'update-world --help' for usage information.

Error: Invalid Command.

Run 'update-world --help' for usage.

```

The output in between would be:

```

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild     U ] sys-devel/automake-1.10.1 [1.10] 

[ebuild  N    ] app-arch/lzma-utils-4.32.6  USE="-nocxx" 

[ebuild     U ] sys-apps/coreutils-6.10-r2 [6.9-r1] USE="-vanilla%" 
```

The emergelist is empty and it didn't even ask me if I wanted to overwrite (well it could have been that it asked me once, I said no, and it still wiped but didnt put in the new stuff).

Last of all, while I appreciate your work, I'm a bit worried you didn't enhance the already existing pye script, or more importantly that this kind of functionality still is missing from standard portage (allthough paludis apparently has it).

----------

## kirk427

this is what I changed to make update-world work with piped commands:

comment out line 412 (until [[ `echo "$piped...)

then change the loop to look like this:

```

while read line

        do

        piped="${piped}

$line"

        done

```

something in the original until was causing update-world to fail.  I didn't have time to figure out which part.

----------

## minor_prophets

I've been using this script now for well over a year now on 3 machines and just wanted to thank you again for such a great script.

----------

