Bug 970488

Summary: yast-packager: repos added twice
Product: [openSUSE] openSUSE Distribution Reporter: Ludwig Nussel <lnussel>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P2 - High CC: hguo, jreidinger, lslezak, ma
Version: Leap 42.1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/XdeDkNzH
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ludwig Nussel 2016-03-10 14:00:59 UTC
In openSUSE there are two sources of repos hat can get added during
or after installation:

a) control.xml¹
b) download.opensuse.org²

The former specifies an alias that is also used as file name in
/etc/zypp/repos.d, the latter not. So when using
inst_productsources.rb either during installation or in the running
system, it is possible to add e.g. the oss repo twice, ending up
with different names³. That is confusing and unnecessary. So I'd like to
request an alias field there to allow for consistent naming with control.xml.

Alternatively and/or additionally make inst_productsources.rb read
control.xml and merge with the repo list acquired online.

[1] https://github.com/yast/skelcd-control-openSUSE/blob/master/control/control.openSUSE.xml#L136
[2] https://github.com/openSUSE/download.o.o/blob/master/YaST/Repos/_openSUSE_Leap_42.1_Default.xml
[3] https://openqa.opensuse.org/tests/128785/modules/zypper_lr/steps/1
Comment 1 Stefan Hundhammer 2016-03-10 15:42:33 UTC
Michael, Ladislav, any thoughs?
Comment 2 Stefan Hundhammer 2016-03-10 15:43:04 UTC
...thoughts, of course
Comment 3 Ladislav Slezák 2016-03-14 09:06:13 UTC
Yes, the code should check for duplicates. I think we should rather check the URL instead of the alias.
Comment 4 Stefan Hundhammer 2016-03-14 14:10:46 UTC
Now tracking in Trello:

  https://trello.com/c/cGz7tSx3
Comment 5 Ludwig Nussel 2016-04-13 15:19:44 UTC
So what is the ETA for this? I'd really like to see this fixed for 42.2
Comment 7 Lukas Ocilka 2016-07-26 15:18:46 UTC
The item will be planned according to priorities, no ETA yet
Comment 8 Josef Reidinger 2016-08-17 13:19:47 UTC
Well, there should be already duplicate check see https://github.com/yast/yast-packager/blob/master/src/clients/inst_productsources.rb#L355

I will try to reproduce it locally, from given screenshot I see that only duplicate is update channel and in one case it contain trainling slash and in second not.
Comment 9 Josef Reidinger 2016-08-17 13:52:22 UTC
OK, problem is actually in inst_extrasources client, where detection of already registered url failed. Will debug it deeper there and try to fix it.
Comment 10 Josef Reidinger 2016-08-17 13:56:04 UTC
yep, problem is in normalization of url, so one contain "/" at the end and second not. I will fix code to avoid such problems.
Comment 11 Josef Reidinger 2016-08-18 11:16:13 UTC
fixed in https://github.com/yast/yast-installation/pull/420
Comment 12 Josef Reidinger 2016-08-18 11:16:55 UTC
and close it. Fix done for TW, 42.2 and SP2. As it is in insts-sys, it do not make sense to do maintenance update.