From 3aa906ab83b4fdb6494bef243020af6291ba8364 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Tue, 22 Jan 2013 15:49:36 -0500 Subject: [PATCH] Update uid/gid of build root if uid/gid is not match This is very important for sharing build root to other developers, and create a full build root for using by all developer. Change-Id: I1edd3830a499cff7ab357d17484075e46bd8319b --- build | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build b/build index 6169b26..1e91851 100755 --- a/build +++ b/build @@ -1981,13 +1981,11 @@ for SPECFILE in "${SPECFILES[@]}" ; do chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/home/abuild else if ! egrep "^abuild:x?:${ABUILD_UID}:${ABUILD_GID}" >/dev/null <$BUILD_ROOT/etc/passwd ; then - echo "abuild user present in the buildroot ($BUILD_ROOT) but uid:gid does not match" - echo "buildroot currently using:" - egrep "^abuild:" <$BUILD_ROOT/etc/passwd - echo "build script attempting to use:" - echo "abuild::${ABUILD_UID}:${ABUILD_GID}:..." - echo "build aborting" - cleanup_and_exit 1 + sed -i '/^abuild:/d' $BUILD_ROOT/etc/passwd + sed -i '/^abuild:/d' $BUILD_ROOT/etc/group + echo "abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >>$BUILD_ROOT/etc/passwd + echo "abuild:x:${ABUILD_GID}:" >>$BUILD_ROOT/etc/group + chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/home/abuild -R fi fi if test -f $BUILD_ROOT/etc/shadow ; then -- 2.7.4