Bug 380322

Summary: missing alias when adding repository cause command to fail
Product: [openSUSE] openSUSE 11.0 Reporter: Pavel Nemec <pnemec>
Component: YaST2Assignee: Josef Reidinger <jreidinger>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: msvec
Version: Alpha 3plus   
Target Milestone: ---   
Hardware: 64bit   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Pavel Nemec 2008-04-16 09:28:32 UTC
accoarding to zypper --help, alias is not mandatory. But if I invoke command without alias, it fail. 
See those two commands, first with alias succeded, second fail.

>zypper ar ftp://sleposlab.suse.cz/install_sources/SLES-10-SP1-DVD-i386-GM-DVD1 sles
* Adding repository 'sles'
Repository 'sles' successfully added
Enabled: Yes
Autorefresh: No
URL: ftp://sleposlab.suse.cz/install_sources/SLES-10-SP1-DVD-i386-GM-DVD1

root@pnemec-testing:/pracovni/kiwi_testing/minimal-3.0.15>zypper ar ftp://sleposlab.suse.cz/install_sources/SLES-10-SP1-DVD-i386-GM-DVD1
File '/install_sources/SLES-10-SP1-DVD-i386-GM-DVD1' not found on medium 'ftp://sleposlab.suse.cz/'

Abort, retry, ignore? [A/r/i]:
Comment 1 Jan Kupec 2008-04-16 12:12:03 UTC
I'll adapt the help text and the man page to reflec the two possible argument variants for addrepo. The one-argument variant expects an URI to a .repo file. The other expects repository URI and an alias. I'll also try to display a meaningful error message if an expected .repo file was not found.
Comment 2 Josef Reidinger 2008-04-18 10:34:27 UTC
fixed in svn

current output (so less confusing I hope):
 ./zypper.sh ar ftp://sleposlab.suse.cz/install_sources/SLES-10-SP1-DVD-i386-GM-DVD1
If only one argument is used, it must be a URI pointing to a .repo file.
addrepo (ar) [options] <URI> <alias>
addrepo (ar) [options] <FILE.repo>

Add a repository to the sytem. The repository can be specified by its URI or can be read from specified .repo file (even remote).

  Command options:
-r, --repo <FILE.repo>  Read the URI and alias from a file (even remote).
-t, --type <TYPE>       Type of repository (yast2, rpm-md, plaindir).
-d, --disable           Add the repository as disabled.
-c, --check             Probe URI.
-x, --no-check           Don't probe URI, probe later during refresh.
Comment 3 Jan Kupec 2008-04-18 11:24:39 UTC
*** Bug 381287 has been marked as a duplicate of this bug. ***
Comment 4 Josef Reidinger 2008-04-29 06:27:27 UTC
done in zypper 0.11.0-8