diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gensync | 4 | ||||
-rwxr-xr-x | scripts/makepkg | 9 | ||||
-rwxr-xr-x | scripts/makeworld | 8 | ||||
-rwxr-xr-x | scripts/pacman-optimize | 114 | ||||
-rwxr-xr-x | scripts/updatesync | 4 |
5 files changed, 128 insertions, 11 deletions
diff --git a/scripts/gensync b/scripts/gensync index 49a2939a..0ebc1386 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -2,7 +2,7 @@ # # gensync # -# Copyright (c) 2002-2004 by Judd Vinet <jvinet@zeroflux.org> +# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # USA. # -myver='2.9.2' +myver='2.9.6' usage() { echo "gensync $myver" diff --git a/scripts/makepkg b/scripts/makepkg index a4c4d23a..31e78f97 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -2,7 +2,7 @@ # # makepkg # -# Copyright (c) 2002-2004 by Judd Vinet <jvinet@zeroflux.org> +# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # USA. # -myver='2.9.2' +myver='2.9.6' startdir=`pwd` PKGDEST=$startdir USE_COLOR="n" @@ -357,7 +357,7 @@ if [ "`id -u`" != "0" ]; then fi fi -msg "Making package: $pkgname (`date`)" +msg "Making package: $pkgname $pkgver-$pkgrel (`date`)" unset deplist makedeplist if [ `type -p pacman` -a "$NODEPS" = "0" ]; then @@ -552,6 +552,9 @@ if [ "$NOBUILD" = "1" ]; then exit 0 fi +# use ccache if it's available +[ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH + # build msg "Starting build()..." build 2>&1 diff --git a/scripts/makeworld b/scripts/makeworld index c42013c7..30418afd 100755 --- a/scripts/makeworld +++ b/scripts/makeworld @@ -2,7 +2,7 @@ # # makeworld # -# Copyright (c) 2002-2004 by Judd Vinet <jvinet@zeroflux.org> +# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ # USA. # +version="2.9.6" toplevel=`pwd` -version="2.9.2" usage() { echo "makeworld version $version" @@ -106,12 +106,12 @@ fi # convert a (possibly) relative path to absolute cd $dest dest=`pwd` -cd - +cd - &>/dev/null sd=`date +"[%b %d %H:%M]"` for category in $*; do - for port in `find $toplevel/$category -type d -maxdepth 1 -mindepth 1 | sort`; do + for port in `find $toplevel/$category -maxdepth 1 -mindepth 1 -type d | sort`; do cd $port if [ -f PKGBUILD ]; then . PKGBUILD diff --git a/scripts/pacman-optimize b/scripts/pacman-optimize new file mode 100755 index 00000000..b9573cbb --- /dev/null +++ b/scripts/pacman-optimize @@ -0,0 +1,114 @@ +#!/bin/bash +# +# pacman-optimize +# +# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# + +myver='2.9.6' + +usage() { + echo "pacman-optimize $myver" + echo "usage: $0 [pacman_db_root]" + echo + echo "pacman-optimize is a little hack that should improve the performance" + echo "of pacman when reading/writing to its filesystem-based database." + echo + echo "Because pacman uses many small files to keep track of packages," + echo "there is a tendency for these files to become fragmented over time." + echo "This script attempts to relocate these small files into one" + echo "contiguous location on your hard drive. The result is that the hard" + echo "drive should be able to read them faster, since the hard drive head" + echo "does not have to move around the disk as much." + echo +} + +die() { + echo "pacman-optimize: $*" >&2 + exit 1 +} + +die_r() { + rm -f /tmp/pacman.lck + die $* +} + + +dbroot="/var/lib/pacman" + +if [ "$1" != "" ]; then + if [ "$1" = "-h" -o "$1" = "--help" ]; then + usage + exit 0 + fi + dbroot=$1 +fi + +if [ "`id -u`" != 0 ]; then + die "You must be root to optimize the database" +fi + +# make sure pacman isn't running +if [ -f /tmp/pacman.lck ]; then + die "Pacman lockfile was found. Cannot run while pacman is running." +fi + +if [ ! -d $dbroot ]; then + die "$dbroot does not exist or is not a directory" +fi + +# don't let pacman run while we do this +touch /tmp/pacman.lck + +# step 1: sum the old db +echo "==> md5sum'ing the old database..." +tar c $dbroot 2>/dev/null | md5sum >/tmp/pacsums.old + +# step 1: copy the entire db directory to a new one +echo "==> copying $dbroot..." +cp -a $dbroot $dbroot.new || die_r "error copying $dbroot" + +# step 2: switch the directory names and sum the new one +echo "==> md5sum'ing the new database..." +mv $dbroot $dbroot.bak || die_r "error renaming $dbroot" +mv $dbroot.new $dbroot || die_r "error renaming $dbroot.new" +tar c $dbroot 2>/dev/null | md5sum >/tmp/pacsums.new + +# step 3: compare sums +echo "==> checking integrity..." +diff /tmp/pacsums.old /tmp/pacsums.new >/dev/null 2>&1 +if [ $? -ne 0 ]; then + # failed, move the old one back into place + rm -rf $dbroot + mv $dbroot.bak $dbroot + die_r "integrity check FAILED, reverting to old databse" +fi + +# step 4: remove the backup +echo "==> removing old database..." +rm -rf $dbroot.bak || die_r "error removing backup $dbroot.bak" + +# remove the lock and sum files +rm -f /tmp/pacman.lck /tmp/pacsums.old /tmp/pacsums.new + +echo +echo "Finished. Your pacman database has been optimized." +echo + +exit 0 + diff --git a/scripts/updatesync b/scripts/updatesync index 943af8a5..e36d25e7 100755 --- a/scripts/updatesync +++ b/scripts/updatesync @@ -3,7 +3,7 @@ # updatesync # # Copyright (c) 2004 by Jason Chu <jason@archlinux.org> -# Derived from gensync (c) 2002-2004 Judd Vinet <jvinet@zeroflux.org> +# Derived from gensync (c) 2002-2005 Judd Vinet <jvinet@zeroflux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # USA. # -myver='2.9.2' +myver='2.9.6' usage() { echo "updatesync $myver" |