[lxc-devel] [lxc/master] find OpenSUSE's build also as obs-build
evgeni on Github
lxc-bot at linuxcontainers.org
Sun Oct 30 12:33:52 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 398 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161030/6633556d/attachment.bin>
-------------- next part --------------
From f1fd15d69334f59364c09b1a5b86833b050fdb9a Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni at debian.org>
Date: Sun, 30 Oct 2016 13:32:59 +0100
Subject: [PATCH] find OpenSUSE's build also as obs-build
this is how it is shipped in Debian and Ubuntu
Signed-off-by: Evgeni Golov <evgeni at debian.org>
---
templates/lxc-opensuse.in | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index 6044d89..ad75e10 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -40,6 +40,14 @@ done
# Make sure the usual locations are in PATH
export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
+if [ -x /usr/bin/obs-build ]; then
+ BUILD=/usr/bin/obs-build
+ export BUILD_DIR=/usr/lib/obs-build
+else
+ BUILD=/usr/bin/build
+ export BUILD_DIR=/usr/lib/build
+fi
+
configure_opensuse()
{
rootfs=$1
@@ -118,7 +126,7 @@ download_opensuse()
cache=$1
arch=$2
- if [ ! -x /usr/bin/build ]; then
+ if [ ! -x ${BUILD} ]; then
echo "Could not create openSUSE template :"
echo "you need to install \"build\" package"
return 1
@@ -200,7 +208,7 @@ EOF
# openSUSE 13.2 has no noarch directory in update
[ -d $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch ] || mkdir -p $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch
- CLEAN_BUILD=1 BUILD_ARCH="$arch" BUILD_ROOT="$cache/partial-$arch" BUILD_DIST="$cache/partial-$arch-packages/opensuse.conf" PATH="$PATH:/usr/lib/build" /usr/lib/build/init_buildsystem --clean --configdir /usr/lib/build/configs --cachedir $cache/partial-$arch-cache --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/noarch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch || return 1
+ CLEAN_BUILD=1 BUILD_ARCH="$arch" BUILD_ROOT="$cache/partial-$arch" BUILD_DIST="$cache/partial-$arch-packages/opensuse.conf" PATH="$PATH:$BUILD_DIR" $BUILD_DIR/init_buildsystem --clean --configdir $BUILD_DIR/configs --cachedir $cache/partial-$arch-cache --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/noarch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch || return 1
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar http://download.opensuse.org/distribution/$DISTRO/repo/oss repo-oss || return 1
if [ $DISTRO == "leap/42.1" ]; then
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar http://download.opensuse.org/update/$DISTRO/oss update || return 1
More information about the lxc-devel
mailing list