[softwaremgmt] Unique attribute
After discovering .repo files can have more than one base-url , that means we can't use the url as the identifier of a source, to build a run-time relation ship between the known sources list and the cached source in the database. As the .repo files force you to define a [section] alias per source, I think we should rely on each repo having a unique string id. Other attributes can be used as fallbacks, for example, if the alias is not supplied, the url can be used as an alias too. What do you think? -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Hi, On Fri, 1 Jun 2007, Duncan Mac-Vicar Prett wrote:
After discovering .repo files can have more than one base-url , that means we can't use the url as the identifier of a source, to build a run-time relation ship between the known sources list and the cached source in the database.
As the .repo files force you to define a [section] alias per source, I think we should rely on each repo having a unique string id.
Other attributes can be used as fallbacks, for example, if the alias is not supplied, the url can be used as an alias too.
What do you think?
Does the identifier of .repo files (for which base-url is impossible) have to be human readable? If not you simply could use the MD5 sum of it. Or is it required that the identifier remains the same over changes of the .repo file? In that case you indeed have not many other choices than to rely on something the author of the .repo files writes. That of course has a high propability that people just copy .repo files from each other, and only change the URLs, but not the [section] alias :-/ Ciao, Michael. -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
On Friday 01 June 2007 16:15, Michael Matz wrote:
Does the identifier of .repo files (for which base-url is impossible) have to be human readable? If not you simply could use the MD5 sum of it. Or is it required that the identifier remains the same over changes of the .repo file? In that case you indeed have not many other choices than to rely on something the author of the .repo files writes. That of course has a high propability that people just copy .repo files from each other, and only change the URLs, but not the [section] alias :-/
It has to remain. This attribute will be used to associate the plain text "repo infos" in /etc to the cached data in the binary cache. Of course I could associate using the sha on the index and update it all the time, but that would prevent you from refreshing the raw metadata from building the binary cache in two steps. I switched to using the alias for now. -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
On Sunday 03 June 2007 20:03:07 Duncan Mac-Vicar wrote:
It has to remain. This attribute will be used to associate the plain text "repo infos" in /etc to the cached data in the binary cache. Of course I could associate using the sha on the index and update it all the time, but that would prevent you from refreshing the raw metadata from building the binary cache in two steps.
I switched to using the alias for now.
Now I get it, you were talking about the md5 sum of the .repo file, I was talking about the md5 sum of the metadata index. Yes, as you said, the cache survives through .repo file changes, still it is not a bad idea, you can just force the user to rebuild the cache if the .repo changes and cleanup the orphan caches. The .repo file won't change that often. Uhm, I like that idea. -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Hi, On Mon, 4 Jun 2007, Duncan Mac-Vicar Prett wrote:
On Sunday 03 June 2007 20:03:07 Duncan Mac-Vicar wrote:
It has to remain. This attribute will be used to associate the plain text "repo infos" in /etc to the cached data in the binary cache. Of course I could associate using the sha on the index and update it all the time, but that would prevent you from refreshing the raw metadata from building the binary cache in two steps.
I switched to using the alias for now.
Now I get it, you were talking about the md5 sum of the .repo file,
Yep. Using the content itself (well, mostly so) as unique identifier :-)
Yes, as you said, the cache survives through .repo file changes, still it is not a bad idea, you can just force the user to rebuild the cache if the .repo changes and cleanup the orphan caches.
If that indeed doesn't happen that often, then using the MD5 of the .repo seems like the most robust solution. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
On Monday 04 June 2007 10:31:37 Michael Matz wrote:
If that indeed doesn't happen that often, then using the MD5 of the .repo seems like the most robust solution.
Uhm, the problem is, the user could have more than 1 repo in a .repo file, nothing prevents it. :-( Duncan -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
On Fri, Jun 01, Duncan Mac-Vicar Prett wrote:
After discovering .repo files can have more than one base-url , that means we can't use the url as the identifier of a source, to build a run-time relation ship between the known sources list and the cached source in the database.
Take all the base URLs as string -> put them in a set (to sort and unify them) -> join the set into one string -> compute it's md5sum. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
On Tuesday 12 June 2007 18:07, Michael Andres wrote:
On Fri, Jun 01, Duncan Mac-Vicar Prett wrote:
After discovering .repo files can have more than one base-url , that means we can't use the url as the identifier of a source, to build a run-time relation ship between the known sources list and the cached source in the database.
Take all the base URLs as string -> put them in a set (to sort and unify them) -> join the set into one string -> compute it's md5sum.
You can't because you can add more base urls, or they can be added in the mirrorlist, and that should not invalidate the cache. We continue using alias for now... Duncan -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
participants (4)
-
Duncan Mac-Vicar
-
Duncan Mac-Vicar Prett
-
Michael Andres
-
Michael Matz