chiark / gitweb /
dgit: Transfer origs from .. to bpd when building
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 16:30:13 +0000 (16:30 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 16:30:13 +0000 (16:30 +0000)
This is apropos of #904878.

When building we need to consider anything in .. that would
be (accordingg to its filename) a possible orig for the package we are
building, since we do not know what origs there are supposed to be,
and missing ones generate unhelpful error messages.

We `copy' things from .. to bpd, rather than just trying to use them
directly from .., because otherwise lots of other things won't work
right.  For example, we might generate .dsc's in the bpd which expect
the files alongside, but without the files.

But we don't actually copy any files.  We prefer to:
 * If the thing in .. is a symlink, copy the link text, adjusting
   it into an absolute link.
 * If the thing in .. is a file, try to hardlink it, or failing
   that make a symlink to it.

The result is that we never duplicate the file contents, but still,
where possible, we prefer to make the thing in bpd stand alone so that
if the `copy' in .. is deleted everything is still fine.

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

diff --git a/dgit b/dgit
index 21a3f287508062aaaa03464ad887836402736e11..e57f3ea9cfded0b0584554247d67553d7370e596 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -5852,6 +5852,9 @@ sub unpack_playtree_linkorigs ($$) {
     # calls $fn->($leafname);
 
     my $bpd_abs = bpd_abs();
+
+    dotdot_bpd_transfer_origs $bpd_abs, $upstreamversion, sub { 1 };
+
     opendir QFD, $bpd_abs or fail "buildproductsdir: $bpd_abs: $!";
     while ($!=0, defined(my $leaf = readdir QFD)) {
        my $f = bpd_abs()."/".$leaf;