Panu Matilainen 2e5e06
commit 5e0f3e6298bde0c6e44bd4db956a7287f9ff3f88
Panu Matilainen 2e5e06
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 2e5e06
Date:   Wed Sep 17 09:47:54 2014 +0300
Panu Matilainen 2e5e06
Panu Matilainen 2e5e06
    Turn invalid double separator error into a warning
Panu Matilainen 2e5e06
    
Panu Matilainen 2e5e06
    - As hysterical as it seems, people keep banging their heads into this:
Panu Matilainen 2e5e06
      older distros have these invalid dependencies deployed etc and people
Panu Matilainen 2e5e06
      do expect to create srpms and do test-builds on newer distros they're
Panu Matilainen 2e5e06
      running themselves. Which, put that way, seems rather reasonable...
Panu Matilainen 2e5e06
    - For history reference, the sanity check was originally introduced in
Panu Matilainen 2e5e06
      commit b2cf1471bbe2c35e3c36510a9e3f59919d8ed2c8 and
Panu Matilainen 2e5e06
      67ccf8d99630f4edad0ea16dddaca0a3355fba00,
Panu Matilainen 2e5e06
    - Backported from commit 1b3f7547c532b1f5ad68228571f1716d5be5b455
Panu Matilainen 2e5e06
Panu Matilainen 2e5e06
diff --git a/build/parseReqs.c b/build/parseReqs.c
Panu Matilainen 2e5e06
index 1427111..3cf1ce0 100644
Panu Matilainen 2e5e06
--- a/build/parseReqs.c
Panu Matilainen 2e5e06
+++ b/build/parseReqs.c
Panu Matilainen 2e5e06
@@ -40,7 +40,6 @@ static int checkSep(const char *s, char c, char **emsg)
Panu Matilainen 2e5e06
     const char *sep = strchr(s, c);
Panu Matilainen 2e5e06
     if (sep && strchr(sep + 1, c)) {
Panu Matilainen 2e5e06
 	rasprintf(emsg, "Invalid version (double separator '%c'): %s", c, s);
Panu Matilainen 2e5e06
-	return 1;
Panu Matilainen 2e5e06
     }
Panu Matilainen 2e5e06
     return 0;
Panu Matilainen 2e5e06
 }
Panu Matilainen 2e5e06
@@ -198,11 +197,12 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
Panu Matilainen 2e5e06
 
Panu Matilainen 2e5e06
 exit:
Panu Matilainen 2e5e06
     if (emsg) {
Panu Matilainen 2e5e06
+	int lvl = (rc == RPMRC_OK) ? RPMLOG_WARNING : RPMLOG_ERR;
Panu Matilainen 2e5e06
 	/* Automatic dependencies don't relate to spec lines */
Panu Matilainen 2e5e06
 	if (tagflags & (RPMSENSE_FIND_REQUIRES|RPMSENSE_FIND_PROVIDES)) {
Panu Matilainen 2e5e06
-	    rpmlog(RPMLOG_ERR, "%s: %s\n", emsg, r);
Panu Matilainen 2e5e06
+	    rpmlog(lvl, "%s: %s\n", emsg, r);
Panu Matilainen 2e5e06
 	} else {
Panu Matilainen 2e5e06
-	    rpmlog(RPMLOG_ERR, _("line %d: %s: %s\n"),
Panu Matilainen 2e5e06
+	    rpmlog(lvl, _("line %d: %s: %s\n"),
Panu Matilainen 2e5e06
 		   spec->lineNum, emsg, spec->line);
Panu Matilainen 2e5e06
 	}
Panu Matilainen 2e5e06
 	free(emsg);