Mantis - pkg_get
Viewing Issue Advanced Details
4045 regular use feature N/A 2009-11-17 13:30 2010-03-12 15:56
skayser  
bonivart  
low  
closed  
fixed  
none    
none  
0004045: RFE: Override configuration parameters on the commandline (via --param?)
For testing and various other purposes i sometimes fiddle with configuration settings in pkgutil.conf. How about introducing a command line option to do this on-the-fly?

A somewhat limited use case example to illustrate the RFE:

$ pkgutil -V | grep noncsw
noncsw true (default: false)

Now to compare only CSW cups packages i would do

$ pkgutil -c cups | grep CSW

With --param i could also do

$ pkgutil --param noncsw=false -c cups

and have pkgutil filter the pkg list right away. I know, it is longer to type, but the general ability to change and test settings on the fly feels helpful to me. I don't know whether this can be easily implemented for all possible parameters (also future ones) so that this doesn't result in more work when you implement additional parameters. Wishlist item.
# pkgutil -v
1.8
has duplicate 0004302closed bonivart provide a command-line switch for use_gpg configuration option 
Issue History
2009-11-17 13:30 skayser New Issue
2009-11-17 17:39 bonivart Status new => assigned
2009-11-17 17:39 bonivart Assigned To => bonivart
2010-02-23 17:49 bonivart Relationship added has duplicate 0004302
2010-03-01 16:30 bonivart Note Added: 0007554
2010-03-01 16:31 bonivart Note Added: 0007555
2010-03-01 16:31 bonivart Status assigned => feedback
2010-03-02 11:00 skayser Note Added: 0007563
2010-03-02 11:03 skayser Note Added: 0007564
2010-03-02 18:41 bonivart Note Added: 0007568
2010-03-12 15:56 bonivart Note Added: 0007623
2010-03-12 15:56 bonivart Status feedback => closed
2010-03-12 15:56 bonivart Resolution open => fixed

Notes
(0007554)
bonivart   
2010-03-01 16:29   
r205 contains this feature. Actually adding this option is a good way to hinder option creep since it makes configuration file options accessible from the command line, otherwise people would ask for equivalent command line options all the time, now I can refer them to -p. :-)

Due to how the parsing works these two types are the ways to specify this option (multiples are allowed):

# pkgutil -p use_gpg:false --param=use_md5:false -V

The colon separator is the same as is used when specifying arch and release for the --target option. Options that contain space separated items must be quoted:

# pkgutil -p exclude_pattern:"foo bar" -V

Another way of doing what you want here is to have a custom pkgutil.conf file that you specify with --config. I'm implementing this anyway since it's generic functionality. I have another similar request from 0004302 as well, he accepted this generic solution to his specific request.
(0007555)
bonivart   
2010-03-01 16:31   
See previous note.
(0007563)
skayser   
2010-03-02 11:00   
Cool, thanks for integrating this command line option. Tested with r210 and all the configuration parameters listed below "Configuration" from the pkgutil -V output. Works for all parameters except for pkgliststyle.

# ~skayser/bin/pkgutil-r210 -p pkgliststyle:0 -V | grep ^pkgliststyle
pkgliststyle 1 (default: 0)
# grep Id ~skayser/bin/pkgutil-r210
# $Id: pkgutil 210 2010-03-01 19:16:46Z bonivart $
(0007564)
skayser   
2010-03-02 11:03   
Have to correct myself, -p only doesn't work with pkgliststyle when pkgliststyle is configured to 1 and I want to set it to 0 on the fly. The other way round works.

# grep pkgliststyle /etc/opt/csw/pkgutil.conf
pkgliststyle=0
# ~skayser/bin/pkgutil-r210 -p pkgliststyle:1 -V | grep ^pkgliststyle
pkgliststyle 1 (default: 0)

Maybe that's something that affects more than just pkgliststyle?
(0007568)
bonivart   
2010-03-02 18:41   
It should only affect pkgliststyle. Your override to zero wasn't picked up because it was considered false in the test, I now test if it's been defined regardless of value.

Fix in r211.
(0007623)
bonivart   
2010-03-12 15:56   
Implemented in 1.10.