Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-07 Thread Panu Matilainen
Merged #2917 into master. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2917#event-12039458910 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Panu Matilainen
@pmatilai approved this pull request. I actually meant you could just as well inline the whole lookup in what you're calling checkPart() since there are no other users for this in sight, but works for me. -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Florian Festi
@ffesti commented on this pull request. > + return p->token; + } +} +return NULL; +} + +static const int partBeforeBuildOnly(int part) +{ +const struct PartRec *p; + +for (p = partList; p->token != NULL; p++) { + if (p->part == part) { + return

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Florian Festi
@ffesti pushed 1 commit. 137a4353cf32f7a4d10d05d216dbd9392f84acc4 Don't allow build directives in generated specs -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2917/files/8dcf8824b2e7c00097e28e7ac1d4e939e431a0ab..137a4353cf32f7a4d10d05d216dbd9392f84acc4 You are

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > + return p->token; + } +} +return NULL; +} + +static const int partBeforeBuildOnly(int part) +{ +const struct PartRec *p; + +for (p = partList; p->token != NULL; p++) { + if (p->part == part) { + return

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Florian Festi
@ffesti commented on this pull request. > + return p->token; + } +} +return NULL; +} + +static const int partBeforeBuildOnly(int part) +{ +const struct PartRec *p; + +for (p = partList; p->token != NULL; p++) { + if (p->part == part) { + return

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Panu Matilainen
Oh and for whatever reason, there's some po/ submodule update in here: > diff --git a/po b/po index d5cc5d368e..eee506492f 16 --- a/po +++ b/po @@ -1 +1 @@ -Subproject commit d5cc5d368e2cbb639156b3f6ceb824a8815fdeba +Subproject commit eee506492f5fe2f4fe8940c5e5b088b42167b790 (also visible in

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > + return p->token; + } +} +return NULL; +} + +static const int partBeforeBuildOnly(int part) +{ +const struct PartRec *p; + +for (p = partList; p->token != NULL; p++) { + if (p->part == part) { + return

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Florian Festi
@ffesti commented on this pull request. > @@ -1060,71 +1069,72 @@ typedef const struct PreambleRec_s { int type; int deprecated; int ismacro; +int beforebuildonly; `prebuildonly` it is. Not that I am looking for any hills... -- Reply to this email directly or view it on

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-06 Thread Florian Festi
@ffesti commented on this pull request. > {0, 0, 0, 0} }; /** */ static int findPreambleTag(rpmSpec spec,rpmTagVal * tag, - const char ** macro, char * lang) + const char ** macro, char * lang, int * beforebuildonly) Done. I looked at the same issue

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-03-04 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -1060,71 +1069,72 @@ typedef const struct PreambleRec_s { int type; int deprecated; int ismacro; +int beforebuildonly; This is certainly better than the not-version (negations in variable names are the wrong thing, every time),

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-29 Thread Panu Matilainen
@pmatilai commented on this pull request. > {0, 0, 0, 0} }; /** */ static int findPreambleTag(rpmSpec spec,rpmTagVal * tag, - const char ** macro, char * lang) + const char ** macro, char * lang, int * beforebuildonly) findPreambleTag() is of course

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-29 Thread Panu Matilainen
@pmatilai commented on this pull request. > + return p->token; + } +} +return NULL; +} + +static const int partBeforeBuildOnly(int part) +{ +const struct PartRec *p; + +for (p = partList; p->token != NULL; p++) { + if (p->part == part) { + return

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-29 Thread Florian Festi
@ffesti commented on this pull request. > @@ -1109,6 +1123,25 @@ static rpmRC parseSpecSection(rpmSpec *specptr, int > secondary) goto errxit; } + if (stage == PARSE_GENERATED) { + switch (parsePart) { + case PART_PREP: + case

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-28 Thread Florian Festi
@ffesti pushed 1 commit. 1e89c45a1336b3927caa5222a536d2864b1c0c16 Don't allow build directives in generated specs -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2917/files/b1eb41516fd8a6674f334502f98a99d3aa7f9a58..1e89c45a1336b3927caa5222a536d2864b1c0c16 You are

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-28 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -1060,71 +1069,72 @@ typedef const struct PreambleRec_s { int type; int deprecated; int ismacro; +int notgenerated; "notgenerated" is not the greatest name ever :smile: Maybe "isgenerated" and just flip the meaning around?

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-28 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -1109,6 +1123,25 @@ static rpmRC parseSpecSection(rpmSpec *specptr, int > secondary) goto errxit; } + if (stage == PARSE_GENERATED) { + switch (parsePart) { + case PART_PREP: + case

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-28 Thread Florian Festi
@ffesti commented on this pull request. > + if (stage == GENERATED) { + switch (tag) { + case RPMTAG_SOURCE: + case RPMTAG_PATCH: + case RPMTAG_NOSOURCE: + case RPMTAG_NOPATCH: +

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-28 Thread Florian Festi
@ffesti commented on this pull request. > @@ -21,6 +21,11 @@ #define ALLOWED_CHARS_EVR ALLOWED_CHARS_VERREL "-:" #define LEN_AND_STR(_tag) (sizeof(_tag)-1), (_tag) +enum parseStages { +SPECFILE, +BUILDSYS, +GENERATED, Done -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-27 Thread Florian Festi
@ffesti pushed 2 commits. 69b688ed04e78f40c9565f570e5fb72b8f64a057 Add parseStages enum b1eb41516fd8a6674f334502f98a99d3aa7f9a58 No build directives in generated spec parts -- View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-20 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -21,6 +21,11 @@ #define ALLOWED_CHARS_EVR ALLOWED_CHARS_VERREL "-:" #define LEN_AND_STR(_tag) (sizeof(_tag)-1), (_tag) +enum parseStages { +SPECFILE, +BUILDSYS, +GENERATED, Use some unique prefix on the enum names, makes it easier

Re: [Rpm-maint] [rpm-software-management/rpm] No build directives in generated spec parts (PR #2917)

2024-02-20 Thread Panu Matilainen
@pmatilai commented on this pull request. > + if (stage == GENERATED) { + switch (tag) { + case RPMTAG_SOURCE: + case RPMTAG_PATCH: + case RPMTAG_NOSOURCE: + case RPMTAG_NOPATCH: +