]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
builder: unset GIT_SSH
[packages/rpm-build-tools.git] / builder.sh
index a1f870b18563a26cb4c1119ebd4b64d1bc948bd3..9360e7f36a72bd1a1ec93b8d92f4506f8267f6f7 100755 (executable)
@@ -38,7 +38,7 @@ APPDIR=$(d=$0; [ -L "$d" ] && d=$(readlink -f "$d"); dirname "$d")
 VERSION="v0.35"
 VERSIONSTRING="\
 Build package utility from PLD Linux Packages repository
-$VERSION (C) 1999-2015 Free Penguins".
+$VERSION (C) 1999-2016 Free Penguins".
 
 CLEAN_PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
 
@@ -806,7 +806,11 @@ Exit_error() {
                        exit 2 ;;
                "err_no_spec_in_repo" )
                        remove_build_requires
-                       echo >&2 "Error: spec file not stored in PLD repo."
+                       echo >&2 "Error: spec file not stored in repository."
+                       if [ -n "$2" ]; then
+                               echo >&2 "Tried: $2"
+                       fi
+
                        exit 3 ;;
                "err_no_source_in_repo" )
                        remove_build_requires
@@ -962,7 +966,10 @@ get_spec() {
                                                echo "Warning: package not in CVS - assuming new package"
                                                NOCVSSPEC="yes"
                                        }
-                                       git config --local --add "remote.$REMOTE_PLD.fetch"  'refs/notes/*:refs/notes/*'
+                                       git config --local --add "remote.$REMOTE_PLD.fetch" 'refs/notes/*:refs/notes/*'
+                                       git config --local --add "remote.$REMOTE_PLD.push" 'refs/notes/*:refs/notes/*'
+                                       git config --local --add "remote.$REMOTE_PLD.push" HEAD
+                                       git config --local push.default current
                                        git remote set-url --push  $REMOTE_PLD ssh://${GIT_PUSH}/${PACKAGES_DIR}/${ASSUMED_NAME}
                                )
                        fi
@@ -973,7 +980,10 @@ get_spec() {
                                fi
                                git init
                                git remote add $REMOTE_PLD ${GIT_SERVER}/${PACKAGES_DIR}/${ASSUMED_NAME}.git
-                               git config --local --add "remote.$REMOTE_PLD.fetch"  'refs/notes/*:refs/notes/*'
+                               git config --local --add "remote.$REMOTE_PLD.fetch" 'refs/notes/*:refs/notes/*'
+                               git config --local --add "remote.$REMOTE_PLD.push" 'refs/heads/*:refs/remotes/origin/*'
+                               git config --local --add "remote.$REMOTE_PLD.push" HEAD
+                               git config --local push.default current
                                git remote set-url --push  $REMOTE_PLD ssh://${GIT_PUSH}/${PACKAGES_DIR}/${ASSUMED_NAME}
                                CVSTAG=${CVSTAG:-"master"}
                        fi
@@ -1001,7 +1011,7 @@ get_spec() {
 
                # create symlinks for tools
                if [ "$SYMLINK_TOOLS" != "no" -a -d "$PACKAGE_DIR" ]; then
-                       for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh; do
+                       for a in dropin md5 builder {relup,compile,repackage,rsync,pearize}.sh; do
                                # skip tools that don't exist in top dir
                                [ -f $a ] || continue
                                # skip tools that already exist
@@ -1029,7 +1039,7 @@ get_spec() {
        fi
 
        if [ ! -f "$PACKAGE_DIR/$SPECFILE" ]; then
-               Exit_error err_no_spec_in_repo
+               Exit_error err_no_spec_in_repo "$PACKAGE_DIR/$SPECFILE"
        fi
 
        if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
@@ -1152,7 +1162,7 @@ cvsignore_df() {
        if [ "$CVSIGNORE_DF" != "yes" ]; then
                return
        fi
-       cvsignore=${PACKAGE_DIR}/.gitignore
+       local cvsignore=${PACKAGE_DIR}/.git/info/exclude
 
        # add only if not yet there
        if ! awk -vf="$1" -vc=1 '$0 == f { c = 0 } END { exit c }' $cvsignore 2>/dev/null; then
@@ -1652,8 +1662,10 @@ build_package() {
 
        # unset these, should not be exposed to builder shell!
        unset GIT_WORK_TREE GIT_DIR
-       # thse are set by jenkins
+       # these are set by jenkins
        unset GIT_PREVIOUS_COMMIT GIT_URL GIT_PREVIOUS_SUCCESSFUL_COMMIT GIT_BRANCH GIT_COMMIT
+       # this may be set by user
+       unset GIT_SSH
        # fail if something still set
        env | grep ^GIT_ && Exit_error err_build_fail
 
@@ -1986,12 +1998,12 @@ install_build_requires_rpmdeps() {
        local DEPS CNFL
        if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
                # TODO: Conflicts list doesn't check versions
-               CNFL=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
-               DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
+               CNFL=$(eval rpm-getdeps $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
+               DEPS=$(eval rpm-getdeps $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
        fi
        if [ "$FETCH_BUILD_REQUIRES_RPMSPECSRPM" = "yes" ]; then
-               CNFL=$(rpm -q --specsrpm --conflicts $BCOND $SPECFILE | awk '{print $1}' | _rpm_cnfl_check | xargs)
-               DEPS=$(rpm -q --specsrpm --requires $BCOND $SPECFILE | awk '{print $1}' | _rpm_prov_check | xargs)
+               CNFL=$(eval rpm -q --specsrpm --conflicts $BCOND $RPMOPTS $SPECFILE | awk '{print $1}' | _rpm_cnfl_check | xargs)
+               DEPS=$(eval rpm -q --specsrpm --requires $BCOND $RPMOPTS $SPECFILE | awk '{print $1}' | _rpm_prov_check | xargs)
        fi
 
        if [ -n "$CNFL" ]; then
@@ -2044,7 +2056,7 @@ init_rpm_dir() {
        cd "$TOP_DIR"
        init_repository ${PACKAGES_DIR}/rpm-build-tools.git ../rpm-build-tools
        init_repository projects/$TEMPLATES ../$TEMPLATES
-       for a in adapter builder fetchsrc_request compile repackage; do
+       for a in builder fetchsrc_request compile repackage; do
                ln -sf ../rpm-build-tools/${a}.sh $a
        done
        for a in md5; do
This page took 0.082293 seconds and 4 git commands to generate.