Bug 954117

Summary: YaST does not honor value of solver.allowVendorChange
Product: [openSUSE] openSUSE Tumbleweed Reporter: Cristian ANITA <cristian_anita>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: ancor, cristian_anita, gs, mvidner
Version: CurrentFlags: gs: needinfo? (cristian_anita)
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
URL: https://trello.com/c/UwBEdMBN
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Text mode package selector

Description Cristian ANITA 2015-11-07 22:52:50 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build Identifier: 

I am using openSUSE Tumbleweed 20151106 x86_64 and "Allow Vendor Change" in yast, "Online Update" and "Software Management" modules, is not persistent.
It works in openSUSE 13.2 (Tumbleweed bug).

Reproducible: Always

Steps to Reproduce:
1. open yast then launch "Online Update" or "Software Management" module
2. go to Options menu and check "Allow Vendor Change"
3. close module then open again
Actual Results:  
"Allow Vendor Change" is not checked

Expected Results:  
"Allow Vendor Change" is checked

Notes:
- setting solver.allowVendorChange = true in /etc/zypp/zypp.conf is also not reflected in yast UI.
- especially in Tumbleweed where update is frequent it is easy to forget to check this options every time.

Versions:
yast2core-3.1.18, yast2-3.1.155, yast2-packager-3.1.83
Comment 1 Ancor Gonzalez Sosa 2015-11-09 14:40:38 UTC
According to the Changelog of the package libyui-qt-pkg, making the change not persistent is intentional. See entry from June 22th at
https://build.opensuse.org/package/view_file/openSUSE:Factory/libyui-qt-pkg/libyui-qt-pkg.changes?expand=1

I'm checking why solver.allowVendorChange is not honored in the UI, which probably is not intentional.
Comment 2 Ancor Gonzalez Sosa 2015-11-09 14:53:03 UTC
Looks like in this commit, the reading of solver.allowVendorChange was deleted. Looks like a bug to me.

https://github.com/libyui/libyui-qt-pkg/commit/fc38b5083c9bfa723adb9e3f4dcddb7043b
Comment 3 Ancor Gonzalez Sosa 2015-11-09 15:16:40 UTC
The ncurses interface does not honor the setting in solver.allowVendorChange. After the mentioned commit, the Qt interface also ignores it. So from some point of view, the commit addressed the original issue (inconsistent behavior between both interfaces)... but in the wrong direction. :-)

The real solution would be fixing BOTH ncurses and qt interfaces to read the value of "allow vendor change" on startup from /etc/zypp. But changes in YaST UI (both ncurses and Qt) will remain non-persistent.
Comment 4 Cristian ANITA 2015-11-09 17:32:50 UTC
More details about behavior on openSUSE 13.2:
- I did not tested if setting solver.allowVendorChange = true in /etc/zypp/zypp.conf is reflected in yast UI (and I do not have openSUSE 13.2 now to test).
- "Allow Vendor Change" in both "Online Update" and "Software Management" modules, is persistent but independent (each module has its own setting)

My opinion/suggestion from user/usability point of view: regardless of UI (ncurses, gtk, qt) and module ("Online Update" or "Software Management") there should be only one setting (solver.allowVendorChange = true/false in /etc/zypp/zypp.conf). This setting should be read/write (persistent) from all above components.
Making the setting not persistent will force users to edit zypp.conf in terminal (and if we want to "convert" Windows users we should be able to do more things that can be done in terminal also from GUI).
Comment 5 Lukas Ocilka 2015-11-10 06:50:34 UTC
I failed to find out why:

- made "Cleanup when deleting packages" and "Allow vendor change"
    not persistent.

Not knowing that "Allow vendor change" can be set in zypp.conf, false is the
safe default.

"Cleanup when deleting packages" has also entry in zypp.conf, but it's even
more dangerous. Both options are marked as for "experts only".

Martin, do you remember where we documented our decision to make these
two not persistent?
Comment 6 Gabriele Mohr 2015-11-10 08:51:23 UTC
In general: it shouldn't be necessary to set the "Allow vendor change" option to true for an (tumbleweed) update.

For explanation why we changed the behaviour not to save the options "Allow Vendor Change" and "Cleanup when deleting packages", see bnc #948134, comment #9.

