From 33a4004746b0f10bdeafe3cea82b77b5aba37ca7 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Thu, 7 Aug 2008 14:50:49 +0200 Subject: [PATCH 1/3] Don't allow multiple definition of PatchX or SourceX (rhbz#458261, rhbz#458260) --- build/spec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/spec.c b/build/spec.c index 4279f9e..2f159f4 100644 --- a/build/spec.c +++ b/build/spec.c @@ -308,6 +308,16 @@ int addSource(Spec spec, Package pkg, const char *field, int tag) } } + /* Check whether tags of the same number haven't already been defined */ + for (p = spec->sources; p != NULL; p = p->next) { + if ( p->num != num ) continue; + if (tag == RPMTAG_SOURCE && p->flags == RPMBUILD_ISSOURCE || + tag == RPMTAG_PATCH && p->flags == RPMBUILD_ISPATCH) { + rpmlog(RPMLOG_ERR, _("%s %d defined multiple times\n"), name, num); + return RPMRC_FAIL; + } + } + /* Create the entry and link it in */ p = xmalloc(sizeof(*p)); p->num = num; From 52f50790ffcfc14ab0c164ef094b3e5e0d93a687 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 8 Aug 2008 13:53:57 +0300 Subject: [PATCH 2/3] Add parenthesis to make gcc happy --- build/spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/spec.c b/build/spec.c index 2f159f4..0cae8f6 100644 --- a/build/spec.c +++ b/build/spec.c @@ -311,8 +311,8 @@ int addSource(Spec spec, Package pkg, const char *field, int tag) /* Check whether tags of the same number haven't already been defined */ for (p = spec->sources; p != NULL; p = p->next) { if ( p->num != num ) continue; - if (tag == RPMTAG_SOURCE && p->flags == RPMBUILD_ISSOURCE || - tag == RPMTAG_PATCH && p->flags == RPMBUILD_ISPATCH) { + if ((tag == RPMTAG_SOURCE && p->flags == RPMBUILD_ISSOURCE) || + (tag == RPMTAG_PATCH && p->flags == RPMBUILD_ISPATCH)) { rpmlog(RPMLOG_ERR, _("%s %d defined multiple times\n"), name, num); return RPMRC_FAIL; } From b81db19611a583b2e211988002db2778905a52d8 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Tue, 16 Sep 2008 11:02:21 +0400 Subject: [PATCH 3/3] 4.0.4-alt77.M40.3 - build/spec.c: don't allow multiple definition of PatchX or SourceX (Jindrich Novy, rhbz#458261, rhbz#458260) --- rpm-4_0.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpm-4_0.spec b/rpm-4_0.spec index 2be83f5..fec0321 100644 --- a/rpm-4_0.spec +++ b/rpm-4_0.spec @@ -4,7 +4,7 @@ Name: %rpm_name Version: %rpm_version -Release: alt77.M40.2 +Release: alt77.M40.3 %define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}} %define get_dep() %(rpm -q --qf '%%{NAME} >= %%|SERIAL?{%%{SERIAL}:}|%%{VERSION}-%%{RELEASE}' %1 2>/dev/null || echo '%1 >= unknown') @@ -530,6 +530,10 @@ fi %endif #with contrib %changelog +* Tue Sep 16 2008 Alexey Tourbin 4.0.4-alt77.M40.3 +- build/spec.c: don't allow multiple definition of PatchX or SourceX + (Jindrich Novy, rhbz#458261, rhbz#458260) + * Tue Jul 08 2008 Dmitry V. Levin 4.0.4-alt77.M40.2 - spec: In %%post-script, removed /var/cache/apt/*.bin (Alexey Tourbin). - pdeath_execute.c: Removed X_OK check, use execvp(3) (Alexey Tourbin).