ximion / appstream-dep11

Python module to handle Debian DEP-11 metadata
https://github.com/ximion/appstream-generator
GNU Lesser General Public License v3.0
3 stars 3 forks source link

contentsfile: Accept any number of '/'-separate components in package name #16

Closed iainlane closed 8 years ago

iainlane commented 8 years ago

For non-main, ubuntu "location" components are in the form component/section/package - we're only interested in the last.

AFAICS Debian is always section/package - but the same code should work there too, unless I'm missing something.

In [1]: "foo/bar".split("/")[-1].strip()
Out[1]: 'bar'

In [2]: "foo/bar/baz".split("/")[-1].strip()
Out[2]: 'baz'

In [3]: "foo".split("/")[-1].strip()
Out[3]: 'foo'
iainlane commented 8 years ago

This is one of the reasons that gnome-weather is broken in Ubuntu - we can't find the icon since it's in Universe. The other reason is as I mentioned on IRC - you skip it because the filename contains a '.'

ximion commented 8 years ago

Did you test if this works with the Debian/Ubuntu contents files?

ximion commented 8 years ago

Ah, and the if '/' in group_pkg: must remain there since sometimes the section part is missing (seen in Debian and some 3rd-party repos)

iainlane commented 8 years ago

You still want the last component then right? Look at the ipython output I gave above - if there's no '/' then you just get the whole string. Is that right?

I tested on Ubuntu but not a full run, that takes ages. If merged I will drop all packages with icon errors and see what happens then.

ximion commented 8 years ago

Indeed, I was reading too quickly there... I wonder why the check was there in the first place then... Anyway, looks good to me and shouldn't break stuff, I'll test on Debian soon, just to be sure.