summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/repo-add.sh.in')
-rw-r--r--scripts/repo-add.sh.in21
1 files changed, 6 insertions, 15 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index c8380c4e..3f00441a 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -136,7 +136,8 @@ db_write_delta()
echo -e "%DELTAS%" >>$deltas
fi
# get md5sum and compressed size of package
- md5sum="$(openssl dgst -md5 "$deltafile" | awk '{print $NF}')"
+ md5sum="$(openssl dgst -md5 "$deltafile")"
+ md5sum="${md5sum##* }"
csize=$(@SIZECMD@ "$deltafile")
oldfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (source)" | sed 's/.*: *//')
@@ -213,7 +214,8 @@ db_write_entry()
IFS=$OLDIFS
# get md5sum and compressed size of package
- md5sum="$(openssl dgst -md5 "$pkgfile" | awk '{print $NF}')"
+ md5sum="$(openssl dgst -md5 "$pkgfile")"
+ md5sum="${md5sum##* }"
csize=$(@SIZECMD@ "$pkgfile")
# ensure $pkgname and $pkgver variables were found
@@ -357,7 +359,7 @@ add()
fi
pkgfile=$1
- if ! bsdtar -tqf "$pkgfile" .PKGINFO 2>&1 >/dev/null; then
+ if ! bsdtar -tqf "$pkgfile" .PKGINFO >/dev/null 2>&1; then
error "$(gettext "'%s' is not a package file, skipping")" "$pkgfile"
return 1
fi
@@ -423,12 +425,6 @@ case "$1" in
-V|--version) version; exit 0;;
esac
-# check for correct number of args
-if [ $# -lt 2 ]; then
- usage
- exit 1
-fi
-
# figure out what program we are
cmd="$(basename $0)"
if [ "$cmd" != "repo-add" -a "$cmd" != "repo-remove" ]; then
@@ -450,12 +446,6 @@ success=0
for arg in "$@"; do
case "$arg" in
-q|--quiet) QUIET=1;;
-
- -f|--force)
- warning "$(gettext "the -f and --force options are no longer recognized")"
- msg2 "$(gettext "use options=(force) in the PKGBUILD instead")"
- ;;
-
*)
if [ -z "$REPO_DB_FILE" ]; then
REPO_DB_FILE="$arg"
@@ -499,6 +489,7 @@ if [ $success -eq 1 ]; then
[ -f "$tmpdir/$filename" ] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
else
msg "$(gettext "No packages modified, nothing to do.")"
+ exit 1
fi
exit 0