Bug 648892

Summary: zypper ar obs://something should default to current distro
Product: [openSUSE] openSUSE 11.3 Reporter: Christian Boltz <suse-beta>
Component: libzyppAssignee: Jan Kupec <jkupec>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P4 - Low CC: dimstar
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.3   
Whiteboard: patches-welcome
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Christian Boltz 2010-10-24 21:56:14 UTC
LANG=C zypper ar -f obs://home:cboltz test
Adding repository 'test' [done]
Repository 'test' successfully added
Enabled: Yes
Autorefresh: Yes
URI: http://download.opensuse.org/repositories/home:/cboltz/openSUSE_Factory

# cat /etc/SuSE-release 
openSUSE 11.3 (x86_64)
VERSION = 11.3

zypper should choose download.o.o/$repo/openSUSE_11.3 instead of openSUSE_Factory on my 11.3 system.

Logs on request, however this looks easily reproducable to me.
Comment 1 Michael Andres 2010-10-25 07:31:10 UTC
You can specify it, or configure the default to use on your system. 
[man zypper]: 

... These URIs have the form of
obs://<project>/[platform], where project is the name of the
OBS project and platform is the target platform (OS) for which the
repository is intended. For example: obs://server:http/openSUSE_11.3.

If platform is omitted, zypper.conf's obs.platform value is used.
See also other options in the [obs] section of zypper.conf.
Comment 2 Christian Boltz 2010-10-25 16:58:41 UTC
Good to know there's a config option for it, but this doesn't solve the problem.

Zypper should use a _sane default value_, which is the _currently installed distribution_ (as found in /etc/SuSE-release). Defaulting to Factory (or is it $random?) is just crazy and a good way to break users' systems out there.

Please change the default to the current distribution.

BTW: My zypper.conf has the default of
    [obs]
    ...
    # platform = openSUSE_11.3
The easiest solution would be to ship zypper.conf without this comment sign in front of "platform". That would possibly break on upgrades (reading /etc/SuSE-release is safer), but it's still better than Factory as default value.
Comment 3 Jan Kupec 2010-10-26 13:06:42 UTC
I agree Christian, but i won't have time to do it -> WONTFIX

Patches are welcome, though. See also http://en.opensuse.org/openSUSE:Zypper_bugs_for_adoption
Comment 4 Forgotten User -yQj4fdAjs 2011-07-15 14:13:17 UTC
*** Bug 687440 has been marked as a duplicate of this bug. ***