summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-07-16 21:40:29 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-07-16 21:40:29 +0100
commit4d5ef701bf95a1c60a5cc1b9f5c4d771ac49375a (patch)
treeb84199fcd94bd4c2700c995c3ec093d113a77284
parent18413810f983efbd083a2fd0cbc2c2cbbadc558b (diff)
parenta80f7d09b0f92b5e1bc39f828f7972f3ff7c41be (diff)
Merge branch 'stable' into HEAD
-rw-r--r--debian/changelog29
-rwxr-xr-xdgit30
-rwxr-xr-xinfra/dgit-repos-server4
-rw-r--r--tests/lib1
-rw-r--r--tests/pkg-srcs/example_1.1.orig.tar.gzbin0 -> 404 bytes
-rwxr-xr-xtests/tests/import-dsc22
-rwxr-xr-xtests/tests/unrepresentable33
-rw-r--r--tests/worktrees/example_1.0.tarbin122880 -> 71680 bytes
l---------tests/worktrees/example_1.1.tar1
9 files changed, 98 insertions, 22 deletions
diff --git a/debian/changelog b/debian/changelog
index 1d57cfa..5978c66 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 b8d6826..9c7ec73 100755
--- 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);
diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server
index 55dc81f..ec9b2c9 100755
--- a/infra/dgit-repos-server
+++ b/infra/dgit-repos-server
@@ -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);
diff --git a/tests/lib b/tests/lib
index e7ab334..3c04155 100644
--- 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
index 0000000..d975490
--- /dev/null
+++ b/tests/pkg-srcs/example_1.1.orig.tar.gz
Binary files differ
diff --git a/tests/tests/import-dsc b/tests/tests/import-dsc
index 073ba7b..bdd849c 100755
--- a/tests/tests/import-dsc
+++ b/tests/tests/import-dsc
@@ -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
diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable
index 0d02c6a..e4b0da8 100755
--- a/tests/tests/unrepresentable
+++ b/tests/tests/unrepresentable
@@ -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
diff --git a/tests/worktrees/example_1.0.tar b/tests/worktrees/example_1.0.tar
index 50baa33..6f66a91 100644
--- a/tests/worktrees/example_1.0.tar
+++ b/tests/worktrees/example_1.0.tar
Binary files differ
diff --git a/tests/worktrees/example_1.1.tar b/tests/worktrees/example_1.1.tar
new file mode 120000
index 0000000..6acd590
--- /dev/null
+++ b/tests/worktrees/example_1.1.tar
@@ -0,0 +1 @@
+example_1.0.tar \ No newline at end of file