summaryrefslogtreecommitdiff
path: root/genpkglist
blob: 08111ceac65cb4f41d68b0bec152e73088ca8b27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# $Id: genpkglist,v 1.12 2005/01/03 08:09:21 judd Exp $

#
# genpkglist
#
# Generates a text package database for use with the setup script
# (also used to check for missing packages in the download directory)
#

pkgfile="`pwd`/packages.txt"
repodir=$1

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
		if [ -f PKGBUILD ]; then
			. PKGBUILD
			if [ -f /home/ftp/$repodir/os/i686/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then
				echo "$category/$pkgname-$pkgver-$pkgrel.pkg.tar.gz" >>$pkgfile
			else
				echo "notice: Missing $pkgname-$pkgver-$pkgrel.pkg.tar.gz in ftp site" >&2
			fi
		fi
		cd ..
	done
	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}'`

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
fi