summaryrefslogtreecommitdiffstats
path: root/src/getPackages.sh
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2008-03-30 23:49:41 -0500
committerDennis Gilmore <dennis@ausil.us>2008-03-30 23:49:41 -0500
commit4c55d64ee55268ba8a21343b24d9c2cc6a6579d0 (patch)
tree48563264ab75df9590f773611eef227fe12418c2 /src/getPackages.sh
parente8f8f671e9a95aa3daa42a6a6d8793c070edcea7 (diff)
downloadfedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.tar.gz
fedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.tar.xz
fedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.zip
add scripts from wiki. they still need work
Diffstat (limited to 'src/getPackages.sh')
-rw-r--r--src/getPackages.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/getPackages.sh b/src/getPackages.sh
new file mode 100644
index 0000000..9bd9217
--- /dev/null
+++ b/src/getPackages.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# This script came from http://fedoraproject.org/wiki/PackageMaintainers/UsefulScripts
+# initiall contributed by Contributed by Ignacio Vazquez-Abrams, modified to work with pkgdb by ToshioKuratomi
+
+
+PKGDBURL=${PACKAGEDBURL:-'https://admin.fedoraproject.org/pkgdb'}
+PKGDBADDRESS=${PKGDBURL}/acls/bugzilla?tg_format=plain
+
+download=1
+
+while getopts :f:u:o:n opt ; do
+ case $opt in
+ u)
+ user="$OPTARG"
+ ;;
+ f)
+ file="$OPTARG"
+ ;;
+ o)
+ owners="$OPTARG"
+ ;;
+ n)
+ download=0
+ ;;
+ \?)
+ echo "Usage: $(basename $0) [-u <fedora username>] [-f <plague-client config file>] [-o <owners.list>] -n"
+ echo " -o -- must point to a file downloaded from:"
+ echo " $PKGDBADDRESS"
+ echo " This script will automatically download a copy if <owners.list>"
+ echo " does not exist."
+ echo " -n Do not download even if the file is nonexistent"
+ exit 255
+ ;;
+ esac
+done
+
+file=${file:-~/.plague-client.cfg}
+
+[ -f "$file" -o -z "$email" ] || { echo "File $file does not exist" ; exit 1 ; }
+
+user=${user:-$(awk 'BEGIN { FS="[ =]+" } $1 == "upload_user" { print $2 }' < "$file")}
+
+owners=${owners:-/var/tmp/owners.list}
+if [ ! -e $owners ] ; then
+ if [ $download -le 0 ] ; then
+ echo "$owners does not exist. Cannot lookup packages"
+ exit 1
+ fi
+ if [ ! -e `dirname $owners` ] ; then
+ mkdir -p `dirname $owners` || exit $?
+ fi
+ wget $PKGDBADDRESS -O $owners
+fi
+
+awk -v user="$user" 'BEGIN { FS="|" } $1 ~ "^Fedora( EPEL| OLPC)?" && $4 == user { printf "%-11ls %s\n", $1, $2 }' < $owners
+