'pristine-tar list' displays a list of tarballs that are available for checkout.
authorJoey Hess <joey@kitenet.net>
Sun, 18 Sep 2011 02:03:31 +0000 (22:03 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 18 Sep 2011 02:03:31 +0000 (22:03 -0400)
debian/changelog
pristine-tar

index 543f0aa..80bc8d1 100644 (file)
@@ -2,6 +2,8 @@ pristine-tar (1.15) UNRELEASED; urgency=low
 
   * Fix Vcs-Browser url. Closes: #636926
   * Propigate nonzero exit status from doit_redir. Closes: #600724
+  * 'pristine-tar list' displays a list of tarballs that are available for
+    checkout.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 07 Aug 2011 08:53:21 -0400
 
index 78a366e..67a5bd2 100755 (executable)
@@ -14,6 +14,8 @@ B<pristine-tar> [-vdk] [-m message] commit I<tarball> [I<upstream>]
 
 B<pristine-tar> [-vdk] checkout I<tarball>
 
+B<pristine-tar> [-vdk] list
+
 =head1 DESCRIPTION
 
 pristine-tar can regenerate an exact copy of a pristine upstream tarball
@@ -72,6 +74,11 @@ branch is created or updated as needed to add each new delta.
 This regenerates a copy of the specified I<tarball> using information
 previously saved in version control by B<pristine-tar commit>.
 
+=item pristine-tar list
+
+This lists tarballs that pristine-tar is able to checkout from version
+control.
+
 =back
 
 =head1 OPTIONS
@@ -192,6 +199,7 @@ dispatch(
                ci => [\&commit, 1],
                checkout => [\&checkout, 1],
                co => [\&checkout, 1],
+               list => [\&list, 0],
        },
        options => {
                "m|message=s" => \$message,
@@ -759,3 +767,23 @@ sub checkout {
 
        message("successfully generated $tarball");
 }
+
+sub list {
+       my $branch="pristine-tar";
+       my $vcs=vcstype();
+       if ($vcs eq "git") {
+               my $b=git_findbranch($branch);
+               if (defined $b) {
+                       open (LIST, "git ls-tree $b --name-only |");
+                       while (<LIST>) {
+                               chomp;
+                               next unless s/\.delta$//;
+                               print $_."\n";
+                       }
+               }
+       else {
+               die "unsupported vcs $vcs";
+       }
+}
+
+}