[gnome-sdk-images] Support both xdg-app-helper and linux-user-chroot



commit bb578ef8f953793516f9ebd2d0ed7779582f49af
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Mar 24 13:02:30 2015 +0100

    Support both xdg-app-helper and linux-user-chroot

 build.sh |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/build.sh b/build.sh
index 006c27f..e8a47a3 100755
--- a/build.sh
+++ b/build.sh
@@ -6,7 +6,8 @@ ROOT=$BUILD/root
 VAR=$BUILD/var
 SRC=`pwd`/
 
-HELPER=`which linux-user-chroot`
+XDG_APP_HELPER=`which xdg-app-helper`
+LINUX_USER_CHROOT=`which linux-user-chroot`
 
 declare -x LC_ALL=en_US.utf8
 declare -x HOME=/self/packages
@@ -31,7 +32,14 @@ fi
 echo "builduser:x:`id  -u`:`id -u`:Build user:/self/packages:/sbin/nologin" >> $ROOT/usr/etc/passwd
 echo "builduser:x:`id  -g`:" >> $ROOT/usr/etc/group
 
-$HELPER --unshare-ipc --unshare-pid --unshare-net --mount-bind /dev /dev --mount-proc /proc --mount-bind 
$ROOT/usr /usr --mount-bind $VAR /var --mount-bind $SRC /self --chdir /self $CHROOT "$@"
+if "x${XDG_APP_HELPER}" != "x"; then
+    $XDG_APP_HELPER -w -W -E -a $SRC -v $VAR $ROOT/usr env PATH="$PATH" "$@"
+else
+    $LINUX_USER_CHROOT --unshare-ipc --unshare-pid --unshare-net --mount-bind /dev /dev --mount-proc /proc 
--mount-bind $ROOT/usr /usr --mount-bind $VAR /var --mount-bind $SRC /self --chdir /self $CHROOT "$@"
+else
+    echo "No containment helper found"
+    exit 1
+fi
 
 cp -a $BUILD/passwd.orig $ROOT/usr/etc/passwd
 cp -a $BUILD/group.orig $ROOT/usr/etc/group


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]