summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db-inc6
-rwxr-xr-xgenpkglist53
2 files changed, 46 insertions, 13 deletions
diff --git a/db-inc b/db-inc
index 6c0b78c..7e2e61a 100644
--- a/db-inc
+++ b/db-inc
@@ -173,8 +173,10 @@ fi
if [ "$updatelists" ]; then
echo "==> Generating Text Package List..." >&2
cd $TMPDIR/checkout
- $ARCHDIR/genpkglist $ftppath $arch
- mv packages.txt $ftppath/packages.txt
+ $ARCHDIR/genpkglist $ftppath $svnrepo
+ if [ -f packages.txt ]; then
+ mv packages.txt $ftppath/packages.txt
+ fi
fi
cleanup
diff --git a/genpkglist b/genpkglist
index d026916..31b7c78 100755
--- a/genpkglist
+++ b/genpkglist
@@ -18,26 +18,57 @@ getpkgname() {
echo ${tmp%-*-*}
}
-pkgfile="`pwd`/packages.txt"
+pkgfile="$(pwd)/packages.txt"
ftppath=$1
-dbarch=$2
+repotag=$2
rm -f $pkgfile
-for category in `find * -maxdepth 0 -type d | grep -v CVS`; do
- cd $category
- for pkg in `/bin/ls`; do
- cd $pkg
+for package in *; do
+ if [ -d "$package/$repotag/" ]; then
+ cd "$package/$repotag/"
if [ -f PKGBUILD ]; then
. PKGBUILD
if [ -f $ftppath/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then
- echo "$category/$pkgname-$pkgver-$pkgrel.pkg.tar.gz" >>$pkgfile
+ echo "$pkgname-$pkgver-$pkgrel.pkg.tar.gz" >>$pkgfile
elif [ -f $ftppath/$pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz ]; then
- echo "$category/$pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz" >>$pkgfile
+ echo "$pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz" >>$pkgfile
else
echo "notice: Missing $pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz in ftp site" >&2
fi
- fi
+ fi
cd ..
- done
- cd ..
+ fi
done
+
+cd $ftppath
+unset DUPES DUPEFILES last
+for pkg in *.pkg.tar.gz; do
+ pkgname=$(getpkgname $pkg)
+ if [ "$last" = "$pkgname" ]; then
+ DUPES="$DUPES $pkgname"
+ DUPEFILES="$DUPEFILES $pkg"
+ fi
+ last=$pkgname
+done
+
+showdupes() {
+ done=
+ for i in *.pkg.tar.gz; do
+ pkgname=$(getpkgname $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
+ DUPES=$((for d in $DUPES; do echo $d; done) | sort -u)
+ echo "Possible Dupes for $ftppath (remove old versions)"
+ echo "Date Filename"
+ for dupe in $DUPES; do
+ showdupes $dupe
+ done
+fi