delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/08/22/14:40:06

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Tue, 22 Aug 2000 14:38:17 -0400
Message-Id: <200008221838.OAA23309@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: superbiskit AT home DOT com
CC: cygwin-developers AT sources DOT redhat DOT com
In-reply-to: <39A2BD45.9A0BD617@home.com> (superbiskit@home.com)
Subject: Re: new setup: chooser
References: <200008220058 DOT UAA32307 AT envy DOT delorie DOT com> <200008221415 DOT IAA14427 AT wolf DOT cimsoft DOT com> <200008221443 DOT KAA21336 AT envy DOT delorie DOT com> <39A2BD45 DOT 9A0BD617 AT home DOT com>

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019