[Build-common-hackers] Bug#416018: consider using dh_testroot

Martin Koeppe mkoeppe at gmx.de
Sat Mar 24 02:45:59 UTC 2007


Package: cdbs
Version: 0.4.48
Severity: wishlist

To increase portability, I would like to suggest to use 'dh_testroot' 
instead of 'test "`id -u`" = 0'. cdbs currently only Recommends: 
debhelper, then it would probably Depends: on it. OTOH, how many 
packages are there which Build-Depends: cdbs, but not debhelper?
I really don't know. Is there a reverse Build-Depends: list anywhere?

Motivation is, that I needed to change the test for rootness for a 
special architecture (POSIX doesn't say that root has necessarily id 
0), and I would like to avoid doing that change twice.

Thanks for consideration

Martin
-------------- next part --------------
diff -Naur cdbs.orig/buildcore.mk.in cdbs/buildcore.mk.in
--- cdbs.orig/buildcore.mk.in	2006-10-26 12:57:53.000000000 +0200
+++ cdbs/buildcore.mk.in	2007-03-24 02:05:14.000000000 +0100
@@ -31,7 +31,7 @@
 	test -x debian/rules
 
 testroot:
-	test "`id -u`" = 0
+	dh_testroot
 
 $(patsubst %,makebuilddir/%,$(DEB_ALL_PACKAGES)) :: makebuilddir/% : 
 	$(if $(DEB_BUILDDIR_$(cdbs_curpkg)),mkdir -p "$(DEB_BUILDDIR_$(cdbs_curpkg))")


More information about the Build-common-hackers mailing list