]> git.pld-linux.org Git - projects/cleanbuild.git/blobdiff - cleanbuild
run findbr inside container
[projects/cleanbuild.git] / cleanbuild
index b4c05a6370aa1f8be742520c73d1216943cf43a9..e7da70a158ea725fe5793fc3d5f339b8051c089b 100755 (executable)
@@ -43,6 +43,7 @@ usage() {
        echo " --cleanafter | -ca  - clean after build"
        echo " --forceumount | -fu - force umount tmpfs"
        echo " --debug             - enable debug"
+       echo " --network           - allow build to use networking"
        echo " -a, -b, -c, -d, -e  - select alternative chroot directory"
        exit 1
 }
@@ -51,6 +52,7 @@ FETCH=false
 CLEAN=false
 CREATE=false
 BUILD=false
+NETWORK=false
 INSTALL=false
 
 case "$0" in
@@ -125,6 +127,9 @@ while [ $# -gt 0 ]; do
                --debug)
                        NODEBUG=false
                        ;;
+               --network)
+                       NETWORK=true
+                       ;;
                --forceumount | -fu)
                        FORCE_UMOUNT=true
                        ;;
@@ -217,12 +222,14 @@ for D in installed buildlogs $CACHEDIR; do
 done
 
 ignore \
-       vserver-packages \
        upstart\* \
+       upstart \
        compat-\* \
        systemd-init \
-       kmod \
+       hhvm \
+       vserver-packages \
        xorg-driver-video-fglrx\* xorg-driver-video-nvidia\* xorg-xserver-xgl-libGL \
+       xorg-driver-video-vboxvideo \
        xorg-data-xbitmaps \
        compat-gcc\* \
        libpng1\* \
@@ -234,7 +241,12 @@ ignore \
        perl-Scalar-List-Utils \
        perl-ExtUtils-Install \
        phonon-backend-mplayer phonon-backend-vlc \
-       icedtea6-jre java-sun-jre java5-sun-jre libgcj oracle-java7-jre \
+       libgcj libgcj-devel \
+       icedtea6-jre icedtea6-jdk \
+       icedtea7-jre icedtea7-jdk \
+       java-sun-jre java-sun-jdk \
+       java5-sun-jre java5-sun-jdk \
+       oracle-java7-jre oracle-java7-jdk \
        gnome-menus \
        gnome-speech-driver-festival gnome-speech-driver-speech-dispatcher
 
@@ -303,7 +315,7 @@ build_prepare_root()
                rpm --root=$CHDIR --initdb
        fi
        poldek --up || :
-       poldek -O "ignore=$IGNORE" -u rpm-build pwdutils coreutils util-linux git-core gawk
+       poldek -O "ignore=$IGNORE" -u rpm-build pwdutils coreutils time util-linux git-core gawk
        echo Poldek exit: $?
 
        for DIR in dev proc sys; do
@@ -313,7 +325,8 @@ build_prepare_root()
                mount -o bind /$DIR $CHDIR/$DIR
        done
 
-       chroot $CHDIR groupadd $(id $USER -gn) -g$(id $USER -g)
+       # group 'users' may already exist, so ignore errors
+       chroot $CHDIR groupadd $(id $USER -gn) -g$(id $USER -g) || :
        chroot $CHDIR useradd -m $USER -u$(id $USER -u) -g $(id $USER -gn)
 
        # replicate files which already belong to $USER
@@ -345,8 +358,10 @@ build_mount_home()
 {
        $NODEBUG || set -x
        mount -o bind $HOME/rpm $CHDIR/$CHHOME/rpm
-}
 
+       # ensure RPMS dir is available
+       chroot $CHDIR su $USER -c 'mkdir -p $(rpm -E %_rpmdir)'
+}
 
 print_installed()
 {
@@ -387,7 +402,7 @@ builddie()
 LAST_INSTALL=""
 poldek_install()
 {
-       I="$1";
+       local I="$1" ret
        # Nothing to install
        [ -n "$I" ] || return 1
        # Installing same packets second time
@@ -410,7 +425,9 @@ poldek_install()
        [ -n "$ret" ] && return $ret
 
        # try harder
+       info "Poldek install failed, retry without ignore"
        poldek -u $I && return 0
+       info "Poldek install failed, retry once more without ignore"
        poldek -u $I && return 0
        warn "Poldek:" "Could not install" $I
        return 1
@@ -422,7 +439,7 @@ maybe_call()
        local func="$1"; shift
 
        [ $cond = "false" ] && return
-       $func "$@"
+       "$func" "$@"
        [ $cond = "exit_after" ] && exit
 }
 
@@ -463,6 +480,8 @@ echo $$ > $CHDIR/.pid
 
 maybe_call $INSTALL poldek_install "$*"
 
+maybe_call $NETWORK cp -bf /etc/resolv.conf $CHDIR/etc/
+
 $BUILD || exit
 
 if [ -p /tmp/fixfreq ]; then
@@ -485,7 +504,7 @@ while true; do
        fi
        ./findunusedbr -c $CHDIR $HOME/rpm/packages/$build_pkg/$build_pkg.spec
        title "building"
-       ./teeboth $buildlog chroot $CHDIR su $USER -c "$CHHOME/rpm/packages/builder -nn -bb $build_pkg $builder_options"
+       ./teeboth $buildlog chroot $CHDIR su $USER -c "$CHHOME/rpm/packages/builder -nn --define '_enable_debug_packages 0' -bb $build_pkg $builder_options"
        ECODE=$?
 
        if grep -q "error: Failed build dependencies:" $buildlog; then
This page took 0.181782 seconds and 4 git commands to generate.