pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: upgrading pkgsrc, and variations on the theme of bin-install



On Fri 17 Oct 2008 at 23:41:19 -0400, Taylor R Campbell wrote:
> Since binary packages are hard, I think that next time I sha'n't
> bother with reusing old ones at all, and instead upgrade entirely from
> source.  Now, to clean out my directory of binary packages without
> checking versions on three hundred packages by hand...

I made a script for that. It moves binary packages which are no longer
installed.

#!/bin/sh
#
# Usage: $0 fromdir todir
#
# Moves all binary packages in fromdir that are not installed anymore
# to todir.

fromdir=$1
todir=$2

if [ ! -w $todir ]
then
    echo "Can't write in $todir"
    exit
fi

for f in $(ls $fromdir)
do
    pkg=${f%.tgz}
    if pkg_info -e "$pkg"
    then
        echo $pkg is still installed
    else
        echo $pkg moved to Attic...
        mv "$fromdir/$f" "$todir"
    fi
done


Home | Main Index | Thread Index | Old Index