]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
do not remove macros.build from macrofiles for parsing spec
[packages/rpm-build-tools.git] / builder.sh
index 5d733df654dc878f649c73aa1cfebcfe63252c67..47336ade958309dfe16f30f055d6195796575875 100755 (executable)
@@ -581,10 +581,7 @@ set_spec_target() {
 
 # runs rpm with minimal macroset
 minirpm() {
-       # we reset macros not to contain macros.build as all the %() macros are
-       # executed here, while none of them are actually needed.
-       # at the time of this writing macros.build + macros contained 70 "%(...)" macros.
-       safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ')
+       safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); print $0 } ')
 
        # TODO: move these to /usr/lib/rpm/macros
        cat > $BUILDER_MACROS <<'EOF'
@@ -2081,20 +2078,30 @@ fetch_build_requires()
                fi
 }
 
+init_repository() {
+       local remoterepo=$1
+       local localrepo=$2
+
+       if [ ! -e $localrepo ]; then
+               git clone -o $REMOTE_PLD ${GIT_SERVER}/$remoterepo $localrepo
+               git --git-dir=$localrepo/.git remote set-url --push  $REMOTE_PLD ssh://${GIT_PUSH}/$remoterepo
+       fi
+}
+
 init_rpm_dir() {
        local TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
        local rpmdir=$(eval $RPM $RPMOPTS --eval '%{_rpmdir}')
        local buildir=$(eval $RPM $RPMOPTS --eval '%{_builddir}')
        local srpmdir=$(eval $RPM $RPMOPTS --eval '%{_srcrpmdir}')
+       local TEMPLATES=template-specs
        local tmp
 
        echo "Initializing rpm directories to $TOP_DIR from $GIT_SERVER"
        mkdir -p $TOP_DIR $rpmdir $buildir $srpmdir
 
        cd "$TOP_DIR"
-       if [ ! -e ../rpm-build-tools ]; then
-               git clone  ${GIT_SERVER}/${PACKAGES_DIR}/rpm-build-tools.git ../rpm-build-tools
-       fi
+       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
                ln -sf ../rpm-build-tools/${a}.sh $a
        done
This page took 0.049171 seconds and 4 git commands to generate.