# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#

set -e
set -x

WORKDIR=`pwd`
cd `dirname $0`
SCRIPT_SRCDIR=`pwd`
cd -

if test $(id -u) = 0; then
    cat <<EOF
This script should not be run as root.
EOF
    exit 1
fi

usage () {
    echo "$0 BRANCH"
    exit 1
}

BRANCH=$1
test -n "$BRANCH" || usage
shift

ARCH=x86

OSTREE_VER=$(cd $SCRIPT_SRCDIR && git describe)

BUILDDIR=$WORKDIR/tmp-eglibc

OSTREE_REPO=$WORKDIR/repo
BUILD_TAR=$BUILDDIR/deploy/images/gnomeos-contents-$BRANCH-qemu${ARCH}.tar.gz

BUILD_TIME=$(date -r $BUILD_TAR)

tempdir=`mktemp -d tmp-commit-yocto-build.XXXXXXXXXX`
cd $tempdir
mkdir fs
cd fs
fakeroot -s ../fakeroot.db tar xf $BUILD_TAR
fakeroot -i ../fakeroot.db ostree --repo=${OSTREE_REPO} commit -s "Build from OSTree ${OSTREE_VER}" -b "gnomeos-yocto-$ARCH-$BRANCH"
cd "${WORKDIR}"
rm -rf $tempdir

#!/bin/bash
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#

set -e
set -x

WORKDIR=`pwd`
cd `dirname $0`
SCRIPT_SRCDIR=`pwd`
cd -

if test $(id -u) = 0; then
    cat <<EOF
This script should not be run as root.
EOF
    exit 1
fi

usage () {
    echo "$0 BRANCH"
    exit 1
}

BRANCH=$1
test -n "$BRANCH" || usage
shift

ARCH=x86

OSTREE_VER=$(cd $SCRIPT_SRCDIR && git describe)

BUILDDIR=$WORKDIR/tmp-eglibc

export PSEUDO_PREFIX=${BUILDDIR}/sysroots/$(uname -m)-linux
export PSEUDO_BINDIR=${PSEUDO_PREFIX}/usr/bin
export PSEUDO_LIBDIR=${PSEUDO_BINDIR}/../lib/pseudo/lib
FAKEROOT=${PSEUDO_BINDIR}/pseudo

OSTREE_REPO=$WORKDIR/repo
BUILD_TAR=$BUILDDIR/deploy/images/gnomeos-contents-$BRANCH-qemu${ARCH}.tar.gz

BUILD_TIME=$(date -r $BUILD_TAR)

tempdir=`mktemp -d tmp-commit-yocto-build.XXXXXXXXXX`
cd $tempdir
mkdir fs
cd fs
$FAKEROOT tar xf $BUILD_TAR
$FAKEROOT ostree --repo=${OSTREE_REPO} commit -s "Build from OSTree ${OSTREE_VER}" -b "gnomeos-yocto-$ARCH-$BRANCH"
cd "${WORKDIR}"
rm -rf $tempdir

Switch to using pseudo for commits
gnomeos: Switch to using pseudo for commits

This is noticeably faster.

One side effect here is that xattrs are empty, which is actually
a good thing.
