summaryrefslogtreecommitdiffstats
path: root/pkgdb1
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-04-08 05:52:55 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2008-04-08 05:52:55 +0200
commit4bc106f1a60a6172b707bfaee5aff5030234466e (patch)
tree95e3ff179162665274e0ca212b9b4c8f258201c1 /pkgdb1
parent29a77254307e42ba0959fe7660aa3d0d76285e6a (diff)
downloaddbscripts-4bc106f1a60a6172b707bfaee5aff5030234466e.tar.gz
dbscripts-4bc106f1a60a6172b707bfaee5aff5030234466e.tar.xz
Giant SVN changes
Some other fun stuff snuck in there, like indentation changes, but this should get us mostly working under SVN, and at least allow us to build DB files at the very least Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'pkgdb1')
-rwxr-xr-xpkgdb1101
1 files changed, 51 insertions, 50 deletions
diff --git a/pkgdb1 b/pkgdb1
index fee01fc..a421007 100755
--- a/pkgdb1
+++ b/pkgdb1
@@ -3,66 +3,67 @@
# Get the package name from the filename
# hackish, but should work for now
getpkgname() {
- local tmp
+ local tmp
- tmp=${1##*/}
- tmp=${tmp%.pkg.tar.gz}
- tmp=${tmp%-i686}
- tmp=${tmp%-x86_64}
- echo ${tmp%-*-*}
+ tmp=${1##*/}
+ tmp=${tmp%.pkg.tar.gz}
+ tmp=${tmp%-i686}
+ tmp=${tmp%-x86_64}
+ echo ${tmp%-*-*}
}
-STAGEDIR=`pwd`
+STAGEDIR=$(pwd)
-ABSDIR=$1
-if [ "$ABSDIR" = "" ]; then
- me=`basename $0`
- echo "usage: $me <abs_dir>" >&2
- exit 1
+#This is our "unknown" category. We will have to do something about this later.
+# It is a stop-gap
+CATEGORY=25
+
+SVNCO=$1
+REPOTAG=$2
+if [ "$SVNCO" = "" ]; then
+ me=$(basename $0)
+ echo "usage: $me <abs_dir> <repo_tag>" >&2
+ exit 1
fi
-if [ ! "`ls $STAGEDIR/*.pkg.tar.gz 2>/dev/null`" ]; then
- exit
+if [ ! "$(ls $STAGEDIR/*.pkg.tar.gz 2>/dev/null)" ]; then
+ exit
fi
cd $STAGEDIR
-for pkgfile in `ls $STAGEDIR/*.pkg.tar.gz`; do
- pkgname=$(getpkgname $pkgfile);
- fullname=$(basename $pkgfile)
- # find the matching PKGBUILD
- tmpf=$(mktemp /tmp/pkgdb1.XXXXXXXXXX) || exit 1
- find $ABSDIR -type d -name "$pkgname" >$tmpf
- if [ "`cat $tmpf | wc -l`" != "1" ]; then
- echo "WARNING: could not find PKGBUILD for $pkgname, cannot update this entry" >&2
- rm $tmpf
- continue
- fi
- pkgbuild="`cat $tmpf`/PKGBUILD"
- rm $tmpf
- if [ ! -f $pkgbuild ]; then
- echo "WARNING: could not find PKGBUILD for $fullname, cannot update this entry" >&2
- continue
- fi
- # pick out the category from the pathname
- catpath=$(cd `dirname $pkgbuild`/.. && pwd)
- category=${catpath##*/}
- # now read the PKGBUILD and output the data for pkgdb2
- unset pkgname pkgver pkgrel pkgdesc license groups provides md5sums force
- unset replaces depends conflicts backup source install build makedepends
- unset options
- source $pkgbuild || continue
+for pkgfile in $STAGEDIR/*.pkg.tar.gz; do
+ pkgname=$(getpkgname $pkgfile);
+ fullname=$(basename $pkgfile)
+ pkgpath="$SVNCO/$pkgname/repos/$REPOTAG"
+
+ # find the matching PKGBUILD
+ if [ ! -d "$pkgpath" ]; then
+ msg "WARNING: could not find PKGBUILD for $pkgname, cannot update this entry"
+ return
+ fi
+ pkgbuild="${pkgpath}/PKGBUILD"
+ if [ ! -f $pkgbuild ]; then
+ msg "WARNING: could not find PKGBUILD for $fullname, cannot update this entry"
+ return
+ fi
+
+ # pick out the category from the pathname
+ unset pkgname pkgver pkgrel pkgdesc license groups provides md5sums force
+ unset replaces depends conflicts backup source install build makedepends
+ unset options
+ source $pkgbuild || continue
- deplist=${depends[@]}
- sources=${source[@]}
- echo $fullname
- echo $pkgname
- echo $pkgver
- echo $pkgrel
- echo $pkgdesc
- echo $category
- echo $url
- echo $sources
- echo $deplist
+ deplist=${depends[@]}
+ sources=${source[@]}
+ echo $fullname
+ echo $pkgname
+ echo $pkgver
+ echo $pkgrel
+ echo $pkgdesc
+ echo $CATEGORY
+ echo $url
+ echo $sources
+ echo $deplist
done
exit 0