Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Panu Matilainen
The case in RH bugzilla kind of highlights the insanity nicely:

`%setup -q %{?rev:-c}`
`%autosetup %{?rev:-c}`

Yes, one is a builtin and the other one is a macro. But I'd be hard-pressed to 
come up with a *sensible* explanation why those should behave differently.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272871213___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Panu Matilainen
Yes the issue is valid regardless of the particular sgb.spec case, reopening.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272869771___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Panu Matilainen
Reopened #127.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#event-924361401___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Igor Gnatenko
workaround which I use in `%py3_build` is `%py3_build "--use-cython"` which 
works

I would reopen this bug.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272868906___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Andreas Scherer
Closed #127.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#event-924250381___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Andreas Scherer
In the particular case of [`%autosetup` in 
`sgb.spec`](https://github.com/ascherer/sgb/blob/local/sgb.spec#L52), using 
`-N` or `-p1` depending on the CLI option `--without patches` is utterly 
redundant, because [the set of patches is 
commented-out](https://github.com/ascherer/sgb/blob/local/sgb.spec#L31) in the 
first place.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272851092___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Panu Matilainen
I didn't really mean to, but ended up looking at this a bit more.

It's by no means just the font-packages that break, there are all sorts of 
other cases too, at least:
- passing arguments starting with "-" by passing them in as macros (%py2_build 
etc macros, some java packages) which now fail as invalid options. This is 
basically abuse, using "--" to separate arguments from options actually works 
but isn't widely known or documented.
- %systemd_user_post macro fails with recursion loop on %{?*}

Breakage on automatic macros is not a big surprise considering this changes 
scoping rules in some ways.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272829249___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Andreas Scherer
So it seems I went a bit overboard with [my implementation of `%autosetup` in 
`debbuild`](https://github.com/ascherer/debbuild/blob/master/debbuild#L810). 
Interesting though, that the same issue occurred on RH. :wink: 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272807000___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-16 Thread Panu Matilainen
Looking at Fedora rawhide specs, at least font packages break with the above 
change. Pretty much as expected, actually.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272796908___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Conditional macro expansion fails (#127)

2017-01-15 Thread Panu Matilainen
Yup, see also https://bugzilla.redhat.com/show_bug.cgi?id=1397209. Whether it's 
truly *intentional* I don't know but AFAIK it's always been that way.

Fixing it is a simple matter of:
```
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -687,8 +687,10 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * 
se,
  * Append the results to main argv. 
  */
 {  ARGV_t av = NULL;
-   char *s = xcalloc((lastc-se)+1, sizeof(*s));
-   memcpy(s, se, (lastc-se));
+   char *s = NULL;
+
+   /* Expand possible macros in the arguments */
+   expandThis(mb, se, lastc-se, &s);
 
argvSplit(&av, s, " \t");
argvAppend(&argv, av);
```

...but it'd be changing a longstanding behavior and there's no telling what 
might break if we did that.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/127#issuecomment-272786395___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint