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

Issue 1707007: Modify gmerge to allow for any arguments to emerge and have it work with statefuldev (Closed)

Created:
10 years, 8 months ago by sosa
Modified:
9 years, 6 months ago
Reviewers:
rtc
CC:
chromium-os-reviews_chromium.org
Visibility:
Public.

Description

Modify gmerge to allow for any arguments to emerge and have it work with statefuldev emerge require make.globals in /etc, however re-rooting emerge to install in /usr/local places make.globals in /usr/local/etc. This works around this issue and has gmerge work for updating chromeos (not dev) packages on a system. I also added some desired functionality to pass arbitrary emerge options to gmerge making it more like a true wrapper.

Patch Set 1 #

Patch Set 2 : Fix style #

Patch Set 3 : Restore -n #

Patch Set 4 : Allow both -n and $@ #

Patch Set 5 : Fix ws #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -7 lines) Patch
M src/platform/dev/gmerge View 1 2 3 4 3 chunks +27 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
sosa
Also sandbox isn't necessary for install of already created binary.
10 years, 8 months ago (2010-04-21 23:44:17 UTC) #1
rtc
10 years, 8 months ago (2010-04-23 07:27:43 UTC) #2
LGTM

On Wed, Apr 21, 2010 at 11:44 PM, <sosa@chromium.org> wrote:

> Reviewers: rtc,
>
> Message:
> Also sandbox isn't necessary for install of already created binary.
>
> Description:
> Modify gmerge to allow for any arguments to emerge and have it work with
> statefuldev
>
> emerge require make.globals in /etc, however re-rooting emerge to install
> in
> /usr/local places
> make.globals in /usr/local/etc.  This works around this issue and has
> gmerge
> work for updating
> chromeos (not dev) packages on a system.  I also added some desired
> functionality to
> pass arbitrary emerge options to gmerge making it more like a true wrapper.
>
> Please review this at http://codereview.chromium.org/1707007/show
>
> Affected files:
>  M src/platform/dev/gmerge
>
>
> Index: src/platform/dev/gmerge
> diff --git a/src/platform/dev/gmerge b/src/platform/dev/gmerge
> index
>
89c94a19b45655d6c4b281566217699d88d99e9d..acd16be1bc1488d7cdff45cc725c500f4603248c
> 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.
> +if [[ $package_name == -* ]]
> +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 "$@"
>
>
>

Powered by Google App Engine
This is Rietveld 408576698