[Bug 801920] New: kiwi: add option to select zypper's download mode
https://bugzilla.novell.com/show_bug.cgi?id=801920 https://bugzilla.novell.com/show_bug.cgi?id=801920#c0 Summary: kiwi: add option to select zypper's download mode Classification: openSUSE Product: openSUSE.org Version: unspecified Platform: Other OS/Version: Other Status: ASSIGNED Severity: Enhancement Priority: P5 - None Component: System Imaging AssignedTo: ms@suse.com ReportedBy: ms@suse.com QAContact: adrian@suse.com Found By: --- Blocker: --- --download <mode> Use the specified download-and-install mode. Available modes are: only, in-advance, in-heaps, as-needed. See corresponding --download-<mode> options for their description. kiwi uses the default mode right now. It might be useful to allow other modes as well -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c1
--- Comment #1 from Marcus Schaefer
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c2
Robert Schweikert
<packaManagerOption name=".....">.......</packageManagerOption> The option in question only applies to zypper, and in particular only to the install subcommand of zypper (in contrast to e.g. addrepo), so a future-proof
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c3
--- Comment #3 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c4
--- Comment #4 from Robert Schweikert
I could look into kiwi's xml parsing mechanisms and try to rewrite the patch such that it uses an entry in config.xml.
Well the XML is in flux right now and it will be difficult to add new stuff for a while.
Marcus, what do you think?
<packaManagerOption name=".....">.......</packageManagerOption> The option in question only applies to zypper, and in particular only to the install subcommand of zypper (in contrast to e.g. addrepo), so a future-proof option name would probably be "zypperInstallDownloadMode" or something like that.
Yes, this option only applies to zypper, but every package manager we support has a plethora of command line options. Today you need --download-<mode> someone else will need --another-option tomorrow. It is not reasonable to expect for kiwi to parse them all and pass them along to the various package managers. Thus from a kiwi perspective we have to find a way to generalize the concept such that it can be applied in a general sense. The general concept is reasonably obvious as "Influence package manager behavior", based on what we already have the next level is also reasonably obvious "support in the XML" however, the details are not necessarily very obvious. Currently I would lean toward letting the user provide a package manager options file at the top level of the configuration directory and encode the name of the file in the XML. But I have not thought through the consequences this or a enumerated option where each option passed shows up in the XML. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
Currently I would lean toward letting the user provide a package manager options file at the top level of the configuration directory and encode the name of the file in the XML. But I have not thought through the consequences this or a enumerated option where each option passed shows up in the XML. I can only speak for zypper here: Its behaviour is essentially controlled by /etc/zypp/zypp.conf (and to some extent by /etc/zypp/zypper.conf), so it would
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c5
--- Comment #5 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c6
--- Comment #6 from Robert Schweikert
https://bugzilla.novell.com/show_bug.cgi?id=801920 https://bugzilla.novell.com/show_bug.cgi?id=801920#c7 --- Comment #7 from Yarny Yarny2013-02-06 09:08:04 UTC --- > The kiwi code can simply parse the file and add each option (if not already > used by kiwi itself) to the command line when the package manager is invoked. > This is very generic and could work for any package manager. Hmmmmm, how about this: * An entry under : filename * The referenced file is ini-style: [install] force-resolution download=as-needed The section install refers to the "install" subcommand of zypper. The key without value will be translated into the argument "--force-resolution", the key-value pair will be translated into the arguments ("--download","as-needed"). We have to discriminate between the zypper subcommands; we might do it inside the options file, or as part of config.xml. If the options file is interpreted as options file for zypper or for something else depends on which package manager is picked (with theblabla setting). Alternatively we can add a "packageManager"-key to theelement which ensures the options file is honored only if the respective package manager is used. What do you think? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[zypper] verbose= [install] download=as-needed will add "--verbose" to /every/ zypper command line (somewhere before the subcommand), and "--download as-needed" whenever zypper is called with the "install" subcommand. Hence it yields command lines like zypper --root /bla/bla --verbose install --auto-agree-with-licenses --download as-needed some_package. If this is acceptable to you I can add some lines of documentation to the
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c8
--- Comment #8 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c9
--- Comment #9 from Robert Schweikert
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c10
--- Comment #10 from Marcus Schaefer
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c11
Marcus Schaefer
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c12
Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c13
--- Comment #13 from Marcus Schaefer
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c14
Marcus Schaefer
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c15
--- Comment #15 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c16
--- Comment #16 from Robert Schweikert
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c17
--- Comment #17 from Yarny Yarny
Rather than __generate... you want to implement a __getCmdArgsFromCfgFile method that delivers the arguments as a string. The string usage is more flexible as we can use it in concatenation. I did this to anticipate situations where the Manager-class requires arguments as array of strings instead of a single string --- I figured the transformation into a single string is easier than the reconstruction of the array. If this is never needed, I can certainly create a single string in this method.
There is an issue in the case where the preferences from the user description get merged with the boot image description. In this case the name of the package manager config file will be defined, but the boot image description will not contain the file, thus "tie %cfgini, 'Config::IniFiles', ...." will probably fail in some weird way. There is no protection against this case. I don't see an easy solution to this ... honestly, I don't fully understand the problem. So kiwi "internally" creates another config.xml when the boot image is about to be set up, and this is a mixture of the user-specified config.xml and some other config.xml? Following our current path, we would need to add code which copies the packagemanager-configfile to the place where this intermediate config.xml is stored, I guess. To me, this idea sounds quite fragile.
Would it be easier to move the complete packagemanager configuration into the config.xml itself? We already discussed the idea in Comment #3 and Comment #4 to add something like
<packaManagerOption name=".....">.......</packageManagerOption> But this is probably too package-manager-specific. I'd like to propose two alternatives: I. <packageManagerArguments subcommand="install">--download as-needed --force-resolution</packageManagerArguments> <packageManagerArguments>--verbose</packageManagerArguments> i.e. put the additional command-line argument string between xml tags and use some "subcommand" attribute to determine which string is to be used, or II. <packageManagerConfiguration> [zypper] verbose= [install] download=as-needed force-resolution= </packageManagerConfiguration> i.e. just put the ini-file-content between two xml tags. Would this solve the boot-image-problem? Would it cause other problems which I currenly miss to see?
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c18
--- Comment #18 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c19
--- Comment #19 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c20
--- Comment #20 from Robert Schweikert
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c21
--- Comment #21 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c22
--- Comment #22 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=801920
https://bugzilla.novell.com/show_bug.cgi?id=801920#c23
--- Comment #23 from Robert Schweikert
http://bugzilla.novell.com/show_bug.cgi?id=801920
--- Comment #24 from Yarny Yarny
http://bugzilla.novell.com/show_bug.cgi?id=801920
Yarny Yarny
participants (1)
-
bugzilla_noreply@novell.com