[Libosinfo] [PATCH 1/2] opensuse: Recognize future versions

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Tue Aug 12 12:03:43 UTC 2014


On Mon, Aug 11, 2014 at 5:24 PM, Lasse Schuirmann
<lasse.schuirmann at gmail.com> wrote:
> 2014-08-11 16:07 GMT+02:00 Zeeshan Ali (Khattak) <zeeshanak at gnome.org>:
>> On Sun, Aug 10, 2014 at 3:55 PM, Lasse Schuirmann
>> <lasse.schuirmann at gmail.com> wrote:
>>> ---
>>>  data/oses/opensuse.xml.in | 50 +++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 50 insertions(+)
>>>
>>> diff --git a/data/oses/opensuse.xml.in b/data/oses/opensuse.xml.in
>>> index c368d10..d424b5c 100644
>>> --- a/data/oses/opensuse.xml.in
>>> +++ b/data/oses/opensuse.xml.in
>>> @@ -418,4 +418,54 @@
>>>      </resources>
>>>    </os>
>>>
>>> +  <!-- Generic entry for future openSUSE releases. Please update the
>>> +       'upgrades', 'derives-from', 'volume-id' and 'resources' nodes
>>> +       accordingly each time you add a new (specific) entry for a new
>>> +       release. -->
>>> +  <os id="http://opensuse.org/opensuse/unknown">
>>> +    <short-id>opensuse-unknown</short-id>
>>> +    <_name>openSUSE</_name>
>>> +    <version>unknown</version>
>>> +    <_vendor>openSUSE</_vendor>
>>> +    <family>linux</family>
>>> +    <distro>opensuse</distro>
>>> +    <upgrades id="http://opensuse.org/opensuse/13.1" />
>>> +    <derives-from id="http://opensuse.org/opensuse/13.1" />
>>> +    <release-status>prerelease</release-status>
>>> +
>>> +    <media arch="i686">
>>> +      <iso>
>>> +        <volume-id>openSUSE-1([4-9]..|3.[2-9])-DVD</volume-id>
>>> +        <system-id>LINUX</system-id>
>>> +        <publisher-id>SUSE LINUX GmbH</publisher-id>
>>> +      </iso>
>>> +      <kernel>boot/i386/loader/linux</kernel>
>>> +      <initrd>boot/i386/loader/initrd</initrd>
>>> +    </media>
>>> +    <media arch="x86_64">
>>> +      <iso>
>>> +        <volume-id>openSUSE-1([4-9]..|3.[2-9])-DVD-x86_64</volume-id>
>>
>> Regex seems weird. Isn't it assuming that:
>>
>> * 1[4-9] versions' minor version will be only 1 character and it can
>> be any character?
> I could write 1[4-9].[0-9]+ if it suits you better. I dont see any
> behavioural differences though.

If it was the same thing, you wouldn't be suggesting it would you? :)
The difference is that it will no longer assume that minor version is
only 1 character and it restricts it to be numbers only (which would
be consistent with your alternative rule for 13.xx releases.

>> * 13 versions' is also assumed to be only 1 character but in this case
>> its been restricted to numerics only?
> You need this restriction here to not match any previous (13.[0-1]) versions.

Yes, I understand why its there.

> Does
> 1([4-9]\.[0-9]+|3\.([2-9][0-9]*|1[0-9]+))
> suit you better? Its certainly more exact but not so easy to
> understand IMHO and you probably need more time to adjust it whenever
> you introduce a new version explicitly.

Its good. I don't think its very complex and If you want to make it
more readable, you can put the corresponding glob expression in a
comment above this line.

Oh and btw, we are also assuming major versions to be less than 20.
Not exactly a problem for many years I'm sure but I don't think there
is any need to restrict that. I'd just restrict it to be < 99 at least
if i wanted to restrict it in the first place.

-- 
Regards,

Zeeshan Ali (Khattak)
________________________________________
Befriend GNOME: http://www.gnome.org/friends/




More information about the Libosinfo mailing list