X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=dbb23f39deeb6397b595b09f2b40fda814d123a5;hp=777532ebf2bf7d8caa0a6999a66d4ea5066454a2;hb=32a64c4b2ca401cd594c38ceaa01a2bdfc56f8eb;hpb=e59fb2f70123dc40f515f60d707c4f99653d6d07 diff --git a/dgit b/dgit index 777532eb..dbb23f39 100755 --- a/dgit +++ b/dgit @@ -100,9 +100,6 @@ our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)"); our $suite_re = '[-+.0-9a-z]+'; our $cleanmode_re = 'dpkg-source(?:-d)?|git|git-ff|check|none'; -our $orig_f_comp_re = qr{orig(?:-$extra_orig_namepart_re)?}; -our $orig_f_sig_re = '\\.(?:asc|gpg|pgp)'; -our $orig_f_tail_re = "$orig_f_comp_re\\.tar(?:\\.\\w+)?(?:$orig_f_sig_re)?"; our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$'; our $splitbraincache = 'dgit-intern/quilt-cache'; @@ -201,15 +198,13 @@ sub lref () { return "refs/heads/".lbranch(); } sub lrref () { return "refs/remotes/$remotename/".server_branch($csuite); } sub rrref () { return server_ref($csuite); } -sub stripepoch ($) { - my ($vsn) = @_; - $vsn =~ s/^\d+\://; - return $vsn; -} - sub srcfn ($$) { - my ($vsn,$sfx) = @_; - return "${package}_".(stripepoch $vsn).$sfx + my ($vsn, $sfx) = @_; + return &source_file_leafname($package, $vsn, $sfx); +} +sub is_orig_file_of_vsn ($$) { + my ($f, $upstreamvsn) = @_; + return is_orig_file_of_p_v($f, $package, $upstreamvsn); } sub dscfn ($) { @@ -222,12 +217,6 @@ sub changespat ($;$) { return "${package}_".(stripepoch $vsn)."_".($arch//'*').".changes"; } -sub upstreamversion ($) { - my ($vsn) = @_; - $vsn =~ s/-[^-]+$//; - return $vsn; -} - our $us = 'dgit'; initdebug(''); @@ -1089,7 +1078,7 @@ sub canonicalise_suite_ftpmasterapi { } qw(codename name); push @matched, $entry; } - fail "unknown suite $isuite" unless @matched; + fail "unknown suite $isuite, maybe -d would help" unless @matched; my $cn; eval { @matched==1 or die "multiple matches for suite $isuite\n"; @@ -1867,13 +1856,6 @@ sub is_orig_file_in_dsc ($$) { return 1; } -sub is_orig_file_of_vsn ($$) { - my ($f, $upstreamvsn) = @_; - my $base = srcfn $upstreamvsn, ''; - return 0 unless $f =~ m/^\Q$base\E\.$orig_f_tail_re$/; - return 1; -} - # This function determines whether a .changes file is source-only from # the point of view of dak. Thus, it permits *_source.buildinfo # files. @@ -6558,6 +6540,24 @@ sub cmd_quilt_fixup { build_maybe_quilt_fixup(); } +sub cmd_print_unapplied_treeish { + badusage "incorrect arguments to dgit print-unapplied-treeish" if @ARGV; + my $headref = git_rev_parse('HEAD'); + my $clogp = commit_getclogp $headref; + $package = getfield $clogp, 'Source'; + $version = getfield $clogp, 'Version'; + $isuite = getfield $clogp, 'Distribution'; + $csuite = $isuite; # we want this to be offline! + notpushing(); + + prep_ud(); + changedir $playground; + my $uv = upstreamversion $version; + quilt_make_fake_dsc($uv); + my $u = quilt_fakedsc2unapplied($headref, $uv); + print $u, "\n" or die $!; +} + sub import_dsc_result { my ($dstref, $newhash, $what_log, $what_msg) = @_; my @cmd = (git_update_ref_cmd $what_log, $dstref, $newhash);