View previous topic :: View next topic |
Author |
Message |
shiznix Guru
Joined: 29 Jun 2003 Posts: 367 Location: Adelaide, Australia
|
Posted: Thu Dec 25, 2003 1:02 pm Post subject: Script to 'emerge sync' a specific package category |
|
|
Here is a small shell script to query specific 'package-category/package' in the current portage tree & sync just that specific package or package-category if you so wish.
The Script
Code: | #!/bin/sh
# specsync - A small script to query & sync specific package-category/package
# in the current Gentoo portage tree.
# Usage: specsync (--pretend) <package-category>
if [ `/usr/bin/whoami` != 'root' ]
then
echo "You must be root"
exit
fi
RSYNC="rsync.gentoo.org"
SRC="gentoo-portage"
DEST="/usr/portage"
CAT=$1
PCAT=$2
if [ -z "$1" ]
then
echo "Usage -> $0 (--pretend) <package-category>"
elif [ $CAT = "--pretend" ]
then
/usr/bin/rsync $RSYNC::$SRC/$PCAT/
else
if [ ! -d $DEST/$CAT ]
then
mkdir -p $DEST/$CAT
fi
/usr/bin/rsync -rlptDvz --progress --stats --delete --delete-after $RSYNC::$SRC/$CAT/ $DEST/$CAT/
fi |
Usage examples:
Code: | specsync --pretend x11-base |
Lists current packages contained in the x11-base category.
Code: | specsync --pretend x11-base/xdirectfb |
Lists current ebuilds contained in x11-base/xdirectfb.
Syncs your portage tree to the current x11-base category.
Code: | specsync x11-base/xdirectfb |
Syncs your portage tree to the current x11-base/xdirectfb package.
Note:
Use with caution. The portage tree is a highly integrated set of ebuilds. Upgrading specific parts & not the whole, may upset the emerging of other packages, by it looking for ebuilds that are not in your portage tree.
Which is probably why this 'feature' is not present in the emerge command.
If this should ever happen, just 'emerge sync'. |
|
Back to top |
|
|
GentooBox Veteran
Joined: 22 Jun 2003 Posts: 1168 Location: Denmark
|
Posted: Thu Dec 25, 2003 4:41 pm Post subject: |
|
|
You can upgrade the script with some colors.
Code: | SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" |
thats my SYNC.
you could upgrade the scipt like this:
#What mirror do you want to use ?
#europe
#other
#gentoo
PART="europe"
RSYNC="rsync.$PART.gentoo.org"
or something like that.
i cant remember other mirrors like "europe".
_________________ Encrypt, lock up everything and duct tape the rest |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|