gnomeos: Have commit-yocto-build make more assumptions

This is so it's easier to use.
This commit is contained in:
Colin Walters 2011-11-17 18:29:32 -05:00
parent a8735778f0
commit e588a47ba6
1 changed files with 10 additions and 9 deletions

View File

@ -4,6 +4,8 @@
set -e set -e
set -x set -x
WORKDIR=`pwd`
if test $(id -u) = 0; then if test $(id -u) = 0; then
cat <<EOF cat <<EOF
This script should not be run as root. This script should not be run as root.
@ -12,23 +14,22 @@ EOF
fi fi
usage () { usage () {
echo "$0 OSTREE_REPO_PATH BINARY_TAR" echo "$0 BRANCH"
exit 1 exit 1
} }
OSTREE_REPO=$1 BRANCH=$1
test -n "$OSTREE_REPO" || usage test -n "$BRANCH" || usage
shift
BUILD_TAR=$1
test -n "$BUILD_TAR" || usage
shift shift
origcwd=`pwd` OSTREE_REPO=$WORKDIR/repo
BUILD_TAR=$WORKDIR/tmp-eglibc/deploy/images/gnomeos-contents-$BRANCH-qemux86.tar.gz
tempdir=`mktemp -d tmp-commit-yocto-build.XXXXXXXXXX` tempdir=`mktemp -d tmp-commit-yocto-build.XXXXXXXXXX`
cd $tempdir cd $tempdir
mkdir fs mkdir fs
cd fs cd fs
fakeroot -s ../fakeroot.db tar xf $BUILD_TAR fakeroot -s ../fakeroot.db tar xf $BUILD_TAR
fakeroot -i ../fakeroot.db ostree --repo=${OSTREE_REPO} commit -s "Build (need ostree git version here)" -b gnomeos-base fakeroot -i ../fakeroot.db ostree --repo=${OSTREE_REPO} commit -s "Build (need ostree git version here)" -b "gnomeos-$BRANCH"
cd ${origcwd} cd "${WORKDIR}"
rm -rf $tempdir rm -rf $tempdir