Wait whats your spec looking like right
Wait, whats your spec looking like right now? You should
%global
the variable first in the top section and then use that variable later.44 Replies
lets thread
Yeah
this is getting busy 😄
https://src.fedoraproject.org/rpms/sil-charis-fonts/blob/f38/f/sil-charis-fonts.spec
This is how they define using the longform, they do a similar thing to what we need. Cutting out a part of a word.
snippets of known file
ublue-os-update-services.spec
and...
Hmm maybe put %global above the source like they did, right below all the standardized Name: etc.
You can use https://pb.envs.net btw 🙂
fair
location if global should be fine... that location with shorthand gsub was creating garbage values in the variable
When you used
${gsub
then the variable literally became the word gsub right?yeah like
Seems to me like gsub macro shorthand isn't implemented and the docs are old/wrong or maybe even for a newer version than waht Fedora uses
i think the longhand is close, just missing the match
Yeah
The match is tricky, I am guessing the % gets interpreted before passing in
I think we need to escpe the %, try the usual things, first
%%
then \%
yep, was just thinking the same
neither
hmm
Okay try this
Just to see what it does
ok, somethings wrong
using a simple "ublue" match should have at least changed that output
Yeah that's really mysterious
We're basically the same as fedora's own spec now
Can you post the full file on https://pb.envs.net ?
I saw from what you posted that you're using
%{project_name}
in the paths though so that's correct.
And the longform we are usign is identical to what Fedora uses, including the fact that ""
works inside string.gsub()
... :/
https://src.fedoraproject.org/rpms/sil-charis-fonts/blob/f38/f/sil-charis-fonts.spec
Hmm
@bsherman What happens if you do this?
Does it at least add a foo to prove that it's doing anything at all?sorry, had to step away... i'm being loose with actual work today, but have to address a couple questions
one sec and i'll test that
You know, the worst case scenario is that something is wrong with our RPM builder if it can't run Lua. In that case, a pure plaintext solution would be something like:
I am fairly sure globals can be defined anywhere in that top section, so keeping it next to name would work. I have seen people put %globals at the literal first line of the file.
foo is in the result here
Ah, so it definitely ran the Lua and ran gsub with a parameter that was "projectnameFOO", and ended up with that in the output path, yeah?
Then why the heck isn't it replacing anything. It's the simplest string possible...
yup
I ran this in real lua:
That's what we should have gotten. But your result didn't replace the ublue?
right, i got "ublue-os-update-servicesfoo"
(i used lowercase)
i'm reading docs again myself, a moment plz
Okay, it makes no sense to me that it's literally runnign the lua, literally running the function, but getting no replacements.
We're calling string.gsub the same way Fedora calls it themselves in their spec
If you wanna try one more thing, try:
Literally one letter replacement.
that worked
As a reminder, Fedora does:
yeah, so we shouldn't need the expand, because that's expanding a macro
Okay that's interesting. That's looking really wrong somehow.
ublue-os-update-servicesar
Notice how it only replaced the "b" nthe loose "bar" partyeah, it's like it's doing the replacement before interpretting the variable
so maybe we DO need the expand
Yeah I think you have figured it out
But check how fedora does expansion:
YES!
Directory not found: /tmp/ublue-os/rpmbuild/BUILDROOT/ublue-os-update-services-0.3-1.fc38.x86_64/usr/share/ublue-os/ulue-os-update-servicesar
Hell yeah great work brother! 😄
Funny coincidence that the "b" in "bar" lined up with the hopeless 1-character replacement test. But lucky.
So this should be the final code, I guess?
that's what i have... the gsub is good now!
i'm just trying to sort out why other build problems exist
Perfect. 🙂 I will resume work on the firstboot autostarter. And hey, after you've moved this file, take a long break, you've earned it. 😄 That was tedious!
lol, like, a break to work on my real job? 🤣
Hahahhah! Yes. Playing solitaire and minesweeper, multitasking and stuff like that. 😄
not a good description of my job 😉 try again
I know it's some important job, I think Jorge mentioned it on the tech over tea podcast. 😄
nah, he didn't mention me... i'm stealth
Haha 🙂
Speaking of stealth, why not contributor name color on Discord?
eh, whatever, i'm just happy tot help
I thought it may be because you didn't want to be bothered by people here haha.
"Special name, can not resist urge to ask that person special question..."