chiark / gitweb /
dgit import: Right error message for missing files in ..
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Jul 2017 22:21:13 +0000 (23:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Jul 2017 22:21:14 +0000 (23:21 +0100)
Close examination of this code path reveals that:
 * The error is generated only if $there contains no slash.
 * This can only occur if $dscfn matches the first regexp,
   ie $dscfn is [./]../X in which case $there becomes X
 * So in this situation, $there is simply the dsc filename
   which is supposed to be in ..
 * What we should be testing is ../$f but that is $here
   which is what are trying to create and which we statted
   earlier and got ENOENT for.

So this occurs when the dsc is in .. and a file it refers to is
missing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index 784269c1721cdadaa89dfc7fd205472cc50ee4e8..eeaeb1ff9d3c98d440d7edcdf4f2da3cef099214 100644 (file)
@@ -6,6 +6,7 @@ dgit (3.12~) unstable; urgency=medium
     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 ..
 
  --
 
diff --git a/dgit b/dgit
index a68bf19c943502d3f039440caa29368ab2a388d9..944de8592418be52f5fae781bdf2447a4439f418 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6363,7 +6363,7 @@ 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";
        symlink $there, $here or fail "symlink $there to $here: $!";
        progress "made symlink $here -> $there";