[opensuse-packaging] RPM: update directory to symlink
Hi, I have a package that at some stage replaces a directory with a symlink. RPM does not like that. See https://bugzilla.opensuse.org/show_bug.cgi?id=1022710 After some searching I have come up with the following solution, adding the following lines to the spec file: +%pre +# boo#1022710: fix upgrade from 13.2 to Leap +# liberation has become a symlink in Leap and RPM does not like to overwrite a directory with a symlink +if [ -d %{_datadir}/%{name}/fonts/liberation ] && \ + ! [ -L %{_datadir}/%{name}/fonts/liberation ]; then + rm -rf %{_datadir}/%{name}/fonts/liberation + ln -s %{_datadir}/fonts/truetype/ %{_datadir}/%{name}/fonts/liberation +fi + I have already prepared a SR: https://build.opensuse.org/request/show/453602 Before accepting that SR I would like to ask you: is this solution correct? If not, what should I do then? Thanks, Cor -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Op 03-02-17 om 09:04 schreef Cor Blom:
Hi,
I have a package that at some stage replaces a directory with a symlink. RPM does not like that. See
https://bugzilla.opensuse.org/show_bug.cgi?id=1022710
After some searching I have come up with the following solution, adding the following lines to the spec file:
+%pre +# boo#1022710: fix upgrade from 13.2 to Leap +# liberation has become a symlink in Leap and RPM does not like to overwrite a directory with a symlink +if [ -d %{_datadir}/%{name}/fonts/liberation ] && \ + ! [ -L %{_datadir}/%{name}/fonts/liberation ]; then + rm -rf %{_datadir}/%{name}/fonts/liberation + ln -s %{_datadir}/fonts/truetype/ %{_datadir}/%{name}/fonts/liberation +fi +
I have already prepared a SR:
https://build.opensuse.org/request/show/453602
Before accepting that SR I would like to ask you: is this solution correct? If not, what should I do then?
Thanks,
Cor
Found a better solution. Thanks. Cor -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Op 03-02-17 om 09:04 schreef Cor Blom:
Hi,
I have a package that at some stage replaces a directory with a symlink. RPM does not like that. See
https://bugzilla.opensuse.org/show_bug.cgi?id=1022710
After some searching I have come up with the following solution, adding the following lines to the spec file:
+%pre +# boo#1022710: fix upgrade from 13.2 to Leap +# liberation has become a symlink in Leap and RPM does not like to overwrite a directory with a symlink +if [ -d %{_datadir}/%{name}/fonts/liberation ] && \ + ! [ -L %{_datadir}/%{name}/fonts/liberation ]; then + rm -rf %{_datadir}/%{name}/fonts/liberation + ln -s %{_datadir}/fonts/truetype/ %{_datadir}/%{name}/fonts/liberation +fi +
I have already prepared a SR:
https://build.opensuse.org/request/show/453602
Before accepting that SR I would like to ask you: is this solution correct? If not, what should I do then?
Thanks,
Cor
Found a better solution. Thanks. Cor -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Op 03-02-17 om 20:22 schreef Johannes Kastl:
On 03.02.17 19:23 Cor Blom wrote:
Found a better solution. Thanks.
Care to share the solution? For the next one searching...
Johannes
Yes, sorry. It is in the bug report. See https://bugzilla.redhat.com/show_bug.cgi?id=447156#c28 I added the following lines: # boo#1022710: fix upgrade from 13.2 to Leap # liberation has become a symlink in Leap and RPM does not like to overwrite a directory with a symlink %pretrans -p <lua> st = posix.stat("%{_datadir}/%{name}/fonts/liberation") if st and st.type == "directory" then os.execute("rm -rf %{_datadir}/%{name}/fonts/liberation") end Cor -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Cor Blom
-
Cor Blom
-
Johannes Kastl