stdlib/fedora: Use grep -F when matching %fedora-rebuild-name
[goals.git] / stdlib / fedora.gl
index 3a8fa42..a9f43ed 100644 (file)
@@ -64,10 +64,10 @@ predicate is-koji-built (pkg) = {
     if ! grep -sq "^%%autochangelog" $specfile; then
         # If the specfile doesn't have the magic string then the
         # package definitely needs to be rebuilt.
-        grep -sq %fedora-rebuild-name $specfile || exit 99
+        grep -sqF %fedora-rebuild-name $specfile || exit 99
     else
         # Using autochangelog.
-        git log | grep -sq %fedora-rebuild-name || exit 99
+        git log | grep -sqF %fedora-rebuild-name || exit 99
     fi
 
     # Else we must check Koji itself.
@@ -118,6 +118,7 @@ is-koji-built ("%pkg") :
     # before we can start the new build.
     for p in %<; do
         nvr=$(koji --quiet latest-build %fedora-tag $p | awk '{print $1}')
+        test -n "$nvr" || exit 1
         while ! koji wait-repo --timeout=10000 %fedora-tag --build=$nvr; do sleep 1m; done
     done
 
@@ -136,7 +137,7 @@ is-koji-built ("%pkg") :
 
         # If the specfile doesn't have the magic string then add
         # that now.
-        if ! grep -sq %fedora-rebuild-name $specfile; then
+        if ! grep -sqF %fedora-rebuild-name $specfile; then
             rpmdev-bumpspec -c "- "%fedora-rebuild-name $rightmost *.spec
         else
             rpmdev-bumpspec -c "- Bump release and rebuild" $rightmost *.spec
@@ -145,7 +146,7 @@ is-koji-built ("%pkg") :
         fedpkg commit -c
     else
         # Using autochangelog.
-        if ! git log | grep -sq %fedora-rebuild-name; then
+        if ! git log | grep -sqF %fedora-rebuild-name; then
             git commit --allow-empty -m %fedora-rebuild-name
         else
             git commit --allow-empty -m "Bump release and rebuild"