jessepeterson / margarita

Web frontend for reposado
The Unlicense
244 stars 40 forks source link

Catalog OS labels: only check file name, not entire URL #31

Closed mkuron closed 9 years ago

mkuron commented 9 years ago

Reposado has https URLs for OS X 10.9 and newer, so the OS labels only show up on packages for OS X 10.8 and lower. As some people might be replicating from other Reposado servers instead of the Apple servers, I made a change so only the file name of the catalog is compared and not the entire URL.

Relates to: #30 9eca53db95faf344b2dbba94e3edfb391024e5c3 ba3a94fbdf766b2633c61c8794f7097e813d62b1

jessepeterson commented 9 years ago

Hah, that's fun! While 10.9 and 10.10 do use HTTPS reposado did not traditionally use those links, instead using the HTTP links. This was changed a day ago here: wdas/reposado@fa681160abc5da2ccc34d530ab79e2156f735b59. :)

Ah! I hadn't considered tiered replication setups, should have thought of that. I noticed that you used os.path.basename(). As far as I know the os.path.* functions all use an OS-appropriate slash charater, no? I could be wrong there. But that would imply that this comparison wouldn't work on on Windows (as it's path separator character is backwards). If string comparisons are a must would a simple .split('/')[-1] work?