summaryrefslogtreecommitdiffstats
path: root/scripts/gensync
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gensync')
-rwxr-xr-xscripts/gensync75
1 files changed, 61 insertions, 14 deletions
diff --git a/scripts/gensync b/scripts/gensync
index ef528543..e6bf8982 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -1,6 +1,26 @@
#!/bin/bash
+#
+# gensync
+#
+# Copyright (c) 2002-2003 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+#
-myver='2.5.1'
+myver='2.6'
usage() {
echo "gensync $myver"
@@ -24,14 +44,15 @@ usage() {
db_write_entry()
{
- unset pkgname pkgver pkgrel
- unset depends conflicts
+ unset pkgname pkgver pkgrel pkgdesc
+ unset groups replaces provides depends conflicts
source $1 || return 1
cd /tmp/.gensync
mkdir $pkgname-$pkgver-$pkgrel
cd $pkgname-$pkgver-$pkgrel
# desc
- echo "%NAME%" >desc
+ : >desc
+ echo "%NAME%" >>desc
echo "$pkgname" >>desc
echo "" >>desc
echo "%VERSION%" >>desc
@@ -40,17 +61,43 @@ db_write_entry()
echo "%DESC%" >>desc
echo "$pkgdesc" >>desc
echo "" >>desc
+ if [ ${#groups[*]} -gt 0 ]; then
+ echo "%GROUPS%" >>desc
+ for it in "${groups[@]}"; do
+ echo "$it" >>desc
+ done
+ echo "" >>desc
+ fi
+ if [ ${#replaces[*]} -gt 0 ]; then
+ echo "%REPLACES%" >>desc
+ for it in "${replaces[@]}"; do
+ echo "$it" >>desc
+ done
+ echo "" >>desc
+ fi
# depends
- echo "%DEPENDS%" >depends
- for depend in "${depends[@]}"; do
- echo "$depend" >>depends
- done
- echo "" >>depends
- echo "%CONFLICTS%" >>depends
- for conflict in "${conflicts[@]}"; do
- echo "$conflict" >>depends
- done
- echo "" >>depends
+ : >depends
+ if [ ${#depends[*]} -gt 0 ]; then
+ echo "%DEPENDS%" >>depends
+ for it in "${depends[@]}"; do
+ echo "$it" >>depends
+ done
+ echo "" >>depends
+ fi
+ if [ ${#conflicts[*]} -gt 0 ]; then
+ echo "%CONFLICTS%" >>depends
+ for it in "${conflicts[@]}"; do
+ echo "$it" >>depends
+ done
+ echo "" >>depends
+ fi
+ if [ ${#provides[*]} -gt 0 ]; then
+ echo "%PROVIDES%" >>depends
+ for it in "${provides[@]}"; do
+ echo "$it" >>depends
+ done
+ echo "" >>depends
+ fi
}
if [ $# -lt 2 ]; then