#!/bin/sh # emerge_rsync.sh # # Alternative shell script to 'emerge rsync' that tries to keep the unmasked packages' # # Just have your unmasked packages by double commenting them out, i.e., inserting '##' before them, and run this script # # José Fonseca PACKAGE_MASK=/usr/portage/profiles/package.mask PACKAGE_MASK_OLD=`mktemp` || exit 1 PACKAGE_MASK_NEW=`mktemp` || exit 1 # Copy the old package.mask cp $PACKAGE_MASK $PACKAGE_MASK_OLD || exit 1 emerge rsync || exit 1 # Mimic the packages unmasked by '#' in the old package.mask python package.py $PACKAGE_MASK_OLD $PACKAGE_MASK > $PACKAGE_MASK_NEW || exit 1 # One can choose between two diffs: # # diff -u $PACKAGE_MASK $PACKAGE_MASK_NEW # # shows what has been unmasked again, while # # diff -u $PACKAGE_MASK_OLD $PACKAGE_MASK_NEW # # shows what changed between your previous and suggested package mask. # The later shows also what has been added so I find it a little more interesting, and if there is no change then it's obvious too, and one doesn't need too take much attention to it. ;-) # # It would be nice if less allowed to quit with non-zero return value, but unfortunately if you want to avoid the changes you'll have to hit Ctrl-Z and kill it... if diff -u $PACKAGE_MASK_OLD $PACKAGE_MASK_NEW | less then mv -f $PACKAGE_MASK_NEW $PACKAGE_MASK else rm -f $PACKAGE_MASK_NEW fi rm -f $PACKAGE_MASK_OLD # Leave this here if you also want to know what new stuff is available emerge --update --pretend world