From: Bruno Haible Date: Fri, 4 Jun 2010 10:00:48 +0000 (+0200) Subject: Don't assume GNU tar. X-Git-Tag: v0.18.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7643112feeb1535f45cfb2eedf70b768be37cf;p=thirdparty%2Fgettext.git Don't assume GNU tar. --- diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index c25e7484a..a417cc846 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -2,6 +2,12 @@ * gettext-0.18.1 released. +2010-06-04 Bruno Haible + + Don't assume GNU tar. + * convert-archive.in (TAR, TAR_OPTIONS): New variables. + Reported by Ryan Schmidt . + 2010-06-04 Bruno Haible * autopoint.in: Update for 0.18.1. diff --git a/gettext-tools/misc/convert-archive.in b/gettext-tools/misc/convert-archive.in index 03877bdaf..3a437990a 100644 --- a/gettext-tools/misc/convert-archive.in +++ b/gettext-tools/misc/convert-archive.in @@ -220,10 +220,22 @@ ba ;; esac +# Find a good 'tar' program. +existing_file=gettext-0.10.35/ABOUT-NLS +TAR=tar +TAR_OPTIONS= +for prog in tar gnutar gtar; do + if (cd "$unpacked" && $prog cf - --owner=root --group=root "$existing_file") >/dev/null 2>&1; then + TAR=$prog + TAR_OPTIONS='--owner=root --group=root' + break + fi +done + # Create the target archive. case "$to" in dir) - (cd "$unpacked" && tar cf - --owner=root --group=root *) \ + (cd "$unpacked" && $TAR cf - $TAR_OPTIONS *) \ | gzip -c -9 > "$tofile" \ || func_fatal_error "archive creation failed" ;; @@ -283,7 +295,7 @@ case "$to" in rm -rf tmpcheckout done ) - (cd "$cvs_dir" && tar cf - --owner=root --group=root archive) \ + (cd "$cvs_dir" && $TAR cf - $TAR_OPTIONS archive) \ | gzip -c -9 > "$tofile" \ || func_fatal_error "archive creation failed" rm -rf "$cvs_dir" cvsuser.so @@ -325,7 +337,7 @@ case "$to" in ) (cd "$git_dir" && git reset -q --hard empty && git repack -a -d -q) \ || func_fatal_error "git reset or repack failed" - (cd "$git_dir" && tar cf - --owner=root --group=root .git) \ + (cd "$git_dir" && $TAR cf - $TAR_OPTIONS .git) \ | gzip -c -9 > "$tofile" \ || func_fatal_error "archive creation failed" rm -rf "$git_dir"