Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2012-11-20 17:46:17 +0100
committerMichal Marek <mmarek@suse.cz>2012-11-20 17:46:17 +0100
commitb54023c2b4f4c0683705fcab37baf67ca96c51db (patch)
tree96435319983f29e4b36704a0b6f3e08ec4160b04
parent8f28143482d022645f07b897e0f3b1a8559d8609 (diff)
parent8cb5b4d61fcdaa1fa97a8ba2c198d5375a80bc5a (diff)
Merge branch 'scripts' into SLE11-SP3rpm-3.0.51-0.10
-rwxr-xr-xscripts/stable-tar.pl22
-rwxr-xr-xscripts/tar-up-old.sh3
-rwxr-xr-xscripts/tar-up.sh3
3 files changed, 24 insertions, 4 deletions
diff --git a/scripts/stable-tar.pl b/scripts/stable-tar.pl
index 3944445a8e..129646d74c 100755
--- a/scripts/stable-tar.pl
+++ b/scripts/stable-tar.pl
@@ -36,19 +36,37 @@ use Fcntl ':mode';
my $mtime;
my $disable_paxheaders;
my $chdir;
+my $files_from;
my @exclude = ();
GetOptions(
"t|mtime=i" => \$mtime,
"exclude=s" => \@exclude,
"no-paxheaders" => \$disable_paxheaders,
"C=s" => \$chdir,
+ "T|files-from=s" => \$files_from,
) or die($USAGE);
-die $USAGE unless @ARGV;
if (!defined($mtime)) {
warn "$0: --mtime not specified, using 2000-01-01\n";
$mtime = 946681200;
}
+my @args;
+if ($files_from) {
+ if ($files_from eq '-') {
+ @args = <>;
+ } else {
+ open(my $fh, '<', $files_from) or die "$files_from: $!\n";
+ @args = <$fh>;
+ close($fh);
+ }
+ chomp(@args);
+} else {
+ @args = @ARGV;
+}
+if (!@args) {
+ print STDERR "No arguments given\n";
+ die($USAGE);
+}
chdir($chdir) if $chdir;
my @files;
@@ -64,7 +82,7 @@ sub wanted {
push(@files, $File::Find::name);
}
-for my $file (@ARGV) {
+for my $file (@args) {
if (-d $file) {
find(\&wanted, $file);
} else {
diff --git a/scripts/tar-up-old.sh b/scripts/tar-up-old.sh
index 8c6bfadd04..39f272f86f 100755
--- a/scripts/tar-up-old.sh
+++ b/scripts/tar-up-old.sh
@@ -525,7 +525,8 @@ stable_tar() {
SUSE:SLE-9*)
tar_opts=("${tar_opts[@]}" --no-paxheaders)
esac
- scripts/stable-tar.pl "${tar_opts[@]}" "$@" >"${tarball%.bz2}" || exit
+ printf '%s\n' "$@" | \
+ scripts/stable-tar.pl "${tar_opts[@]}" -T - >"${tarball%.bz2}" || exit
bzip2 -9 "${tarball%.bz2}" || exit
}
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index 475310c372..07f155eb8b 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -271,7 +271,8 @@ stable_tar() {
if test -n "$mtime"; then
tar_opts=("${tar_opts[@]}" --mtime "$mtime")
fi
- scripts/stable-tar.pl "${tar_opts[@]}" "$@" >"${tarball%.bz2}" || exit
+ printf '%s\n' "$@" | \
+ scripts/stable-tar.pl "${tar_opts[@]}" -T - >"${tarball%.bz2}" || exit
bzip2 -9 "${tarball%.bz2}" || exit
}