[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...
Maybe you meant that you have a directory with older and newer binary
versions of the same package mixed together. I have a a script for that
# Usage: $0 fromdir todir
# Moves olver versions of packages to an "Attic" directory.
# Fromdir should be an absolute path.
# fromdir should be an absolute path now, since pkg_admin lsbest prints
# absolute pathnames...
if [ ! -w $todir ]
echo "Can't write in $todir"
for f in $(ls $fromdir)
# strip version number and .tgz
pkg=$(echo $f | sed -e 's/-[0-9][^-]*\.tgz$//')
# If pattern did not match, leave the file alone
if [ "$pkg" != "$f" ]
best=$(pkg_admin lsbest $fromdir/$pkg'-[0-9]*')
if [ "$fromdir/$f" = "$best" ]
echo $f is still the best
echo $f moved to Attic, $best is best...
mv "$fromdir/$f" "$todir"
echo "FILE $f HAS UNRECOGNISED STRUCTURE; check manually."
___ Olaf 'Rhialto' Seibert -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl -- Cetero censeo "authored" delendum esse.
Main Index |
Thread Index |