| Index: src/platform/dev/gmerge
|
| diff --git a/src/platform/dev/gmerge b/src/platform/dev/gmerge
|
| index 89c94a19b45655d6c4b281566217699d88d99e9d..9df98fddfcbfce7f515cefe50e1c196ad8e218a5 100755
|
| --- a/src/platform/dev/gmerge
|
| +++ b/src/platform/dev/gmerge
|
| @@ -8,8 +8,12 @@ set -e
|
|
|
| build=1
|
|
|
| -if [ x$1 == x-n ] ; then
|
| - shift
|
| +# Package name is the last argument.
|
| +package_name=${!#}
|
| +
|
| +# If no package name is provided skip to emerge options or if -n is given.
|
| +if [[ $package_name == -* ]] || [ x$1 == x-n ]
|
| +then
|
| build=0
|
| fi
|
|
|
| @@ -32,15 +36,31 @@ mount -o remount,rw /
|
| mkdir -p /etc/make.profile
|
|
|
| if [ $build == 1 ] ; then
|
| - echo "Building $1"
|
| - ESCAPED_PACKAGE=$(python -c "import urllib; print urllib.quote('''$1''')")
|
| + echo "Building $package_name"
|
| + ESCAPED_PACKAGE=$(python -c \
|
| + "import urllib; print urllib.quote('''$package_name''')")
|
| ESCAPED_BOARD=$(python -c \
|
| "import urllib; print urllib.quote('''${BOARD_NAME}''')")
|
|
|
| - wget $DEVKIT_URL/build --post-data="pkg=${ESCAPED_PACKAGE}&board=${ESCAPED_BOARD}"
|
| + wget $DEVKIT_URL/build \
|
| + --post-data="pkg=${ESCAPED_PACKAGE}&board=${ESCAPED_BOARD}"
|
| +fi
|
| +
|
| +# Installing emerge into /usr/local installs make.globals needed in
|
| +# /usr/local/etc rather than /etc.
|
| +if [ ! -f /etc/make.globals ]
|
| +then
|
| + if [ -f /usr/local/etc/make.globals ]
|
| + then
|
| + echo "Missing /etc/make.globals, copying over from /usr/local/etc"
|
| + sudo cp /usr/local/etc/make.globals /etc
|
| + else
|
| + echo "Missing /etc/make.globals and none in /usr/local/etc. Aborting."
|
| + exit 1
|
| + fi
|
| fi
|
|
|
| -echo "Emerging $1"
|
| +echo "Emerging $package_name"
|
|
|
| export PORTAGE_BINHOST="${DEVKIT_URL}/static/pkgroot/${BOARD_NAME}/packages"
|
| export PORTAGE_TMPDIR=/tmp
|
| @@ -49,4 +69,4 @@ export PORTAGE_TMPDIR=/tmp
|
| # unstable changes from upstream for packages that you do not want.
|
| export ACCEPT_KEYWORDS='~x86 x86'
|
|
|
| -emerge --getbinpkg --usepkgonly $1
|
| +FEATURES="-sandbox" emerge --getbinpkg --usepkgonly "$@"
|
|
|