Search
SailfishOS Open Build Service
>
Projects
>
home:lbt
:
sdk
>
rpm
> _service:gitpkg:0002-rpm-4.8.0-tilde.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:gitpkg:0002-rpm-4.8.0-tilde.patch of Package rpm
From d3a17c0a32d0a0240c5997c7044cb2297b57055e Mon Sep 17 00:00:00 2001 From: David Greaves <david@dgreaves.com> Date: Wed, 17 Apr 2013 20:41:08 +0000 Subject: [PATCH] rpm-4.8.0-tilde --- build/parsePreamble.c | 2 +- build/parseReqs.c | 2 +- lib/rpmvercmp.c | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build/parsePreamble.c b/build/parsePreamble.c index e8e3133..03b7557 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -668,7 +668,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, case RPMTAG_VERSION: case RPMTAG_RELEASE: SINGLE_TOKEN_ONLY; - if (rpmCharCheck(spec, field, strlen(field), "._+%{}") != RPMRC_OK) return RPMRC_FAIL; + if (rpmCharCheck(spec, field, strlen(field), "~._+%{}") != RPMRC_OK) return RPMRC_FAIL; headerPutString(pkg->header, tag, field); break; case RPMTAG_URL: diff --git a/build/parseReqs.c b/build/parseReqs.c index de2680c..ef04deb 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -156,7 +156,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, } EVR = xmalloc((ve-v) + 1); rstrlcpy(EVR, v, (ve-v) + 1); - if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}")) goto exit; + if (rpmCharCheck(spec, EVR, ve-v, "~.-_+:%{}")) goto exit; re = ve; /* ==> next token after EVR string starts here */ } else EVR = NULL; diff --git a/lib/rpmvercmp.c b/lib/rpmvercmp.c index f5ae092..fc920de 100644 --- a/lib/rpmvercmp.c +++ b/lib/rpmvercmp.c @@ -33,12 +33,16 @@ int rpmvercmp(const char * a, const char * b) /* loop through each version segment of str1 and str2 and compare them */ while (*one && *two) { - while (*one && !risalnum(*one)) one++; - while (*two && !risalnum(*two)) two++; + while (*one && !risalnum(*one) && *one != '~') one++; + while (*two && !risalnum(*two) && *two != '~') two++; /* If we ran to the end of either, we are finished with the loop */ if (!(*one && *two)) break; + /* If exactly one side has a tilde, it is decided. */ + if ((*one == '~') ^ (*two == '~')) + break; + str1 = one; str2 = two; @@ -103,6 +107,11 @@ int rpmvercmp(const char * a, const char * b) /* this catches the case where all numeric and alpha segments have */ /* compared identically but the segment sepparating characters were */ /* different */ + if (*two == '~') + return 1; + else if (*one == '~') + return -1; + if ((!*one) && (!*two)) return 0; /* whichever version still has characters left over wins */ -- 1.8.2