]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/commitdiff
- fix sed to disallow macro multiplication on multiple calls
authorMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 17:08:24 +0000 (18:08 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 17:08:24 +0000 (18:08 +0100)
builder.sh

index 1d876e589f1b12ec841a419cd0a14ea53a1f563c..a091ffcd40e8dc73221d0dd19c79e6ea6cb4be07 100755 (executable)
@@ -1757,7 +1757,7 @@ build_package() {
        # Enable/disable distro wide bconds based on ~/.distbcond
        process_distbcond "$specdir/$SPECFILE"
        # Add %tld macro to release to allow release control
-       sed -i -r -e 's/^Release:\s+(.*)$/Release:\t\1%{?tld}/' $specdir/$SPECFILE
+       sed -i -r -e '/^Release:/s/%\{\?tld\}//g; s/^Release:\s+(.*)$/Release:\t\1%{?tld}/;' $specdir/$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
        retval=$?