I have checked the behaviour on Tumbleweed 20151014. Setting solver.allowVendorChange in /etc/zypp/zypp.conf is respected in YaST ncurses package selector (see screenshot) but AFAICS doesn't work in Qt UI.
Comment 7 Gabriele Mohr 2015-11-10 08:53:10 UTC
Created attachment 655312 [details]
Text mode package selector
Comment 8 Gabriele Mohr 2015-11-10 10:56:38 UTC
If you want to follow Tumbleweed you can use 'zypper dup', means do a distribution upgrade. For an upgrade, either YaST Upgrade or 'zypper dup', its by default allowed to change the vendor, the architecture, downgrade package versions....
New options are added to /etc/zypp/zypp.conf which only concern the upgrade (dupAllow...). To have the possibility to protect e.g. packages from an external repository during an upgrade you can change the behaviour with these options, 
see https://discourse.nordisch.org/t/living-on-tumbleweed/379.
Comment 9 Martin Vidner 2015-11-18 13:41:33 UTC
Comment 5:
> I failed to find out why:
> - made "Cleanup when deleting packages" and
>   "Allow vendor change" not persistent.

Basically, Gabi and Michael Andres discussed the flags and said we should not store these two flags. And I was a bit too quick in simply implementing it without asking for the rationale and reviewing it.

I think we should elaborate on this explanation from https://bugzilla.novell.com/show_bug.cgi?id=948134#c9 and give an example of the damage that we are trying to avoid:
"The reason is to prevent unintentional deletion of packages (or installation from a different repository in case of vendor change).
The libzypp default of these options is 'false' and the comments in /etc/zypp/zypp.conf warn that "CHANGING THE DEFAULT IS NOT RECOMMENDED" because of the risk of damage the system."
Comment 10 Gabriele Mohr 2015-11-19 08:21:35 UTC
Could you please check/confirm whether 'zypper dup' works for you (comment#8).

As mentioned in comment#6 for the update case a vendor change is usually not necessary or even unwanted.

The upgrade is handled differently and should work for you when using 'zypper dup' or the YaST Upgrade workflow.
Comment 11 Gabriele Mohr 2015-11-26 08:50:15 UTC
(In reply to Cristian ANITA from comment #4)
> More details about behavior on openSUSE 13.2:
> - I did not tested if setting solver.allowVendorChange = true in
> /etc/zypp/zypp.conf is reflected in yast UI (and I do not have openSUSE 13.2
> now to test).
> - "Allow Vendor Change" in both "Online Update" and "Software Management"
> modules, is persistent but independent (each module has its own setting)
> 
> My opinion/suggestion from user/usability point of view: regardless of UI
> (ncurses, gtk, qt) and module ("Online Update" or "Software Management")
> there should be only one setting (solver.allowVendorChange = true/false in
> /etc/zypp/zypp.conf). This setting should be read/write (persistent) from
> all above components.

The current (Leap42.1/Tumbleweed/SLES12 SP1) behaviour is like this:

- "Online Update" and "Software Management" have/read/write same settings
  (should be like this also on 13.2)

- The Qt and ncurses (text mode) UI respect same config files:
 
  * /etc/sysconfig/yast2 contains options which can be (persistently) set in UIs
    (PKGMGR_AUTO_CHECK, PKGMGR_VERIFY_SYSTEM, PKGMGR_RECOMMENDED)
  
  * /etc/zypp/zypp.conf is read (in textmode UI) to have initial value for
    options "Allow vendor change" and "Cleanup when deleting packages" 
    (Qt UI is fixed now, see below).
    These options can be changed in UIs only for one run. This is intended
    because setting true for vendor change persistently (and possible
    forget about it) might lead to unwanted behaviour that packages from an 
    external repo are overwritten by update packages. Also it's risky to
    delete all depending packages unless explicitly wanted.


The bug-fix for Qt UI to respect the settings 'allowVendorChange' and 'cleandepsOnRemove' from /etc/zypp/zypp.conf will be available with libyui-qt-pkg-2.45.6. 
 
> Making the setting not persistent will force users to edit zypp.conf in
> terminal (and if we want to "convert" Windows users we should be able to do
> more things that can be done in terminal also from GUI).

As mentioned before: for an update it's not necessary to allow a vendor change, for the upgrade case it's allowed by default.
Comment 12 Gabriele Mohr 2015-11-26 10:37:46 UTC
The behaviour for "Allow vendor change" and "Cleanup when deleting packages" options is intended, Qt and text mode YaST (gtk isn't supported any longer) read same config files and libyui-qt-pkg-2.45.6 contains the bug-fix.

Setting status to resolved, please reopen if you see still problems.