X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=19c0657b17eb6741edf3112c8fba0ed9ce9d76b5;hp=8d3addbb3be91082514a3e8a5f33765f5e732020;hb=fd8f387167425d0c9da7bce0ffc460a57d0ceced;hpb=8359fd512497cc33029f6f3c696e331a844229ab;ds=sidebyside diff --git a/dgit b/dgit index 8d3addbb..19c0657b 100755 --- a/dgit +++ b/dgit @@ -1145,6 +1145,69 @@ sub clogp_authline ($) { return $authline; } +sub vendor_patches_distro ($$) { + my ($checkdistro, $what) = @_; + return unless defined $checkdistro; + + my $series = "debian/patches/\L$checkdistro\E.series"; + printdebug "checking for vendor-specific $series ($what)\n"; + + if (!open SERIES, "<", $series) { + die "$series $!" unless $!==ENOENT; + return; + } + while () { + next unless m/\S/; + next if m/^\s+\#/; + + print STDERR <error; + close SERIES; +} + +sub check_for_vendor_patches () { + # This dpkg-source feature doesn't seem to be documented anywhere! + # But it can be found in the changelog (reformatted): + + # commit 4fa01b70df1dc4458daee306cfa1f987b69da58c + # Author: Raphael Hertzog + # Date: Sun Oct 3 09:36:48 2010 +0200 + + # dpkg-source: correctly create .pc/.quilt_series with alternate + # series files + # + # If you have debian/patches/ubuntu.series and you were + # unpacking the source package on ubuntu, quilt was still + # directed to debian/patches/series instead of + # debian/patches/ubuntu.series. + # + # debian/changelog | 3 +++ + # scripts/Dpkg/Source/Package/V3/quilt.pm | 4 +++- + # 2 files changed, 6 insertions(+), 1 deletion(-) + + use Dpkg::Vendor; + vendor_patches_distro($ENV{DEB_VENDOR}, "DEB_VENDOR"); + vendor_patches_distro(Dpkg::Vendor::get_current_vendor(), + "Dpkg::Vendor \`current vendor'"); + vendor_patches_distro(access_basedistro(), + "distro being accessed"); +} + sub generate_commit_from_dsc () { prep_ud(); changedir $ud; @@ -1177,6 +1240,7 @@ sub generate_commit_from_dsc () { runcmd @cmd; my ($tree,$dir) = mktree_in_ud_from_only_subdir(); + check_for_vendor_patches() if madformat($dsc->{format}); runcmd qw(sh -ec), 'dpkg-parsechangelog >../changelog.tmp'; my $clogp = parsecontrol('../changelog.tmp',"commit's changelog"); my $authline = clogp_authline $clogp; @@ -1632,6 +1696,7 @@ sub dopush ($) { runcmd qw(dpkg-source -x --), $dscpath =~ m#^/# ? $dscpath : "../../../$dscpath"; my ($tree,$dir) = mktree_in_ud_from_only_subdir(); + check_for_vendor_patches() if madformat($dsc->{format}); changedir '../../../..'; my $diffopt = $debuglevel>0 ? '--exit-code' : '--quiet'; my @diffcmd = (@git, qw(diff), $diffopt, $tree); @@ -2354,6 +2419,8 @@ sub build_maybe_quilt_fixup () { return unless madformat $format; # sigh + check_for_vendor_patches(); + # Our objective is: # - honour any existing .pc in case it has any strangeness # - determine the git commit corresponding to the tip of