chiark / gitweb /
Merge branch 'stable' into HEAD base.pbuilder-config
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 20:40:29 +0000 (21:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 20:40:29 +0000 (21:40 +0100)
debian/changelog
dgit
infra/dgit-repos-server
tests/lib
tests/pkg-srcs/example_1.1.orig.tar.gz [new file with mode: 0644]
tests/tests/import-dsc
tests/tests/unrepresentable
tests/worktrees/example_1.0.tar
tests/worktrees/example_1.1.tar [new symlink]

index 1d57cfa9e610ca1397866cdd0877b678599c27d0..5978c663a65e5630806fba3d6c7dd49f46320f06 100644 (file)
@@ -12,15 +12,40 @@ dgit (4.0) experimental; urgency=low
 
  -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Sun, 12 Feb 2017 22:22:31 +0000
 
-dgit (3.12~) unstable; urgency=medium
+dgit (3.12) unstable; urgency=high
 
   Important bugfixes to dgit:
   * Pass --no-renames to git diff-tree -z, avoiding potential trouble.
   * Defend against commit subject lines which would generate patches which
     look like series files, etc.  Involves adding .patch to all generated
     patch filenames.
+  * dgit import: Defend against broken symlinks in ..
+  * dgit import: Right error message for missing files in ..
+  * dgit import: Avoid making broken symlinks in ..
+  * quilt fixup: Tolerate deletion of executable files.
+  * quilt fixup: Tolerate symlink creation (make patches).  Closes:#857382.
 
- --
+  Important bugfixes to other components:
+  * dgit-repos-server: Do not reject commits with no author/committer
+    email address (but still insist on date, and hence on the actual
+    committer and author commit header fields).  Peter Green reports that
+    eg 66c65d90db100435 in upstream linux.git is such a commit (and is
+    accepted by github).  Closes:#863353.
+
+  Test suite:
+  * t-report-fail: print $PWD as part of failure message.
+  * import-dsc: Test missing files, particularly in ..
+  * run git gc on tests/worktrees/example_1.0.tar.
+  * quilt fixup: Check we can delete files with funny modes
+  * quilt fixup: Check that funny changes are represented properly
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Sun, 16 Jul 2017 21:36:24 +0100
+
+dgit (3.11~deb9u1) stretch; urgency=high
+
+  * Rebuild and upload to stretch.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Tue, 11 Jul 2017 09:28:15 +0100
 
 dgit (3.11) unstable; urgency=high
 
diff --git a/dgit b/dgit
index b8d6826928af835898ef5ea85a032ce7682a4758..9c7ec734e9f52c4371a31e817a3a392981c0f399 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4911,16 +4911,23 @@ sub quiltify_trees_differ ($$;$$$) {
 
        if ($unrepres) {
            eval {
-               die "not a plain file\n"
-                   unless $newmode =~ m/^10\d{4}$/ ||
-                          $oldmode =~ m/^10\d{4}$/;
+               die "not a plain file or symlink\n"
+                   unless $newmode =~ m/^(?:10|12)\d{4}$/ ||
+                          $oldmode =~ m/^(?:10|12)\d{4}$/;
                if ($oldmode =~ m/[^0]/ &&
                    $newmode =~ m/[^0]/) {
-                   die "mode changed\n" if $oldmode ne $newmode;
+                   # both old and new files exist
+                   die "mode or type changed\n" if $oldmode ne $newmode;
+                   die "modified symlink\n" unless $newmode =~ m/^10/;
+               } elsif ($oldmode =~ m/[^0]/) {
+                   # deletion
+                   die "deletion of symlink\n"
+                       unless $oldmode =~ m/^10/;
                } else {
-                   die "non-default mode\n"
-                       unless $newmode =~ m/^100644$/ ||
-                              $oldmode =~ m/^100644$/;
+                   # creation
+                   die "creation with non-default mode\n"
+                       unless $newmode =~ m/^100644$/ or
+                              $newmode =~ m/^120000$/;
                }
            };
            if ($@) {
@@ -6350,7 +6357,10 @@ END
     foreach my $fi (@dfi) {
        my $f = $fi->{Filename};
        my $here = "../$f";
-       next if lstat $here;
+       if (lstat $here) {
+           next if stat $here;
+           fail "lstat $here works but stat gives $! !";
+       }
        fail "stat $here: $!" unless $! == ENOENT;
        my $there = $dscfn;
        if ($dscfn =~ m#^(?:\./+)?\.\./+#) {
@@ -6361,8 +6371,10 @@ END
            fail "cannot import $dscfn which seems to be inside working tree!";
        }
        $there =~ s#/+[^/]+$## or
-           fail "cannot import $dscfn which seems to not have a basename";
+           fail "import $dscfn requires ../$f, but it does not exist";
        $there .= "/$f";
+       my $test = $there =~ m{^/} ? $there : "../$there";
+       stat $test or fail "import $dscfn requires $test, but: $!";
        symlink $there, $here or fail "symlink $there to $here: $!";
        progress "made symlink $here -> $there";
 #      print STDERR Dumper($fi);
index 55dc81fff1d16b09ca61413df3927574a0658f86..ec9b2c9ae186e8972a4c5bc216aadb2d199a2288 100755 (executable)
@@ -902,8 +902,8 @@ sub checks () {
 
     # defend against commits generated by #849041
     if (!($policy & NOCOMMITCHECK)) {
-       my @checks = qw(%ae %at
-                       %ce %ct);
+       my @checks = qw(%at
+                       %ct);
        my @chk = qw(git log -z);
        push @chk, '--pretty=tformat:%H%n'.
            (join "", map { $_, '%n' } @checks);
index e7ab334cc3daae7dc644ba5a8b9d8b1c94b768a2..3c04155a2ddbe398ba480030186b1ab8add23186 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -12,6 +12,7 @@ t-report-failure () {
        rc=$1
        cat <<END >&2
 TEST FAILED
+cwd: $PWD
 funcs: ${FUNCNAME[*]}
 lines: ${BASH_LINENO[*]}
 files: ${BASH_SOURCE[*]}
diff --git a/tests/pkg-srcs/example_1.1.orig.tar.gz b/tests/pkg-srcs/example_1.1.orig.tar.gz
new file mode 100644 (file)
index 0000000..d975490
Binary files /dev/null and b/tests/pkg-srcs/example_1.1.orig.tar.gz differ
index 073ba7be50409b7f63453d0ae92f59ea14e8d153..bdd849ca1060e75d8fcff9aac988d5ea94b7a4a0 100755 (executable)
@@ -72,6 +72,28 @@ git init
 
 check-import $troot/pkg-srcs 1.0-1
 
+cd ..
+v=1.0-1+absurd
+rm -f ${p}_*
+dsc=$troot/pkg-srcs/${p}_${v}.dsc
+cd $p.2
+
+cp $dsc ..
+t-expect-fail 'it does not exist' \
+check-import .. $v
+
+mkdir ../enoents
+cp $dsc ../enoents
+t-expect-fail 'No such file or directory' \
+check-import ../enoents $v
+
+cd ..
+rm -f ${p}_${v}.dsc
+dget -du file://$dsc
+cd $p.2
+
+check-import .. $v
+
 t-expect-fail "Your git tree does not have that object" \
 check-import ../mirror/pool/main 1.2 --no-chase-dsc-distro
 
index 0d02c6aac9dc6c0cd30439a8539d2e75385f20b3..e4b0da85a4e2fcb5c686697687ef210640ba063b 100755 (executable)
@@ -4,14 +4,19 @@ set -e
 
 t-tstunt-parsechangelog
 
-t-prep-newpackage example 1.0
+t-prep-newpackage example 1.1
 
 ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
 
 cd $p
 
-start () { git checkout quilt-tip~0; }
+start () { git checkout quilt-tip-1.1~0; }
 attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }
+good () {
+       attempt
+       t-dgit --quilt=nofix -wgf build-source
+       t-dgit -wgf --dry-run push --new
+}
 
 badly-1 () {
        wrongfn=$1
@@ -25,28 +30,38 @@ badly-2 () {
        attempt
 }
 
-badly-1 symlink 'not a plain file'
-       ln -s TARGET symlink
-       git add symlink
+badly-1 orig-symlink 'modified symlink'
+       ln -sf NEWTARGET orig-symlink
+       git add orig-symlink
+badly-2
+
+badly-1 orig-symlink 'deletion of symlink'
+       git rm -f orig-symlink
 badly-2
 
 start
        git rm src.c
        git commit -m deleted
-attempt
+good
+
+start
+       git rm orig-exec
+       git rm -f orig-unwriteable
+       git commit -m 'deleted funny'
+good
 
-badly-1 src.c 'mode changed'
+badly-1 src.c 'mode or type changed'
        chmod +x src.c
        git add src.c
 badly-2
 
-badly-1 new 'non-default mode'
+badly-1 new 'creation with non-default mode'
        echo hi >new
        chmod 755 new
        git add new
 badly-2
 
 start
-attempt
+good
 
 t-ok
index 50baa337ef70f869f9fab5b65f1481b296ba83ee..6f66a915eb6082dfb3d20b85727710cadc51ab3e 100644 (file)
Binary files a/tests/worktrees/example_1.0.tar and b/tests/worktrees/example_1.0.tar differ
diff --git a/tests/worktrees/example_1.1.tar b/tests/worktrees/example_1.1.tar
new file mode 120000 (symlink)
index 0000000..6acd590
--- /dev/null
@@ -0,0 +1 @@
+example_1.0.tar
\ No newline at end of file