diff options
Diffstat (limited to 'src/abslibre-tools')
-rwxr-xr-x | src/abslibre-tools/librerelease | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 4dd17b0..286896a 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -38,7 +38,7 @@ . libremessages . $(librelib conf.sh) -function usage { +usage() { print "Usage: %s [OPTIONS]" "${0##*/}" echo print 'This script uploads packages on $WORKDIR/stagging' @@ -51,7 +51,7 @@ function usage { print " -h Show this message" } -function list_packages { +list_packages() { find "$WORKDIR/staging/" -mindepth 1 -type d -not -empty -printf '%f\n' | sort | while read -r repo; do msg2 "$repo" @@ -81,7 +81,7 @@ create_signature() { fi } -function sign_packages { +sign_packages() { if [ -z "${GPG_AGENT_INFO}" ]; then warning "It's better to use gpg-agent to sign packages in batches" fi @@ -104,14 +104,14 @@ function sign_packages { } # Remove everything that's not a package or a signature -function clean_non_packages { +clean_non_packages() { find $WORKDIR/staging/ -type f \ \! -iname "*.pkg.tar.?z" -a \! -iname "*.pkg.tar.?z.sig" \ -delete } # Clean everything if not on dry-run mode -function clean { +clean() { if [[ -n "${dryrun}" ]]; then : else @@ -121,7 +121,7 @@ function clean { fi } -function main { +main() { if [ -w / ]; then error "This program should be run as regular user" return 1 @@ -161,7 +161,7 @@ function main { "$mode" } -function release_packages { +release_packages() { if [[ -n $HOOKPRERELEASE ]]; then msg "Running HOOKPRERELEASE..." bash -c "${HOOKPRERELEASE}" @@ -173,8 +173,8 @@ function release_packages { # Make the permissions of the packages 644 otherwise the user will get access # denied error when they try to download (rsync --no-perms doesn't seem to # work). - find ${WORKDIR}/staging -type f -exec chmod 644 {} \; - find ${WORKDIR}/staging -type d -exec chmod 755 {} \; + find ${WORKDIR}/staging -type f -exec chmod 644 {} + + find ${WORKDIR}/staging -type d -exec chmod 755 {} + msg "%s to upload" $(du -h -d 0 ${WORKDIR}/staging | tr "\t" " " | cut -d" " -f1) msg "Uploading packages..." |