From bc130649687662aa517dbf599b78299937c5efd0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Nov 2016 23:44:52 +0000 Subject: [PATCH] dgit: remove_stray_gits: Print a slightly better message Change all call sites, and callers of mktree_in_ud_from_only_subdir. Signed-off-by: Ian Jackson --- debian/changelog | 1 + dgit | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 41f2796c..f7a6ee8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ dgit (2.10~) unstable; urgency=medium origs .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 5867ee7b..983f97c5 100755 --- 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 () { 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'; -- 2.30.2