summaryrefslogtreecommitdiffstats
path: root/src/cpancheck.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/cpancheck.sh
parente8f8f671e9a95aa3daa42a6a6d8793c070edcea7 (diff)
downloadfedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.zip
fedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.tar.gz
fedora-packager-4c55d64ee55268ba8a21343b24d9c2cc6a6579d0.tar.xz
add scripts from wiki. they still need work
Diffstat (limited to 'src/cpancheck.sh')
-rw-r--r--src/cpancheck.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/cpancheck.sh b/src/cpancheck.sh
new file mode 100644
index 0000000..bc1b574
--- /dev/null
+++ b/src/cpancheck.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+wget="wget -q"
+cvs="cvs -q -z1"
+
+me=""
+rpms=~/code/fedora
+
+OWNERS=${OWNERS:-https://admin.fedoraproject.org/pkgdb/acls/bugzilla?tg_format=plain}
+CPAN=${CPAN:-"http://www.cpan.org"}
+packages=$HOME/.cpan/sources/modules/02packages.details.txt.gz
+
+tmpdir=$( mktemp -d /tmp/cpancheck.XXXXXX )
+trap cleanup EXIT
+cleanup()
+{
+ set +e
+ [ -z "$tmpdir" -o ! -d "$tmpdir" ] || rm -rf "$tmpdir"
+}
+owners=$tmpdir/owners.list
+
+mkdir -p $( dirna~/code/fedorame $packages )
+echo "Updating CPAN package details..."
+$wget -N -O $packages $CPAN/modules/$( basename $packages )
+
+echo "Retrieving package owners list..."
+$wget -N -O $owners $OWNERS
+
+for package in $( grep "\\b$me\\b" $owners | cut -d'|' -f2 | grep '^perl-' ) ; do
+ echo "Updating $package..."
+ ( cd $rpms && $cvs up $package )
+
+ echo "Checking $package..."
+
+ if [ ! -d $rpms/$package/devel ] ; then
+ echo " - No devel/, skipping..."
+ continue
+ fi
+
+ module=$( echo $package | sed 's,^perl-,,;s/-/::/g' )
+ cpanversion=$( zgrep '^'$module' ' $packages | awk '{print $2}' )
+ pkgversion=$( grep '^Version:' $rpms/$package/devel/$package.spec \
+ | awk '{print $2}' )
+
+ if [ $cpanversion != $pkgversion ] ; then
+ echo " *** MISMATCH: devel is $pkgversion, CPAN is $cpanversion." >&2
+ else
+ echo "$package is up-to-date!"
+ fi
+done
+
+# vi: set ai et: