John Burrell wrote:
> I attach an outline script to test for older versions of a package.
> If more than two occurrences of the package name are found, it prints
> outthe name and how many times it occurred.Should always be an even
> number. I haven't tested it of course, but hopefully it won't take
> too much tweakingto get it to run on your /sources/BLFS/svn
> directory. jb.
It's a start. Just reading, it doesn't seem to find this:
libvorbis-1.3.2.tar.xz
libvorbis-1.3.3.tar.xz
But here is a simple script to find duplicates:
#! /bin/bash
dir=/srv/ftp/BLFS/svn
files=$(find $dir ! -type d -exec basename {} \; | sort)
for f in $files; do
if [ "$f" == "$prev" ]; then find $dir -name "$f"; prev=""; fi
prev=$f
done
It did find libpthread-stubs-0.3 in both l/ and Xorg/.
Doing the same thing with sed -r 's/-[0-9].*$//' could probably find
older versions of a file. It's only slightly more complicated.
#! /bin/bash
dir=/srv/ftp/BLFS/svn
files=$(find $dir ! -type d -exec basename {} \; | sort)
for f in $files; do
if [ "$(echo $f | grep md5sum)" != "" ]; then continue; fi
if [ "$(echo $f | grep md5 )" != "" ]; then continue; fi
if [ "$(echo $f | grep patch )" != "" ]; then continue; fi
base=$(echo $f | sed -r 's/-[0-9].*$//')
if [ "$base" == "$prev" ]; then
find $dir -name "$base*"
prev=""
else
prev=$base
fi
done
but finds a lot of false positives like:
zsh-5.0.0-doc.tar.bz2
zsh-5.0.0.tar.bz2
It looks like there are some old versions hanging around though like
kde4/phonon-backend-gstreamer-4.4.4.tar.bz2
p/phonon-backend-gstreamer-4.6.2.tar.xz
Most seem to be kde related. I'll clean it up tomorrow.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page