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"
constructions. Set GROUP_BCONDS to yes to make use of it.
--target <platform>, --target=<platform>
- build for platform <platform>.
---init-rpm-dir - initialize ~/rpm directory structure
+--init-rpm-dir, --init
+ - initialize ~/rpm directory structure
"
}
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
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
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
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
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
fi
fi
+ # unset these, should not be exposed to builder shell!
+ unset GIT_WORK_TREE GIT_DIR
+ # these are set by jenkins
+ unset GIT_PREVIOUS_COMMIT GIT_URL GIT_PREVIOUS_SUCCESSFUL_COMMIT GIT_BRANCH GIT_COMMIT
+ # fail if something still set
+ env | grep ^GIT_ && Exit_error err_build_fail
+
local specdir=$(insert_gitlog $SPECFILE)
# FIXME: eval here is exactly why?
PATH=$CLEAN_PATH eval teeboth "'$logfile'" ${TIME_COMMAND} ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $specdir/$SPECFILE
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
-Upi | --update-poldek-indexes )
UPDATE_POLDEK_INDEXES="yes"
shift ;;
- --init-rpm-dir)
+ --init-rpm-dir|--init)
COMMAND="init_rpm_dir"
shift ;;
-u | --try-upgrade )