This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Configtool to convert repository directory to POSIX format
- From: John Dallaway <jld at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Wed, 14 May 2003 19:34:57 +0100
- Subject: Configtool to convert repository directory to POSIX format
- Organization: eCosCentric Limited
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.57
diff -u -5 -r1.57 ChangeLog
--- ChangeLog 14 May 2003 12:20:15 -0000 1.57
+++ ChangeLog 14 May 2003 16:29:55 -0000
@@ -1,7 +1,15 @@
2003-05-14 John Dallaway <jld@ecoscentric.com>
+ * standalone/common/ecosconfig.cxx,
+ standalone/wxwin/configtooldoc.cpp,
+ standalone/wxwin/admindlg.cpp: Convert native Windows format
+ repository specifications to POSIX format in Cygwin builds, as now
+ required by the CDL library.
+
+2003-05-14 John Dallaway <jld@ecoscentric.com>
+
* standalone/wxwin/admindlg.cpp,
standalone/wxwin/buildoptionsdlg.cpp,
standalone/wxwin/configtool.cpp,
standalone/wxwin/configtoolview.cpp,
standalone/wxwin/pacakgesdlg.cpp,
Index: standalone/common/ecosconfig.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/common/ecosconfig.cxx,v
retrieving revision 1.12
diff -u -5 -r1.12 ecosconfig.cxx
--- standalone/common/ecosconfig.cxx 31 Mar 2003 18:11:01 -0000 1.12
+++ standalone/common/ecosconfig.cxx 14 May 2003 16:29:55 -0000
@@ -1,9 +1,10 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
// Copyright (C) 2003 Bart Veer
+// Copyright (C) 2003 John Dallaway
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it
@@ -253,10 +254,19 @@
break;
}
}
}
}
+
+ // convert a DOS format repository directory to POSIX format for backward compatibility (Cygwin only)
+#ifdef __CYGWIN__
+ if (1 < repository.size() && ':' == repository [1]) {
+ char buffer [MAX_PATH + 1];
+ cygwin_conv_to_posix_path (repository.c_str (), buffer);
+ repository = buffer;
+ }
+#endif
// Initialize the cdl_exec code (not quite sure why this needs a
// separate object rather than just a bunch of statics).
cdl_exec exec (trim_path (repository), savefile, trim_path (install_prefix), no_resolve);
cdl_exec::set_quiet_mode(quiet);
Index: standalone/wxwin/configtooldoc.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtooldoc.cpp,v
retrieving revision 1.14
diff -u -5 -r1.14 configtooldoc.cpp
--- standalone/wxwin/configtooldoc.cpp 19 Mar 2003 17:39:06 -0000 1.14
+++ standalone/wxwin/configtooldoc.cpp 14 May 2003 16:30:17 -0000
@@ -894,11 +894,11 @@
} else
{
// create a CDL repository, interpreter and configuration
try {// create a new package database, interpreter and configuration
- NewCdlPkgData = CdlPackagesDatabaseBody::make ((const wxChar*) strNewPackagesDir, &CdlParseErrorHandler, &CdlParseWarningHandler);
+ NewCdlPkgData = CdlPackagesDatabaseBody::make ((const wxChar*) ecUtils::NativeToPosixPath(strNewPackagesDir), &CdlParseErrorHandler, &CdlParseWarningHandler);
NewCdlInterp = CdlInterpreterBody::make ();
NewCdlConfig = CdlConfigurationBody::make ("eCos", NewCdlPkgData, NewCdlInterp);
}
catch (CdlStringException exception)
{
Index: standalone/wxwin/admindlg.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/admindlg.cpp,v
retrieving revision 1.8
diff -u -5 -r1.8 admindlg.cpp
--- standalone/wxwin/admindlg.cpp 14 May 2003 12:20:15 -0000 1.8
+++ standalone/wxwin/admindlg.cpp 14 May 2003 16:30:19 -0000
@@ -450,11 +450,11 @@
// load the package database
try
{
// Cdl asserts unless the handlers are present.
- m_CdlPkgData = CdlPackagesDatabaseBody::make (ecUtils::UnicodeToStdStr (packageDatabase), &CdlErrorHandler, &CdlWarningHandler);
+ m_CdlPkgData = CdlPackagesDatabaseBody::make (ecUtils::UnicodeToStdStr (ecUtils::NativeToPosixPath (packageDatabase)), &CdlErrorHandler, &CdlWarningHandler);
}
catch (CdlStringException exception)
{
wxString strMessage;
strMessage.Printf (_("Error loading database:\n\n%s"), (const wxChar*) wxString (exception.get_message ().c_str ()));