[pacman-dev] [PATCH] makepkg: warn about repackaging without a package function

Allan McRae allan at archlinux.org
Wed Apr 14 02:29:19 EDT 2010

File permissions are not guaranteed to stay the same on exit from fakeroot,
so repackaging may result in files with different permissions. This is
avioded when using a package() function (or split packages) as the
packaging step is rerun.

Signed-off-by: Allan McRae <allan at archlinux.org>

Two areas to comment on:

1) "makepkg -R --asroot" does not give this warning.  This is because it is
assumed that the initial packaging stage was also done as root and so file
permissions will be correct.  Is that a fair assumption?

2) Should we depricate repackaging without a package function in pacman-3.5?
Using a package function was supported in 3.3 and using only a package
function (no build function) will be supported in 3.4.  If that is reasonable,
I will alter the warning and add it to the --asroot case too.

 scripts/makepkg.sh.in |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b2b449c..09a99e1 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1847,9 +1847,14 @@ fi
 if (( INFAKEROOT )); then
 	if (( ! SPLITPKG )); then
 		if (( ! PKGFUNC )); then
-			if (( BUILDFUNC && ! REPKG )); then
-				run_build
-				tidy_install
+			if (( ! REPKG )); then
+				if (( BUILDFUNC )); then
+					run_build
+					tidy_install
+				fi
+			else
+				warning "$(gettext "Repackaging without the use of a package() function may not")"
+				plain "$(gettext "preserve file permissions.")"

More information about the pacman-dev mailing list