Tried, but no...
I have an idea! (copy pasted from my debian/ubuntu package in PPA)
But not sure if this is acceptable for my spec file here:
https://src.fedoraproject.org/rpms/human-theme-gtk
Example:
human-theme-gtk.noarch: W: dangerous-command-in-%trigger rpm
%triggerin -- pango
currentver=`rpm -qa --queryformat '%{VERSION}' pango`
required50=1.50
required44=1.44
# https://unix.stackexchange.com/a/285928
if [ "$(printf '%s\n' "$required50" "$currentver" | sort -V | head -n1)"
= "$required50" ]; then
# Pango >= 1.50
# same as Pango < 1.44
sed -i 's/<border name="title_border" left="2" right="2" top="4"
bottom="4"/<border name="title_border" left="2" right="2" top="4"
bottom="3"/g' /usr/share/themes/human-theme/metacity-1/metacity-theme-1.xml
sed -i 's/padding: 4px 3px 2px; \/\* WARNING/padding: 4px 3px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/padding: 3px 3px 2px; \/\* WARNING/padding: 3px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/margin: -7px -10px -5px; \/\* WARNING/margin: -7px -10px
-4px; \/\* WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
echo "Update human-theme-gtk for Pango >= 1.50"
elif [ "$(printf '%s\n' "$required44" "$currentver" | sort -V | head
-n1)" = "$required44" ]; then
# Pango 1.44..1.49
sed -i 's/<border name="title_border" left="2" right="2" top="4"
bottom="3"/<border name="title_border" left="2" right="2" top="4"
bottom="4"/g' /usr/share/themes/human-theme/metacity-1/metacity-theme-1.xml
sed -i 's/padding: 4px 3px; \/\* WARNING/padding: 4px 3px 2px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/padding: 3px; \/\* WARNING/padding: 3px 3px 2px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/margin: -7px -10px -4px; \/\* WARNING/margin: -7px -10px
-5px; \/\* WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
echo "Update human-theme-gtk for Pango >= 1.44"
else
# Pango < 1.44
# original behavior, same as Pango >= 1.50
sed -i 's/<border name="title_border" left="2" right="2" top="4"
bottom="4"/<border name="title_border" left="2" right="2" top="4"
bottom="3"/g' /usr/share/themes/human-theme/metacity-1/metacity-theme-1.xml
sed -i 's/padding: 4px 3px 2px; \/\* WARNING/padding: 4px 3px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/padding: 3px 3px 2px; \/\* WARNING/padding: 3px; \/\*
WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
sed -i 's/margin: -7px -10px -5px; \/\* WARNING/margin: -7px -10px
-4px; \/\* WARNING/g' /usr/share/themes/human-theme/gtk-3.0/base.css
echo "Update human-theme-gtk for Pango < 1.44"
fi
Can I do that?
If I'm not wrong, the trigger is executed:
- when my package is installed or updated
- when pango is updated
Le 07/06/2023 à 21:27, Todd Zullinger a écrit :
Hi,
Fabrice Creuzot wrote:
With Fedora, rpmlint says:
E: specfile-error error: line 77: Trigger fired by the same package
is already defined in spec file: %triggerin -- pango < 1.44
The spec file is: https://github.com/luigifab/human-theme/blob/master/fedora/human-theme-gtk.spec
[...]
The packaged theme must be updated depending of Pango version.
I'm not sure how to do that:
- for Pango >= 1.44 and < 1.50 some changes must be added
- for Pango < 1.44 or >= 1.50 changes must be removed
Perhaps it would be better to combine the < 1.44 and >= 1.50
triggers and include the upper-range in the pango >= 1.44
trigger?
%triggerin -- pango < 1.44, pango >= 1.50
# Pango < 1.44, >= 1.50
...
%triggerin -- pango >= 1.44, pango < 1.50
# Pango 1.44..1.49
...
The lack of an upper-bound in pango >= 1.44 seems like the
real issue, as it is true as well as the pango >= 1.50
condition. (But I'm not intimately familiar with the rpm
internals, so I could be wrong.)
_______________________________________________
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
_______________________________________________
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