summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-02-22 08:56:11 +0100
committerJudd Vinet <judd@archlinux.org>2006-02-22 08:56:11 +0100
commit5128cca4a76c5133f3c98db79b9c66a7b55916c6 (patch)
tree18ec55c1773f6b39a70356f217cbfc0726eaa6ce
parenta49feb74bba7a0dfe7f5a546fc4a188ded208c61 (diff)
downloaddbscripts-5128cca4a76c5133f3c98db79b9c66a7b55916c6.tar.gz
dbscripts-5128cca4a76c5133f3c98db79b9c66a7b55916c6.tar.xz
fixed dupe package listings
-rwxr-xr-xgenpkglist36
1 files changed, 30 insertions, 6 deletions
diff --git a/genpkglist b/genpkglist
index 08111ce..1d25201 100755
--- a/genpkglist
+++ b/genpkglist
@@ -1,5 +1,5 @@
#!/bin/bash
-# $Id: genpkglist,v 1.12 2005/01/03 08:09:21 judd Exp $
+# $Id: genpkglist,v 1.13 2006/02/22 07:56:11 judd Exp $
#
# genpkglist
@@ -29,11 +29,35 @@ for category in `find * -maxdepth 0 -type d | grep -v CVS`; do
cd ..
done
-DUPES=`ls -1 /home/ftp/$1/os/i686 | rev | cut -d- -f 3- | rev | sort | uniq -c | egrep -v '^ 1' | awk '{print $2}'`
+cd /home/ftp/$1/os/i686
+unset DUPES DUPEFILES last
+for pkg in *.pkg.tar.gz; do
+ pkgname=${pkg%-*-*}
+ if [ "$last" = "$pkgname" ]; then
+ DUPES="$DUPES $pkgname"
+ DUPEFILES="$DUPEFILES $pkg"
+ fi
+ last=$pkgname
+done
-if [ -n "$DUPES" ]; then
- echo "Possible Dupes for $1 (please remove old versions)."
- echo "Date Filename"
- for dupe in $DUPES; do ls -l /home/ftp/$1/os/i686/${dupe}* | awk '{print $6" "$7" "$8" "$9}'; done
+showdupes() {
+ done=
+ for i in *.pkg.tar.gz; do
+ pkgname=${i%-*-*}
+ if [ "$pkgname" = "$1" ]; then
+ ls -l $i | awk '{print $6" "$7" "$8" "$9}'
+ done=1
+ else
+ [ "$done" = "1" ] && return
+ fi
+ done
+}
+
+if [ "$DUPES" ]; then
+ echo "Possible Dupes for $1 (please remove old versions)"
+ echo "Date Filename"
+ for dupe in $((for d in `echo $DUPES`; do echo $d; done) | sort -u); do
+ showdupes $dupe
+ done
fi