------------------------------------------------------------------------------- lclsync (Local Sync) -- for Gentoo ------------------------------------------------------------------------------- A script to update your local Gentoo portage tree with computers on the LAN and make maintenance easier. Checks a list of local IPs for a more recent Gentoo portage tree and then syncs with one of them (or the internet), performs an update world, depclean & revdep-rebuild and eclean. ------------------------------------------------------------------------------- ******************************************************************************* * Please report any bugs/fixes/feature requests at http://mantis.ham1.co.uk * * * * Please sign up for an account; it only takes a few seconds and you can get * * your problem resolved, or if you have a fix * ******************************************************************************* Author : Graham Russell (lclsync@ham1.co.uk) Version : 1.03 $Revision$ ****************** * Pre-conditions * ****************** 1. You probably need to be running Gentoo... 2. You will need to be in the sudoers list or run the script as root 3. You will need to be allowed to export variables: e.g. from /etc/sudoers: # Uncomment to allow users in group wheel to export variables Defaults:%wheel !env_reset 4. You will need the gentoolkit to use the whole script (revdep-rebuild): emerge -av gentoolkit ************* * Switches: * ************* -q quiet -v verbose -f force -- does without asking, non-interactive -s sync -- syncs -u update -- updates -d depclean -- depclean -r revdep -- revdep-rebuilds -e eclean -- does an eclean -1 first (1st) -- syncs with the first LAN server with a newer portage tree -a age -- prints the age of your local portage tree -w webrsync -- does an emerge-webrsync instead of the normal "emerge --sync" -x debug-mode -- enters crazy debug mode ************* * Examples: * ************* lclsync default behaviour (see basic operation graph) lclsync -sf syncs portage, using rsync, non-interactively, with the most up-to date local computer; if none fit the criteria, syncs using the internet lclsync -sfq as "lclsync -sf" but only outputs errors (if any) lclsync -suf as "lclsync -sf" but also performs a non-interactive update lclsync -w syncs using "emerge-webrsync" instead of the normal "emerge --sync", then does an update world and depclean ********* * Notes * ********* - Tested using GNU bash, version 3.2.17(1)-release (x86_64-pc-linux-gnu) - The script uses 'sudo' so you may need to enter your password, if you do not like this idea either run the script as root or read the source :)