esac
}
+is_bool() {
+ [ "$1" = "true" -o "$1" = "false" ] || die "Invalid boolean value: $1"
+}
+
tmpfs() {
if is_no "${TMPFS:-true}" || [ "$TMPFS" = "0" ]; then
return
install -d $topdir/logs
# start the container
- if ! have_container "$PACKAGE_NAME"; then
+ if ! have_container "$PACKAGE_NAME"; then
TMPFS_SIZE=$TMPFS \
PACKAGE_NAME=$PACKAGE_NAME \
docker-compose run --rm -d \
cleanbuild
fi
- notice "Setup the homedir"
+ UID=$(id -u)
+ GID=$(id -g)
+ notice "Setup builder user ($UID:$GID)"
+
docker exec --user=root -w / $name usermod -d $home builder
+ if [ "$UID" -gt 0 ]; then
+ docker exec --user=root -w / $name usermod -u $UID builder
+ fi
+ if [ "$GID" -gt 0 ]; then
+ docker exec --user=root -w / $name groupmod -g $GID builder
+ fi
+
notice "Setup permissions"
- docker exec --user=root -w / $name sh -c "cd $home && chown builder:builder . rpm rpm/logs rpm/BUILD rpm/RPMS .ccache"
+ docker exec --user=root -w / $name sh -c "cd $home && chown builder:builder . rpm rpm/logs rpm/BUILD rpm/RPMS rpm/packages .ccache"
if [ ! -d $topdir/rpm-build-tools ]; then
notice "Initialize rpm-build-tools"
;;
--keep-container)
shift
- [ "$1" = "true" -o "$1" = "false" ] || die "Invalid boolean value: $1"
+ is_bool "$1"
KEEP_CONTAINER=$1
;;
--with)
$TRACING && set -x
local name="cleanbuild-$PACKAGE_NAME"
- create_container
if $EXEC; then
enter_container
return
fi
+ create_container
package_prepare
package_build
}