]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't assume GNU tar.
authorBruno Haible <bruno@clisp.org>
Fri, 4 Jun 2010 10:00:48 +0000 (12:00 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 4 Jun 2010 10:24:41 +0000 (12:24 +0200)
gettext-tools/misc/ChangeLog
gettext-tools/misc/convert-archive.in

index c25e7484a3a900801d4c6e66b08b9e584e9f6bb2..a417cc8464caddcbc782f1417f377a65a837d2a3 100644 (file)
@@ -2,6 +2,12 @@
 
        * gettext-0.18.1 released.
 
+2010-06-04  Bruno Haible  <bruno@clisp.org>
+
+       Don't assume GNU tar.
+       * convert-archive.in (TAR, TAR_OPTIONS): New variables.
+       Reported by Ryan Schmidt <ryandesign@macports.org>.
+
 2010-06-04  Bruno Haible  <bruno@clisp.org>
 
        * autopoint.in: Update for 0.18.1.
index 03877bdaf1ee60e362e08d9f6c376b5c5169d036..3a437990a9f9a3d461ee1d20b6d85933fee0e9b4 100644 (file)
@@ -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"