summaryrefslogtreecommitdiff
path: root/pristine-gz
diff options
context:
space:
mode:
authorjoeyh <joeyh@19660600-52fe-0310-9875-adc0d7a7b53c>2007-10-02 20:57:19 +0000
committerjoeyh <joeyh@19660600-52fe-0310-9875-adc0d7a7b53c>2007-10-02 20:57:19 +0000
commita3fa0571bd97defe79a57c30750821d84aafd623 (patch)
tree7817b7252e7e6e176e1c92c0095075c44f8c292f /pristine-gz
parent4a0a823d111d1868f4add3e6a2f52a0afd24e3b4 (diff)
downloadpristine-tar-a3fa0571bd97defe79a57c30750821d84aafd623.tar.gz
pristine-tar-a3fa0571bd97defe79a57c30750821d84aafd623.tar.bz2
pristine-tar-a3fa0571bd97defe79a57c30750821d84aafd623.zip
implement --keep flag
Diffstat (limited to 'pristine-gz')
-rwxr-xr-xpristine-gz21
1 files changed, 15 insertions, 6 deletions
diff --git a/pristine-gz b/pristine-gz
index 96316a7..757f236 100755
--- a/pristine-gz
+++ b/pristine-gz
@@ -6,8 +6,8 @@ pristine-gz - regenerate pristine gz files
=head1 SYNOPSIS
-B<pristine-gz> [-vd] gengz delta file
-B<pristine-gz> [-vd] gendelta file.gz delta
+B<pristine-gz> [-vdk] gengz delta file
+B<pristine-gz> [-vdk] gendelta file.gz delta
=head1 DESCRIPTION
@@ -48,6 +48,10 @@ Verbose mode, show each command that is run.
Debug mode.
+=item -k
+
+Don't clean up the temporary directory on exit.
+
=head1 AUTHOR
Joey Hess <joeyh@debian.org>,
@@ -108,10 +112,11 @@ use constant {
my $verbose=0;
my $debug=0;
+my $keep=0;
sub usage {
- print STDERR "Usage: pristine-gz [-v] gengz delta file\n";
- print STDERR " pristine-gz [-v] gendelta file.gz delta\n";
+ print STDERR "Usage: pristine-gz [-vdk] gengz delta file\n";
+ print STDERR " pristine-gz [-vdk] gendelta file.gz delta\n";
}
sub debug {
@@ -131,7 +136,7 @@ sub doit {
sub tempdir {
return File::Temp::tempdir("pristine-gz.XXXXXXXXXX",
- TMPDIR => 1, CLEANUP => 1);
+ TMPDIR => 1, CLEANUP => !$keep);
}
sub readgzip {
@@ -387,7 +392,11 @@ sub gendelta {
}
Getopt::Long::Configure("bundling");
-if (! GetOptions("v|verbose!" => \$verbose, "d|debug!" => \$debug) || @ARGV != 3) {
+if (! GetOptions(
+ "v|verbose!" => \$verbose,
+ "d|debug!" => \$debug,
+ "k|keep!" => \$keep,
+ ) || @ARGV != 3) {
usage();
exit 1;
}