This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: AW: [PATCH] setup - help and local dir command line optionswas"Re: Setup Command Line Options"

> > On Sat, 2003-10-25 at 22:23, Ralf Habacker wrote:
> > > > This is in the wrong place: LocalDirSetting::load is the
> > right method to
> > > > query the option from.
> > > >
> > > While thinking about this a while more, I recognized that there
> > is some more
> > > basic work necessary how to design the command line interface.
> > > Are there any other requests or hints about the design ?
> >
> > I've roughed stuff out here before, I think. Anywhere, here goes a quick
> > brain dump.
> >
> I need more time to think about what you have written and how to
> start with which class,
I have take some time to inspect how it could be go and have build a
testcase to see what kind of api is needed. Please note that I am
concentrated only to get a command line version initial running, so I've
removed the not needed gui stuff.  Currently I can't send in a patch for
this, because I have splitted the relating engine files into subdir and
build a static library to allow file including checks, although the binariy
and sources could be downloaded  here:


I have done the following steps to get a compiled exe.

cd .../setup_new
mkdir debug
cd debug
../configure CXX="g++ -mno-cygwin" CC="gcc -mno-cywin"
cd engine

This will build the library and the enginetest applications, which has some
basic functionality like:

enginetest-0.0.1.exe --query --all 			-> list all installed packages
enginetest-0.0.1.exe --query --list <packagename> 	-> list all files of the
installed package

The main problem after finding where to remove/hack the gui related stuff,
is to detect the needed objects/method for the requested operation. Is is
sometimevery hard to follow the current code base and some light for this
would be nice, so it there is someone how can give me some more informations
(ideal would be some basic coding like mentioned below) it would be nice.

For the currently implemented (and some more I'm going to implement)
functions the used objects/methods are listed below

	if (QueryPackageOption) {
		if (ListAllPackagesOption) {
			packagedb db;
			db.listAllPackages(cout);	[new method of packagedb]

		if (ListFilesInPackagesOption) {
			packageversion pkg = cygpackage::createInstance(argv[optind]);
			String s = pkg.getfirstfile();
			while (s.size() > 0) {
				cout << " " << s.cstr() << endl;
				s = pkg.getnextfile();
	site list handling
		- list all mirrors
		- allow user to choose one mirror

	related functions/classes/methods

		// clear selected mirror
		site_list.clear ();
		get_site_list("";); [uses
parameter instead of using LoadString()]
		// iterate throug the site lists.
  		for (SiteList::const_iterator n = site_list.begin (); n != site_list.end
(); ++n)

		// set used mirror
		site_list = all_site_list[mirror];

	install/reinstall/upgrade/remove packages

		static BoolOption DownloadOption (false, 'D', "download", "Download from
		static BoolOption LocalOption (false, 'L', "local-install", "Install from
local directory");
		static BoolOption InstallOption (false, 'I', "install", "Install from

		static StringOption SourceURLOption (false, 'S', "source-packages",
"source package path (http,ftp,file,rsync,...)");
		static BoolOption InstallOption (false, 'i', "install", "Install");
		static BoolOption InstallOption (false, 'e', "erase", "erase package");
		static BoolOption InstallOption (false, 'u', "upgrade", "upgrade
		static BoolOption InstallOption (false, 'f', "fresh", "reinstall

	  if (DownloadOption)
    else if (LocalOption)
	source = IDC_SOURCE_CWD;

	  packagedb db;
	  db.task =  source == IDC_SOURCE_DOWNLOAD ? PackageDB_Download :

	How it goes on


Any comments ?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]