summaryrefslogtreecommitdiffstats
path: root/scripts/gensync
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gensync')
-rwxr-xr-xscripts/gensync36
1 files changed, 25 insertions, 11 deletions
diff --git a/scripts/gensync b/scripts/gensync
index 3cfcbcaa..b80367f3 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -2,7 +2,7 @@
#
# gensync
#
-# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
+# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
# USA.
#
-myver='2.9.7'
+myver='2.9.8'
usage() {
echo "gensync $myver"
@@ -51,6 +51,18 @@ die() {
exit 1
}
+check_option() {
+ local i
+ for i in ${options[@]}; do
+ local uc=`echo $i | tr [:lower:] [:upper:]`
+ local lc=`echo $i | tr [:upper:] [:lower:]`
+ if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
+ echo $1
+ return
+ fi
+ done
+}
+
get_md5checksum()
{
if [ "$pkgdir" != "" ]; then
@@ -69,7 +81,7 @@ get_md5checksum()
db_write_entry()
{
unset pkgname pkgver pkgrel pkgdesc force
- unset groups replaces provides depends conflicts
+ unset groups replaces provides depends conflicts options
source $1 || return 1
cd $gstmpdir
mkdir $pkgname-$pkgver-$pkgrel || return 1
@@ -107,7 +119,7 @@ db_write_entry()
done
echo "" >>desc
fi
- if [ "$force" = "y" -o "$force" = "Y" ]; then
+ if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
echo "%FORCE%" >>desc
echo "" >>desc
fi
@@ -140,7 +152,7 @@ db_write_entry()
if [ $# -lt 2 ]; then
usage
- exit 0
+ exit 1
fi
if [ "$1" = "-h" -o "$1" = "--help" ]; then
@@ -169,12 +181,14 @@ for file in `find $rootdir/* -name PKGBUILD`; do
else
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
fi
- [ -f $pkgfile ] || die "missing package file: $pkgfile"
- csize=`du -b $pkgfile | cut -f1`
- pkgmd5sum=`get_md5checksum $pkgfile`
- [ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
- db_write_entry $file
- [ $? -gt 0 ] && die "error writing entry for $file"
+ if [ -f $pkgfile ]; then
+ csize=`du -b $pkgfile | cut -f1`
+ pkgmd5sum=`get_md5checksum $pkgfile`
+ [ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
+ db_write_entry $file || die "error writing entry for $file"
+ else
+ echo "gensync: missing package: $pkgfile" >&2
+ fi
done
echo "gensync: compressing to $destfile..." >&2