"10" < "9": Get rid of string comparisons in time for F-10?
On #fedora-devel, the issue of comparing Fedora versions by string
comparison just came up. With F-10 on the way, this will be the first
time when string comparing versions will fail in a "10" < "7" way.
The case in question was a classic older %if "%{?fedora}" > "7", which
should be changed to %if 0%{?fedora} > 7, as Rex Dieter and Christopher
Stone have pointed out:
http://fedoraproject.org/wiki/Packaging/DistTag#head-1c550109af0705ccb71329619b99428af2fd3e25
Where else but in spec files may similarly wrong string comparisons be
happening? Is a systematic effort required to fix these comparisons in
the run-up to F-10?
--
Hans Ulrich Niedermann
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
05-26-2008, 09:51 PM
"Tom "spot" Callaway"
"10" < "9": Get rid of string comparisons in time for F-10?
On Sat, 2008-05-24 at 01:00 +0200, Hans Ulrich Niedermann wrote:
> On #fedora-devel, the issue of comparing Fedora versions by string
> comparison just came up. With F-10 on the way, this will be the first
> time when string comparing versions will fail in a "10" < "7" way.
>
> The case in question was a classic older %if "%{?fedora}" > "7", which
> should be changed to %if 0%{?fedora} > 7, as Rex Dieter and Christopher
> Stone have pointed out:
> http://fedoraproject.org/wiki/Packaging/DistTag#head-1c550109af0705ccb71329619b99428af2fd3e25
>
> Where else but in spec files may similarly wrong string comparisons be
> happening? Is a systematic effort required to fix these comparisons in
> the run-up to F-10?
Probably. This is something we should look into, and I've added it to my
todo list.
~spot
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
05-27-2008, 09:02 AM
Hans Ulrich Niedermann
"10" < "9": Get rid of string comparisons in time for F-10?
Tom "spot" Callaway wrote:
On Sat, 2008-05-24 at 01:00 +0200, Hans Ulrich Niedermann wrote:
The case in question was a classic older %if "%{?fedora}" > "7", which
should be changed to %if 0%{?fedora} > 7, as Rex Dieter and Christopher
Stone have pointed out:
http://fedoraproject.org/wiki/Packaging/DistTag#head-1c550109af0705ccb71329619b99428af2fd3e25
Where else but in spec files may similarly wrong string comparisons be
happening? Is a systematic effort required to fix these comparisons in
the run-up to F-10?
Probably. This is something we should look into, and I've added it to my
todo list.
My quick and dirty spec file string comparison checker script is at:
devel: 85 string comparisons in 46 spec files
F-9: 90 string comparisons in 50 spec files
F-8: 117 string comparisons in 59 spec files
F-7: 121 string comparisons in 63 spec files
If someone wants to do mass bug filing or reporting sorted by maintainer
name based on that, you'd probably need to filter out a few cases where
this simple grep finds false positives. The == and != comparisons might
be working as intended.
--
Hans Ulrich Niedermann
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
06-05-2008, 08:12 PM
Hans Ulrich Niedermann
"10" < "9": Get rid of string comparisons in time for F-10?
Graphing the numbers over time shows a definite decrease in
devel/rawhide/F10, but nothing approaching zero for a long time:
http://ndim.fedorapeople.org/stuff/rpm/
--
Hans Ulrich Niedermann
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
07-06-2008, 02:29 PM
Paul Howarth
"10" < "9": Get rid of string comparisons in time for F-10?
On Sun, 06 Jul 2008 15:02:52 +0200
Hans Ulrich Niedermann <hun@n-dimensional.de> wrote:
> A short reminder what this is about:
>
> %if "%{?fedora}" > "7"
> <something which should work in F-8, F-9, F-10, F-11, etc.>
> %endif
>
> This fails to work as intended in rawhide/devel/F10 and later and
> should be fixed.
>
> Summary for 2008-07-06
> ----------------------
> devel: 58 string comparisons in 32 spec files
> F-9: 78 string comparisons in 46 spec files
> F-8: 109 string comparisons in 56 spec files
> F-7: 118 string comparisons in 62 spec files
>
> The packages in rawhide will definitely be affected by this, might
> already be breaking stuff, and really should be fixed:
>
> http://ndim.fedorapeople.org/stuff/rpm/string-comp-devel.log
>
> Graphing the numbers over time shows a definite decrease in
> devel/rawhide/F10, but nothing approaching zero for a long time:
>
> http://ndim.fedorapeople.org/stuff/rpm/
>
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
07-06-2008, 03:13 PM
Nicolas Mailhot
"10" < "9": Get rid of string comparisons in time for F-10?
Le dimanche 06 juillet 2008 à 15:29 +0100, Paul Howarth a écrit :
> Some false positives here:
>
> lat
> lat.spec:14:%if "%{?fedora}" == "5"
> lat.spec:42:%if "%{?fedora}" == "5"
> lat.spec:111:%if "%{?fedora}" == "5"
>
> These are not a problem.
Actually since FC5 has been EOLed for a long time, some legacy baggage
cleaning up is in order.
--
Nicolas Mailhot
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
07-06-2008, 03:25 PM
Peter Gordon
"10" < "9": Get rid of string comparisons in time for F-10?
On Sun, 2008-07-06 at 15:29 +0100, Paul Howarth wrote:
> Some false positives here:
>
> lat
> lat.spec:14:%if "%{?fedora}" == "5"
> lat.spec:42:%if "%{?fedora}" == "5"
> lat.spec:111:%if "%{?fedora}" == "5"
>
> These are not a problem.
>
Maybe not, but FC5 is long-since dead. Conditional cruft like that
should probably just be outright removed.
--
Peter Gordon (codergeek42)
GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
07-06-2008, 04:08 PM
Hans Ulrich Niedermann
"10" < "9": Get rid of string comparisons in time for F-10?
Nicolas Mailhot wrote:
Le dimanche 06 juillet 2008 à 15:29 +0100, Paul Howarth a écrit :
Actually since FC5 has been EOLed for a long time, some legacy baggage
cleaning up is in order.
Well, it is still useful at least as documentation for people wanting to
build newer packages on older systems. Enterprise disto derivates, and
standalone lab boxes running Fedora spring to mind.
Apropos... I am not checking for improper %{epel} or %{rhel} usage, but
some spec files contain conditionals with them.
--
Hans Ulrich Niedermann
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
07-06-2008, 04:21 PM
Hans Ulrich Niedermann
"10" < "9": Get rid of string comparisons in time for F-10?
Paul Howarth wrote:
On Sun, 06 Jul 2008 15:02:52 +0200
Hans Ulrich Niedermann <hun@n-dimensional.de> wrote:
Summary for 2008-07-06
----------------------
devel: 58 string comparisons in 32 spec files
F-9: 78 string comparisons in 46 spec files
F-8: 109 string comparisons in 56 spec files
F-7: 118 string comparisons in 62 spec files