FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 08-15-2011, 04:56 PM
Dan McGee
 
Default repo-add: reorganize output messages for clarity

The use of warning once we had already started adding a package was
confusing as it broke the standard indent pattern. It was especially bad
if adding multiple packages as it wasn't clear what sub-messages applied
to which package being added. This should be an output change only from:

==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
-> Computing checksums...
-> Adding package signature...
==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
-> Removing existing entry 'netcfg-2.6.7-1'...
-> Creating 'desc' db entry...
-> Creating 'depends' db entry...

to:

==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
-> Computing checksums...
-> Adding package signature...
-> Removing existing entry 'netcfg-2.6.7-1'...
-> Creating 'desc' db entry...
-> Creating 'depends' db entry...

Signed-off-by: Dan McGee <dan@archlinux.org>
---
scripts/repo-add.sh.in | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 85b938a..fd0c814 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -266,29 +266,13 @@ db_write_entry() {
esac
done< <(bsdtar -xOqf "$pkgfile" .PKGINFO)

- csize=$(@SIZECMD@ "$pkgfile")
-
- # compute checksums
- msg2 "$(gettext "Computing checksums...")"
- md5sum="$(openssl dgst -md5 "$pkgfile")"
- md5sum="${md5sum##* }"
- sha256sum="$(openssl dgst -sha256 "$pkgfile")"
- sha256sum="${sha256sum##* }"
-
- # compute base64'd PGP signature
- if [[ -f "$pkgfile.sig" ]]; then
- msg2 "$(gettext "Adding package signature...")"
- pgpsig=$(openssl base64 -in "$pkgfile.sig" | tr -d '
')
- fi
-
# ensure $pkgname and $pkgver variables were found
if [[ -z $pkgname || -z $pkgver ]]; then
error "$(gettext "Invalid package file '%s'.")" "$pkgfile"
return 1
fi

- pushd "$tmpdir/tree" >/dev/null
- if [[ -d $pkgname-$pkgver ]]; then
+ if [[ -d $tmpdir/tree/$pkgname-$pkgver ]]; then
warning "$(gettext "An entry for '%s' already existed")" "$pkgname-$pkgver"
else
if (( DELTA )); then
@@ -300,10 +284,26 @@ db_write_entry() {
fi
fi

+ csize=$(@SIZECMD@ "$pkgfile")
+
+ # compute checksums
+ msg2 "$(gettext "Computing checksums...")"
+ md5sum="$(openssl dgst -md5 "$pkgfile")"
+ md5sum="${md5sum##* }"
+ sha256sum="$(openssl dgst -sha256 "$pkgfile")"
+ sha256sum="${sha256sum##* }"
+
+ # compute base64'd PGP signature
+ if [[ -f "$pkgfile.sig" ]]; then
+ msg2 "$(gettext "Adding package signature...")"
+ pgpsig=$(openssl base64 -in "$pkgfile.sig" | tr -d '
')
+ fi
+
# remove an existing entry if it exists, ignore failures
db_remove_entry "$pkgname"

# create package directory
+ pushd "$tmpdir/tree" >/dev/null
mkdir "$pkgname-$pkgver"
pushd "$pkgname-$pkgver" >/dev/null

--
1.7.6
 

Thread Tools




All times are GMT. The time now is 12:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org