Mail Archives: cygwin-developers/2000/08/22/14:40:06
> ALSO: You offered hints re. setup programming. I would like to take
> a look at this. Thanks.
Here are hints for the chooser projects. If you want hints for other
projects, read the README and ask for the ones you're interested in
(ask on cygwin-developers). Remember, patches of any size are
appreciated. If you want to tackle just a tiny project (or a tiny
part of a big project), go ahead.
Most of the interesting bits are in in winsup/cinstall/choose.cc
create_listview() is where the initial settings are done, note at the
end it calls set_full_list() and default_trust(). Probably in
do_choose() it needs to read config files (like /etc/setup/chosen), do
the dialog stuff, and then save the config files.
I'm thinking the config file would have one line for the "default"
trust, followed by one line per package that was skipped (the
installed ones are stored in installed.db). When next setup runs, it
scans the list of skipped packages, and defaults those to be skipped
this time around (that way you don't have to keep remembering to
re-skip them). The call to default_trust() in create_listview() needs
to use the value stored in the file somehow.
Sample file /etc/setup/chosen:
default_trust curr
skip ash
skip bison
...
Make sure you ignore lines you don't recognize, for future expansion.
There's also an '#if 0' that disables the "uninstall" option.
Uninstalling should note the file is to be skipped also. If you want
to enable uninstalling, you need to enable the option in choose.cc,
and process it in install.cc (by gzreading /etc/setup/package.lst.gz
and removing all the files listed there, and then removing directories
listed there *if* they're empty).
Note that install.cc should read those files anyway; if a newer
package no longer includes a file the old package included, the
obsolete files should be removed.
To add an option to setup.ini to make a package default to skip if
it's not already installed, you need to add such a command to inilex.l
and iniparse.y, the field to ini.h, and initialize it appropriately in
fromcwd.cc in case we don't have a setup.ini (if the default is "0"
it's a lot easier). Then, in choose.cc (probably in default_trust())
you need to select the TRUST_KEEP or TRUST_NONE option for those.
The field can either be package-specific or version-specific. I'm not
sure it makes sense to be version-specific.
- Raw text -