chiark / gitweb /
dgit: remove_stray_gits: Print a slightly better message
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 7 Nov 2016 23:44:52 +0000 (23:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 7 Nov 2016 23:55:40 +0000 (23:55 +0000)
Change all call sites, and callers of mktree_in_ud_from_only_subdir.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index 41f2796cd6066c2bdafe7e3bb8a71b7d6e40a6e6..f7a6ee8bbb6b51308ee4a442fa297acf83e6ba26 100644 (file)
@@ -14,6 +14,7 @@ dgit (2.10~) unstable; urgency=medium
       origs <blah>.orig.tar.gz f.same=1 #f._differ=-1
   * Cope when an orig tarball is a tarbomb.  Ie, if it contains
     other than one single directory toplevel.  Closes:#843422.
+  * Print a slightly better message if .git found in orig tarball(s).
 
  --
 
diff --git a/dgit b/dgit
index 5867ee7b6b2dc845cb2247deb45269ded4b013e8..983f97c55b8ae3d4c002b07657107e363c508064 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1698,7 +1698,8 @@ sub git_add_write_tree () {
     return git_write_tree();
 }
 
-sub remove_stray_gits () {
+sub remove_stray_gits ($) {
+    my ($what) = @_;
     my @gitscmd = qw(find -name .git -prune -print0);
     debugcmd "|",@gitscmd;
     open GITS, "-|", @gitscmd or die $!;
@@ -1706,7 +1707,7 @@ sub remove_stray_gits () {
        local $/="\0";
        while (<GITS>) {
            chomp or die;
-           print STDERR "$us: warning: removing from source package: ",
+           print STDERR "$us: warning: removing from $what: ",
                (messagequote $_), "\n";
            rmtree $_;
        }
@@ -1714,8 +1715,8 @@ sub remove_stray_gits () {
     $!=0; $?=0; close GITS or failedcmd @gitscmd;
 }
 
-sub mktree_in_ud_from_only_subdir (;$) {
-    my ($raw) = @_;
+sub mktree_in_ud_from_only_subdir ($;$) {
+    my ($what,$raw) = @_;
 
     # changes into the subdir
     my (@dirs) = <*/.>;
@@ -1724,7 +1725,7 @@ sub mktree_in_ud_from_only_subdir (;$) {
     my $dir = $1;
     changedir $dir;
 
-    remove_stray_gits();
+    remove_stray_gits($what);
     mktree_in_ud_here();
     if (!$raw) {
        my ($format, $fopts) = get_source_format();
@@ -2150,7 +2151,7 @@ sub generate_commits_from_dsc () {
 
        runcmd qw(chmod -R +rwX _unpack-tar);
        changedir "_unpack-tar";
-       remove_stray_gits();
+       remove_stray_gits($f);
        mktree_in_ud_here();
        
        my ($tree) = git_add_write_tree();
@@ -2201,7 +2202,7 @@ sub generate_commits_from_dsc () {
     push @cmd, qw(-x --), $dscfn;
     runcmd @cmd;
 
-    my ($tree,$dir) = mktree_in_ud_from_only_subdir();
+    my ($tree,$dir) = mktree_in_ud_from_only_subdir("source package");
     if (madformat $dsc->{format}) { 
        check_for_vendor_patches();
     }
@@ -3879,7 +3880,7 @@ END
     progress "checking that $dscfn corresponds to HEAD";
     runcmd qw(dpkg-source -x --),
         $dscpath =~ m#^/# ? $dscpath : "../../../$dscpath";
-    my ($tree,$dir) = mktree_in_ud_from_only_subdir();
+    my ($tree,$dir) = mktree_in_ud_from_only_subdir("source package");
     check_for_vendor_patches() if madformat($dsc->{format});
     changedir '../../../..';
     my @diffcmd = (@git, qw(diff --quiet), $tree, $dgithead);
@@ -5203,7 +5204,7 @@ sub quilt_fixup_multipatch ($$$) {
 
     changedir 'fake';
 
-    remove_stray_gits();
+    remove_stray_gits("source package");
     mktree_in_ud_here();
 
     rmtree '.pc';