[web catalog migration] define compile-time variables in .spec#296
[web catalog migration] define compile-time variables in .spec#296nephros merged 4 commits intosailfishos-patches:masterfrom
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Looks fine for me, now that I looked at the code changes.
I should have done that in the first place, instead of replying right after reading your comment above. Hence I minimised ("hid") my original comment, because it turned out to be "off topic", although it still may be helpful; it was written under the false assumption that this was a preparatory step for merging the code of the Django-based Web Catalog web-app here.
… primarily by eliminating the (seemingly) unrelated `# MEDIA_URL SERVER_URL "/" MEDIA_PATH` , see sailfishos-patches#296
|
@nephros, please revert my commit 219bc17 if it was wrong to eliminate the C header file define Side note: Checking these in … made me wonder, if there is a path element What do you think? |
No, as they are used like e.g. at https://github.com/sailfishos-patches/patchmanager/blob/master/src/bin/patchmanager-daemon/patchmanagerobject.cpp#L1923: so if anything they should have an |
Well, the media path is actually a different beast than the api locations. It's fine to remove from the comments as you did, as we don't mention it otherwise in the .spec, but that define should probably become configurable in the spec as well. |
There was a problem hiding this comment.
I don't know why this MR threw a notification for me, as I cannot detect any status change etc.
Anyway, I reread our old conversation, and as always you answered all my checks&balances-questions exhaustively. I suppose that is why I marked it as reviewed.
Now, with some newly gathered spec file know-how, I might ask the nitpicking question, why you decided not to specify all three new defines as %global:
- Generally defines via
%globalare preferred today, because … %globaldefines are evaluated once, when they are created. In contrast,%defines are evaluated each time they are used; hence the are necessary when variables / other defines may change during while a spec file is worked through (by RPM,libzyppetc.), but only then.%globaldefines can be used in all sections of a spec file, but a%definein the header section is not valid in any of the scriptlets (%pre,%post,%preun,%postun,%pretrans,%posttransand the%filetrigger…-scriplets).
Thus you may consider to change the only %define also to %global, if I did not miss an aspect.
Or not, because this is just a suggestion (from me) / general guidance (from the RPM maintainers / RedHat / Fedora, with a large overlap between these three).
HTH
… primarily by eliminating the (seemingly) unrelated `# MEDIA_URL SERVER_URL "/" MEDIA_PATH` , see sailfishos-patches#296
219bc17 to
e4b6f8d
Compare
To prepare for a possible move of the Web Catalog infrastructure, make the core variables configurable/defined in the .spec file