diff mbox

[1/3] scripts/package: tar-pkg: use tar --owner=root

Message ID 20091124151137.GB14731@progeny.tock (mailing list archive)
State New, archived
Headers show

Commit Message

Jonathan Nieder Nov. 24, 2009, 3:11 p.m. UTC
None
diff mbox

Patch

diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index b1fd48d..51b2aa0 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -101,7 +101,11 @@  esac
 #
 (
 	cd "${tmpdir}"
-	tar cf - . | ${compress} > "${tarball}${file_ext}"
+	opts=
+	if tar --owner=root --group=root --help >/dev/null 2>&1; then
+		opts="--owner=root --group=root"
+	fi
+	tar cf - . $opts | ${compress} > "${tarball}${file_ext}"
 )
 
 echo "Tarball successfully created in ${tarball}${file_ext}"