This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [PATCH 4/4] setup.exe
>From ead437489d0873f983103cef24b708af18a9a391 Mon Sep 17 00:00:00 2001
From: Achim Gratz
Date: Fri, 18 Jan 2013 17:05:52 +0100
Subject: [PATCH 4/4] Allow a different basename (instead of "setup")
* setup/ini.h: Modify macro definition to pick up name from external
variable SetupBaseName instead of string constant.
* setup/main.cc: New string option "-I" aka "--ini-basename" to feed
basename into setup and default to "setup". Copy resulting string
to the exported variable SetupBaseName.
---
setup/ini.h | 6 ++++--
setup/main.cc | 5 +++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/setup/ini.h b/setup/ini.h
index 7276e0a..cf26aa1 100755
--- a/setup/ini.h
+++ b/setup/ini.h
@@ -39,8 +39,10 @@ typedef enum
} excludes;
extern bool is_legacy;
-#define SETUP_INI_FILENAME (is_legacy ? "setup-legacy.ini" : "setup.ini")
-#define SETUP_BZ2_FILENAME (is_legacy ? "setup-legacy.bz2" : "setup.bz2")
+
+#define SETUP_INI_FILENAME (is_legacy ? "setup-legacy.ini" : (std::string(SetupBaseName)+".ini").c_str())
+#define SETUP_BZ2_FILENAME (is_legacy ? "setup-legacy.bz2" : (std::string(SetupBaseName)+".bz2").c_str())
+extern std::string SetupBaseName;
/* The following three vars are used to facilitate error handling between the
parser/lexer and its callers, namely ini.cc:do_remote_ini() and
diff --git a/setup/main.cc b/setup/main.cc
index dc73936..b71cb63 100755
--- a/setup/main.cc
+++ b/setup/main.cc
@@ -67,6 +67,7 @@ static const char *cvsid =
#include "getopt++/GetOption.h"
#include "getopt++/BoolOption.h"
+#include "getopt++/StringOption.h"
#include "Exception.h"
#include <stdexcept>
@@ -91,6 +92,8 @@ bool is_legacy;
static BoolOption UnattendedOption (false, 'q', "quiet-mode", "Unattended setup mode");
static BoolOption PackageManagerOption (false, 'M', "package-manager", "Semi-attended chooser-only mode");
static BoolOption HelpOption (false, 'h', "help", "print help");
+static StringOption SetupBaseNameOpt ("setup", 'I', "ini-basename", "Use a different basename instead of setup", false);
+std::string SetupBaseName;
static BOOL WINAPI (*dyn_AttachConsole) (DWORD);
static BOOL WINAPI (*dyn_GetLongPathName) (LPCTSTR, LPTSTR, DWORD);
@@ -289,6 +292,8 @@ WinMain (HINSTANCE h,
if (unattended_mode || HelpOption)
set_cout ();
+ SetupBaseName = SetupBaseNameOpt;
+
LogSingleton::SetInstance (*(theLog = LogFile::createLogFile ()));
const char *sep = isdirsep (local_dir[local_dir.size () - 1]) ? "" : "\\";
theLog->setFile (LOG_BABBLE, local_dir + sep + "setup.log.full", false);
--
1.8.1.1
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada