星期六, 十一月 25, 2006

Using ‘until’ with portage

Have you ever updated your world or system and walked away only to come back several hours later to find out the update did not complete because a package failed?

The following simple command list and bash ‘until’ command will let you update your world or system to completion and skip those packages that failed:

Code Listing 3.1: Using until to skip broken packages


# sudo emerge -DNu world ||
# until sudo emerge --resume --skipfirst; do
# sudo emerge --resume --skipfirst; done

Once the command list completes, you can find out which packages failed by running the following command:

Code Listing 3.2: Checking for failed packages

# emerge -Dup world

Warning: Under certain circumstances, this can yield an unusable system. Always check the output of emerge -Dup world prior to using this tip.



0 意見: