This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH] Setup.exe: restore commandline localdir option.
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin-apps <cygwin-apps at cygwin dot com>
- Date: Wed, 04 Nov 2009 17:47:21 +0000
- Subject: [PATCH] Setup.exe: restore commandline localdir option.
Hi again!
During the recent rejig of settings handling, the command-line "-l" option
(aka "--local-package-dir") got borked. This patch restores it, but it might
not be quite what's wanted, because it changes the semantics slightly; that's
just the way I happened to want it to work for the stuff I was developing when
I noticed this bug, so I've sent it that way; it would be equally trivial to
restore the original semantics if that's preferred.
In the original semantics, -l specifies a local package dir to use,
overriding any existing local package dir stored in the user settings. In the
new semantics, if there is an existing local package dir on the machine, that
takes priority. Like I said, that's just the way I wanted it for my purposes,
so I didn't have to bother checking (in my enclosing installer, I'm a 3PP :-O
now!) if there already was one and setting the -l option I invoke setup.exe
with differently. For upstream setup.exe, we probably want to keep the
original semantics but I thought I'd throw it open.
* localdir.cc (LocalDirSetting::LocalDirSetting): Restore -l option.
OK this way? Or the other way round, with the check for LocalDirOption
moved before the check for last-cache, as it was in the original semantics?
cheers,
DaveK
Index: localdir.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/localdir.cc,v
retrieving revision 2.29
diff -p -u -r2.29 localdir.cc
--- localdir.cc 4 Nov 2009 15:14:51 -0000 2.29
+++ localdir.cc 4 Nov 2009 16:32:42 -0000
@@ -64,6 +64,8 @@ LocalDirSetting::LocalDirSetting ()
const char *fg_ret;
if ((fg_ret = UserSettings::instance().get ("last-cache")))
local_dir = std::string (fg_ret);
+ else if (std::string (LocalDirOption).size ())
+ local_dir = std::string (LocalDirOption);
}
void