On 2011-08-23 15:10 +0200, Raphael Hertzog wrote:

> On Mon, 22 Aug 2011, Sven Joachim wrote:
>> Thanks, this was very helpful indeed.  After reading that, the only
>> pitfall I fell in was that git does not preserve hardlinks, so I needed
>> to handle that in build-hook/clean-hook targets.
>
> Right, I just noticed/remembered that we have t-unpack-hardlink already...
> can you merge your test in that one?

Done in the attached patch.

> It already tests hardlinks on various type of files, you'd just add a
> test-conffile-link{0,1} and mark test-conffile-link{0,1} as conffiles.
>
>> The testcase in the attached patch slightly differs from the original
>> one in that the hardlink is not marked as a conffile itself.  This makes
>> no real difference when freshly installing the package, but on upgrades
>> the hardlink will be broken (since unchanged conffiles are not
>> replaced).
>
> Yes, that doesn't matter at all for the purpose of this test at least.

I've only made test-conffile-link0 a conffile and test-conffile-link1 a
hardlink to it.

Cheers,
       Sven

>From c29c961626eadbaa266b9073ebde7578dae31321 Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenj...@gmx.de>
Date: Tue, 23 Aug 2011 19:52:16 +0200
Subject: [PATCH] Add test for hardlink to a conffile to t-unpack-hardlink

See http://bugs.debian.org/638291 for details.
---
 t-unpack-hardlink/.gitignore                    |    1 +
 t-unpack-hardlink/Makefile                      |    8 +++++++-
 t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles |    1 +
 3 files changed, 9 insertions(+), 1 deletions(-)
 create mode 100644 t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles

diff --git a/t-unpack-hardlink/.gitignore b/t-unpack-hardlink/.gitignore
index 261cc47..dc93132 100644
--- a/t-unpack-hardlink/.gitignore
+++ b/t-unpack-hardlink/.gitignore
@@ -1,3 +1,4 @@
+test-conffile-link*
 test-file-link*
 test-fifo-link*
 test-null-link*
diff --git a/t-unpack-hardlink/Makefile b/t-unpack-hardlink/Makefile
index 0db7d3f..ebd2165 100644
--- a/t-unpack-hardlink/Makefile
+++ b/t-unpack-hardlink/Makefile
@@ -4,6 +4,10 @@ TESTS_DEB := $(PKG)
 
 include ../Test.mk
 
+$(PKG)/test-conffile-link0:
+       echo "test hard linked conffile" >$@
+       link $@ $(PKG)/test-conffile-link1
+
 $(PKG)/test-file-link0:
        echo "test hard linked file" >$@
        link $@ $(PKG)/test-file-link1
@@ -20,10 +24,12 @@ $(PKG)/test-ram0-link0:
        $(BEROOT) mknod $@ b 1 0
        link $@ $(PKG)/test-ram0-link1
 
-build-hook: $(PKG)/test-file-link0 $(PKG)/test-fifo-link0 \
+build-hook: $(PKG)/test-conffile-link0 \
+            $(PKG)/test-file-link0 $(PKG)/test-fifo-link0 \
             $(PKG)/test-null-link0 $(PKG)/test-ram0-link0
 
 clean-hook:
+       rm -f $(PKG)/test-conffile-link0 $(PKG)/test-conffile-link1
        rm -f $(PKG)/test-file-link0 $(PKG)/test-file-link1
        rm -f $(PKG)/test-fifo-link0 $(PKG)/test-fifo-link1
        rm -f $(PKG)/test-null-link0 $(PKG)/test-null-link1
diff --git a/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles 
b/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
new file mode 100644
index 0000000..bf5bf00
--- /dev/null
+++ b/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
@@ -0,0 +1 @@
+test-conffile-link0
-- 
1.7.5.4

Reply via email to