diff --git a/srcpkgs/xbps/patches/0003-xbps-create-set-root-root-if-e-gu-id-st.st_e-gu-id-i.patch b/srcpkgs/xbps/patches/0003-xbps-create-set-root-root-if-e-gu-id-st.st_e-gu-id-i.patch new file mode 100644 index 00000000000..64a4d9bcd9e --- /dev/null +++ b/srcpkgs/xbps/patches/0003-xbps-create-set-root-root-if-e-gu-id-st.st_e-gu-id-i.patch @@ -0,0 +1,32 @@ +From 7491c0e5847b5b4ccca5369442ae394e34ed6cb1 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Fri, 15 Mar 2013 09:31:15 +0100 +Subject: [PATCH] xbps-create: set root:root if e[gu]id == st.st_e[gu]id in + package files. + +The rational is that packages should have proper perms to be installed +globally in a system as root, and fakeroot is useless when generating +packages with xbps-create when it's statically build. +--- + NEWS | 4 ++++ + bin/xbps-create/main.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c +index 913f63b..fad76fd 100644 +--- bin/xbps-create/main.c ++++ bin/xbps-create/main.c +@@ -431,6 +431,10 @@ process_entry_file(struct archive *ar, + archive_entry_set_pathname(entry, xe->file); + archive_entry_copy_stat(entry, &st); + archive_entry_copy_sourcepath(entry, p); ++ if (st.st_uid == geteuid()) ++ archive_entry_set_uname(entry, "root"); ++ if (st.st_gid == getegid()) ++ archive_entry_set_gname(entry, "root"); + + if (S_ISLNK(st.st_mode)) { + len = readlink(p, buf, sizeof(buf)); +-- +1.8.1.3 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 550e8583dc7..67a741db380 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.21 -revision=3 +revision=4 build_style=configure configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin --enable-static --enable-debug --enable-tests"