Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: src/platform/dev/gmerge

Issue 1707007: Modify gmerge to allow for any arguments to emerge and have it work with statefuldev (Closed)
Patch Set: Fix ws Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "$@"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698