chiark / gitweb /
changelog: start 9.14
[dgit.git] / tests / tstunt / Dpkg / Changelog / Parse.pm
index 677580bb048793e51d653398e40ae1247e268999..d69b7dfe247b9ee3a9280cf3e112f0534684d551 100644 (file)
@@ -1,6 +1,6 @@
 # -*- perl -*-
 #
-# Copyright (C) 2015       Ian Jackson
+# Copyright (C) 2015-2016  Ian Jackson
 #
 # Some bits stolen from the proper Dpkg::Changelog::Parse
 # (from dpkg-dev 1.16.16):
@@ -36,7 +36,22 @@ our @EXPORT = qw(changelog_parse);
 die +(join " ", %ENV)." ?" if $ENV{'DGIT_NO_TSTUNT_CLPARSE'};
 
 sub changelog_parse {
-    my (%options) = @_; # ignored
+    my (%options) = @_; # largely ignored
+
+#use Data::Dumper;
+#print STDERR "CLOG PARSE ", Dumper(\%options);
+#
+# We can't do this because lots of things use `since' which
+# we don't implement, and it's the test cases that arrange that
+# the since value happens to be such that we are to print one output.
+#
+#    foreach my $k (keys %options) {
+#      my $v = $options{$k};
+#      if ($k eq 'file') { }
+#      elsif ($k eq 'offset') { die "$v ?" unless $v <= 1; } # wtf, 1==0 ?
+#      elsif ($k eq 'count') { die "$v ?" unless $v == 1; }
+#      else { die "$k ?"; }
+#    }
 
     $options{'file'} //= 'debian/changelog';
 
@@ -45,6 +60,9 @@ sub changelog_parse {
     my $fields = Dpkg::Control::Changelog->new();
     $fields->parse(\*P, "output of stunt changelog parser");
 
+#use Data::Dumper;
+#print STDERR "PARSE $0 ", Dumper($fields);
+
     close P or die "$! $?";
 
     return $fields;