[SCM] Git repository for devscripts branch, master, updated. v2.12.4-109-gb4107ba
Christoph Berg
myon at debian.org
Tue Dec 4 16:30:57 UTC 2012
The following commit has been merged in the master branch:
commit b4107bacd14ce62c240697700e32e1f12594c81c
Author: Christoph Berg <myon at debian.org>
Date: Tue Dec 4 17:30:18 2012 +0100
origtargz: Add --clean option, and update related --unpack documentation.
diff --git a/scripts/origtargz.pl b/scripts/origtargz.pl
index 35d6546..4cd4c3f 100755
--- a/scripts/origtargz.pl
+++ b/scripts/origtargz.pl
@@ -92,7 +92,9 @@ When found, a hardlink is created if possible, otherwise a symlink.
=item B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]
Unpack the downloaded orig tarball to the current directory, replacing
-everything except the debian directory. Valid choices are:
+everything except the debian directory. Existing files are removed, except for
+F<debian/> and VCS files. Preserved are: F<.bzr>, F<.bzrignore>,
+F<.bzr-builddeb>, F<.git>, F<.gitignore>, F<.hg>, F<.hgignore>, and F<.svn>.
=over
@@ -107,9 +109,7 @@ dotfiles), unpack the orig tarball. This is the default behavior.
=item B<yes> (default for B<--unpack> without argument)
-Always unpack the orig tarball. Existing files are removed, except for F<debian/>
-and VCS files. Preserved are: F<.bzr>, F<.bzrignore>, F<.bzr-builddeb>, F<.git>,
-F<.gitignore>, F<.hg>, F<.hgignore>, and F<.svn>.
+Always unpack the orig tarball.
=back
@@ -124,6 +124,11 @@ download the full source package including F<.dsc> and F<.diff.gz> or
F<.debian.tar.gz> components so B<debdiff> can be used to diff the last upload
to the next one. With B<--tar-only>, only download the F<.orig.tar.*> file.
+=item B<--clean>
+
+Remove existing files as with B<--unpack>. Note that like B<--unpack>, this
+will remove upstream files even if they are stored in VCS.
+
=back
=cut
@@ -158,6 +163,7 @@ use Pod::Usage;
my @dirs = ();
my $tar_only = 0;
my $unpack = 'once'; # default when --unpack is not used
+my $clean = 0;
GetOptions(
"path|p=s" => \@dirs,
@@ -165,6 +171,7 @@ GetOptions(
"help|h" => sub { pod2usage({-exitval => 0, -verbose => 1}); },
"tar-only|t" => \$tar_only,
"unpack|u:s" => \$unpack,
+ "clean" => \$clean,
) or pod2usage({-exitval => 3});
$unpack = 'yes' if (defined $unpack and $unpack eq ''); # default for --unpack without argument
@@ -190,6 +197,8 @@ $origversion =~ s/(.*)-.*/$1/; # strip everything from the last dash
$fileversion = $origversion;
$fileversion =~ s/^\d+://; # strip epoch
+# functions
+
sub download_origtar ()
{
# look for an existing file
@@ -343,6 +352,13 @@ sub unpack_tarball ($)
return 1;
}
+# main
+
+if ($clean) {
+ clean_checkout;
+ exit 0;
+}
+
my $origtar = download_origtar;
exit 1 unless ($origtar);
--
Git repository for devscripts
More information about the devscripts-devel
mailing list