--- Begin Message ---
Package: cwebx
Severity: important
Tags: patch
cwebx failed to build on the raspbian jessie autobuilders with the
following error. The build was tried twice so I do not belive this was a
fluke.
make[1]: Entering directory '/«PKGBUILDDIR»'
test -s debian/cwebx/usr/bin || mkdir debian/cwebx/usr/bin
mkdir: cannot create directory 'debian/cwebx/usr/bin': File exists
Makefile:143: recipe for target 'install' failed
According to wikpedia test -s checks if a file exists and has a size
greater than 0. We use btrfs on our autobuilders for space-efficient
snapshotting. Doing some testing it seems btrfs reports a size of 0 for
empty directories. So on btrfs if the directory exists and is empty the
command will fail.
I believe the correct fix is to use -e instead of -s. I have tested this
on the raspbian jessie autobuilders and got a successful build.
debdiff attatched, no intent to NMU.
diff -Nru cwebx-3.52/debian/changelog cwebx-3.52/debian/changelog
--- cwebx-3.52/debian/changelog 2014-10-05 18:58:08.000000000 +0000
+++ cwebx-3.52/debian/changelog 2014-12-09 07:43:18.000000000 +0000
@@ -1,3 +1,9 @@
+cwebx (3.52-1+rpi1) jessie-staging; urgency=medium
+
+ * Use test -e instead of test -s to prevent build failing on BTRFS.
+
+ -- Peter Michael Green <plugwash@raspbian.org> Tue, 09 Dec 2014 07:42:51 +0000
+
cwebx (3.52-1) unstable; urgency=medium
* New upstream release
diff -Nru cwebx-3.52/debian/patches/02_fix-build-on-btrfs.diff cwebx-3.52/debian/patches/02_fix-build-on-btrfs.diff
--- cwebx-3.52/debian/patches/02_fix-build-on-btrfs.diff 1970-01-01 00:00:00.000000000 +0000
+++ cwebx-3.52/debian/patches/02_fix-build-on-btrfs.diff 2014-12-09 07:48:25.000000000 +0000
@@ -0,0 +1,31 @@
+Description: Use test -e instead of test -s to prevent build failing on BTRFS.
+ Btrfs reports a size of 0 for empty directories. Test -s not only checks
+ if a file exists but also if it it's size is nonzero. This causes the makefile
+ to try and create a directory that already exists and fail. The fix is to use
+ -e instead.
+Author: Peter Michael Green <plugwash@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- cwebx-3.52.orig/Makefile
++++ cwebx-3.52/Makefile
+@@ -140,7 +140,7 @@ clean: mostlyclean
+ MACRODIR=$(prefix)/share/texmf/tex/plain/litprog
+
+ install: ctanglex cweavex
+- test -s $(prefix)/bin || mkdir $(prefix)/bin
++ test -e $(prefix)/bin || mkdir $(prefix)/bin
+ $(CP) ctanglex cweavex $(prefix)/bin
+ cp cweb?mac.tex $(MACRODIR)
+
diff -Nru cwebx-3.52/debian/patches/series cwebx-3.52/debian/patches/series
--- cwebx-3.52/debian/patches/series 2014-10-05 16:57:46.000000000 +0000
+++ cwebx-3.52/debian/patches/series 2014-12-09 07:45:42.000000000 +0000
@@ -1 +1,2 @@
01_x-ify_all_names.diff
+02_fix-build-on-btrfs.diff
--- End Message ---