-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
% sign doubling #117
Comments
For the first part pf your question I think preinstall is just doing a linux commandline to echo what you've given it, that is "echo %_macros_variable_here. preinstall, postinstall, etc. are just shell scripts. I don't know if you can expect _macros_variable_here to exist as an environment variable in the shell. Or maybe you should try doing it in postinstall, rather than preinstall, since it might not be getting defined until the actual install. That's the easy one. Why the doubling? Not sure. You don't say if you've done anything on the nebula side to create this variable or not. I see no such functionality there. So I must assume that the first time the rpm knows about |
For the lack of information as to what I am doing, sorry. I've tried many things to get the correct behavior and may have overlooked things to mention of things in which I was thinking at first. Here is what I have: build.gradle:
} def percentage = Character.toString((char)37); ospackage {
} buildRpm { } gradle buildRpm You can scroll down and now see a double %% in the %pre macros. If you remove the extra % sign (and add Licenses, Distribution....I just put example in all of that) Type :q and y to save the new rpm. To run the new rpm You will see the output If you run the nebula built rpm you will see For further information the %pre section can use macros in the scripts. There are many places these macros can be defined: rpm --showrc will list the list where the macros come from. Or they can be defined on the command line or spec file. I am just choosing the command line. To reply to your replies first paragraph. The spec file can substitute macros' in the scriptlets. Rpm doesn't insert them into the env and then run the script. Rpm substitues the macros (which can be a value or method) into the script then runs the script. I hope this helps. I really couldn't find where an extra % would come from. I see the strings and collections of string being passed from nebula to redline and redline using StringBuilder to write them to the Message's Entry. Even if there was a string format happening anywhere I did try a %% in the gradle file and that was represented as %%%% in the spec file. In java %% is an escape for % when using string format. |
I also have this same issue. Was trying to include a systemd service in my RPM and wanted to use the |
Hello,
#While working with the nebula rpm plugin for gradle I have found a difficult issue and I cannot locate the exact location as to where this is happening or how to escape it. Please help.
#In the ospackage for nebula I am using:
preInstall("""
echo %_macros_variable_here
"""
#When I go to install the rpm --define '_macros_variable_here hereIam' I see output
%_macros_variable_here
#Where I am looking for the actual value of the variable (where ever it is defined...command line, ~/.rpmmacro, ...)
#The actual issue with when the spec file is created the % turns into %%. I have looked through nebula and this code and I cannot find where it is being replace or how it is turning into %%. I have tried % and \% and %% in order to escape the sign, without avail.
#To work around this I have been manually running: rpmrebuild --package --notest-install -e example.rpm
#This new rpm will handle the defined macros properly. Do you have any idea 1) how the the extra percent sign is being inserted or 2) how to properly get only one % inserted in the generated spec file?
The text was updated successfully, but these errors were encountered: