[zypp-devel] zypper bad design issues
I've forever been confused by the bad repo management design in zypper
with regards to handling of repo name, alias, and description, and
adding/modifying repos.
Specifics:
1) zypper ar -c adds repo instead of checking URL. #507736
2) zypper ar -h
addrepo (ar) [options] <URI> <alias>
addrepo (ar) [options]
Volker Kuhlmann wrote:
I've forever been confused by the bad repo management design in zypper with regards to handling of repo name, alias, and description, and adding/modifying repos. 2) zypper ar -h addrepo (ar) [options] <URI> <alias> addrepo (ar) [options]
The second version is missing the <alias> specification.
You are confused, as the repo file includes the alias. That is the sole purpose of a .repo file, it has the alias, url and other settings together in one file.
3) zypper ar URL://someplace.repo aliasstring puts aliasstring int othe alias (good) but destroys the name (very bad). The result is useless unless I am careful with the choce of aliasstring, and in any case havong identical strings for name and alias is pointless (ditch one of them altogether).
name is just a description. What do you expect here?, that it takes all information from the .repo file _except_ the alias you are giving to it? The .repo file already includes the alias.
4) There is no repo description, but there is a useless name/alias scheme. I suggest to dump the alias in favour of name, and to use what is the name as description.
name == description, alias is what you expect from a short name. Blame the yum guys for their taste on naming (that is why you also find tags named_like_this and others named-like-this). We try to be compatible instead of inventing yet more names. So a example of "name" is : "openSUSE 11.1 repo" An example of alias is: "opensuse11" However, there is no real restriction on what the alias can contains, it will just be hard to type if it is too complex, as it is supposed to be an uniqueid to be given for operations.
5) zypper lr needs to show some useable short name which can easily be copy/pasted and used(pasted) on the command line, and some informative description.
That is the alias. And I can see it. It also shows the numbers, which you can also use. Be careful that numbers change once you add and remove repos, at is the ordering number. 5 | home_dmacvicar_ruby | dmacvicar ruby packages (openSUSE_Factory) | Yes | No
6) Adding the repos offered by yast results in a meaningless alias ("repo_somenumber") and an informative description in the name field (of zypper lr) which is however unusable as a name.
again, name == description in this case. alias == what you expect as a name.
It makes for a frustrating repo management experience :(
If you are editing the files yourself, you should know the concepts, they are pretty standard among smart, yum and zypper. I do agree the name and alias thing is confusing, but using different names would it make even more confusing, and bad taste for naming is something you find almost everywhere in the Linux world, and the usual solution is to invent a new name. Hey we just came from renaming sources, catalogs and channels to repositories only because it looks like its the most used word right now. -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thu 28 May 2009 22:29:57 NZST +1200, Duncan Mac-Vicar Prett wrote:
addrepo (ar) [options] <URI> <alias> addrepo (ar) [options]
The second version is missing the <alias> specification.
You are confused, as the repo file includes the alias. That is the sole purpose of a .repo file, it has the alias, url and other settings together in one file.
Then zypper is buggy, because ar uri.repo aliasstring inserts aliasstring for *both* alias and name. See lr. Nice would be to overide the alias in the .repo when specified on the command line (ditto for the other fields).
name is just a description. What do you expect here?, that it takes all information from the .repo file _except_ the alias you are giving to it?
I don't much care whether the description is called name or description. What I expect is that a repo has a short name which can be used easily on the command line (i.e. not too long, unique, and no spaces), and a description that tells me what the repo is good for. Yast's unhelpful setting of aliases to "repoN" doesn't help. It does that at least for the preconfigured community repos that can be added with a tick. Last time I tried adding repos with yast by one-click install yast made a hash of it too, whether that was because the alias in the .repo was badly chosen (i.e. anything not meeting my definition above) or whether yast just plain mangles things here I don't know, but I've given up on yast here for the time being. Adding repos manually means I either have to specify a useful alias when adding and then manually setting the description back afterwards, or adding the repo and going through the filesystem and fixing up the alias string manually. There isn't an option to rename aliases, though it's not difficult to do manually, but it would be a useful feature to tidy up the mess. There's also no way in yast to set "keep packages" when adding (community?) repos, which if I want to keep the packages makes one-click install a many-clicks-manually-tidy-up install. I insist on keeping packages so I have at least what I needed myself so I can back it up / copy it for offline use.
name == description, alias is what you expect from a short name. Blame the yum guys for their taste on naming (that is why you also find tags named_like_this and others named-like-this). We try to be compatible instead of inventing yet more names.
There is a good case for compatibility. It's a shame that there wasn't anything better to be compatible to :( Looking at the idiotic priorities (it goes down when it goes up - d'oh) one gets the feeling it was "designed" by a unix programmer capable of hacking it up in an afternoon but without much clout (or care) about making it usable ;)
So a example of "name" is : "openSUSE 11.1 repo" An example of alias is: "opensuse11"
That would be just fine.
That is the alias. And I can see it. It also shows the numbers, which you can also use. Be careful that numbers change once you add and remove repos, at is the ordering number.
Yes, that's why the ordering number isn't that safe as repo identification in commands. Cheers, Volker -- Volker Kuhlmann is list0570 with the domain in header http://volker.dnsalias.net/ Please do not CC list postings to me. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Volker Kuhlmann wrote:
Yes, that's why the ordering number isn't that safe as repo identification in commands.
Cheers,
Volker
What is your algorithm for the perfect alias if only the url is known? -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Volker Kuhlmann wrote:
1) zypper ar -c adds repo instead of checking URL. #507736
https://bugzilla.novell.com/show_bug.cgi?id=507736#c1 : Well, the neither the man page nor the help text is very verbose about this, but it actually means "check whether there's a valid repo at that url when adding it with addrepo". Without this option, the repo is alway added (without checking), and you only see an eventual error if you refresh the repo. So this is actually not a bug, but i will improve the man page and help text, so that it's obvious. --------- as for the alias/name vs. name/description stuff, Duncan already explained, but i should probably mention these in the vocabulary section of the zypper man page as well. Something like: Alias A short string that uniquely identifies a repository. Can be used in commands and options that need a repository specified. The alias is usually not visible in graphical package managers like YaST Software Management. That's also why the aliases set by such applications are not very meaningful. Use 'zypper nr' to change them to something more pleasant to work with in zypper such case. Name A descriptive name of the repository. -- cheers, jano Ján Kupec YaST team ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz ---------------------------------------------------------(EOF)---
participants (3)
-
Duncan Mac-Vicar Prett
-
Jano Kupec
-
Volker Kuhlmann