diff options
author | Allan McRae <allan@archlinux.org> | 2012-02-24 12:40:20 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-03-05 18:44:34 +0100 |
commit | cb64fbeac41308ee8c46384a126195a1fd75a361 (patch) | |
tree | 8c15263ba96093d255625a7296d61198fd2b7c0c /scripts/repo-add.sh.in | |
parent | ea7fc8962a819a04237876995140363a818202d4 (diff) | |
download | pacman-cb64fbeac41308ee8c46384a126195a1fd75a361.tar.gz pacman-cb64fbeac41308ee8c46384a126195a1fd75a361.tar.xz |
Do not dereference symlinks when calculating size
Passing the "-L" flag to stat means we get the size of the file
being pointed to for symlinks instead of the size of the symlink.
Keep "-L" usage in repo-add as we want the actual size of the
package/delta/signature there.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/repo-add.sh.in')
-rw-r--r-- | scripts/repo-add.sh.in | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 26aa7257..2bb9c83f 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -144,7 +144,7 @@ db_write_delta() { # get md5sum and compressed size of package md5sum="$(openssl dgst -md5 "$deltafile")" md5sum="${md5sum##* }" - csize=$(@SIZECMD@ "$deltafile") + csize=$(@SIZECMD@ -L "$deltafile") oldfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (source)" | sed 's/.*: *//') newfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (output)" | sed 's/.*: *//') @@ -294,7 +294,7 @@ db_write_entry() { # compute base64'd PGP signature if [[ -f "$pkgfile.sig" ]]; then - pgpsigsize=$(@SIZECMD@ "$pkgfile.sig") + pgpsigsize=$(@SIZECMD@ -L "$pkgfile.sig") if (( pgpsigsize > 16384 )); then error "$(gettext "Invalid package signature file '%s'.")" "$pkgfile.sig" return 1 @@ -303,7 +303,7 @@ db_write_entry() { pgpsig=$(openssl base64 -in "$pkgfile.sig" | tr -d '\n') fi - csize=$(@SIZECMD@ "$pkgfile") + csize=$(@SIZECMD@ -L "$pkgfile") # compute checksums msg2 "$(gettext "Computing checksums...")" |