Re: Trying to set up a clean upgrade path for celestia

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 11. 02. 23 17:58, Mattia Verga wrote:
> 
> Sctriptlets are expanded on build time, so rpm.expand() is unnecessary and 
> dangerous.
> 
> Don't use it in sctriptlets. Use the macros directly.
> 
> See:
> 
> https://src.fedoraproject.org/rpms/python-notebook/blob/f35/f/python-note...
> 
> %pretrans -n python3-%{pypi_name} -p <lua>
> path = "%{python3_sitelib}/%{pypi_name}/static/components/moment"
> st = posix.stat(path)
> if st and st.type == "link" then
>    os.remove(path)
> end
> 
> $ rpm -qp --scripts python3-notebook-6.4.0-4.fc35.noarch.rpm
> pretrans scriptlet (using <lua>):
> path = "/usr/lib/python3.10/site-packages/notebook/static/components/moment"
> st = posix.stat(path)
> if st and st.type == "link" then
>    os.remove(path)
> end
> 
> 
> If the rpm.expand() call actually was there, you would end up with:
> 
> path = 
> rpm.expand("/usr/lib/python3.10/site-packages/notebook/static/components/moment")
> 
> Which is not necessary. And even if you escaped the %-signs like this:
> 
> path = rpm.expand("%%{python3_sitelib}/%{pypi_name}/static/components/moment")
> 
> You would (probably) end up with:
> 
> path = rpm.expand("%{python3_sitelib}/%{pypi_name}/static/components/moment")
> 
> Which would fail on runtime if python3-rpm-macros is not instilled.

Oh thanks for the tip. I was unsure if macros would have been translated when used between quotes in a lua script.

Mattia
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux