Thread: SVN Commit by dpage: r4755 - in branches/REL-1_4_0_PATCHES/pgadmin3: . pkg/mac src/base
SVN Commit by dpage: r4755 - in branches/REL-1_4_0_PATCHES/pgadmin3: . pkg/mac src/base
From
svn@pgadmin.org
Date:
Author: dpage Date: 2005-11-25 08:40:06 +0000 (Fri, 25 Nov 2005) New Revision: 4755 Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/Makefile.am branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/complete-bundle.sh branches/REL-1_4_0_PATCHES/pgadmin3/src/base/appbase.cpp Log: Here is a patch to copy pg_dump and pg_restore into $bundledir/Contents/SharedSupport/helper/. pgAdmin3.app should find it there, but I didn't test this yet (I just have access to my build-machine over ssh ATM - I'll need my powerbook to test this). [Florian G. Pflug] Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt =================================================================== --- branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt 2005-11-25 08:36:34 UTC (rev 4754) +++ branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt 2005-11-25 08:40:06 UTC (rev 4755) @@ -7,6 +7,7 @@ <li>AHP - Adam H. Pendleton <li>MP - Marc Persuy <li>DAP - Darko Prenosil + <li>FGP - Florian G. Pflug </ul> <b>Versions and releases</b><br> The following list contains all changes to pgAdmin3, as present in svn. @@ -17,6 +18,7 @@ </ul> <br> <ul> + <li>2005-11-20 FGP 1.4.1 Include pg_dump/pg_restore in the Mac OSX bundle <li>2005-11-20 DP 1.4.1 Use a proper 'Save As' style dialogue for selecting backup files <li>2005-11-20 AP 1.4.1 Don't show pk hint when editing view <li>2005-11-20 AP 1.4.1 Add missing NO ACTION FK constraint Modified: branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/Makefile.am =================================================================== --- branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/Makefile.am 2005-11-25 08:36:34 UTC (rev 4754) +++ branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/Makefile.am 2005-11-25 08:40:06 UTC (rev 4755) @@ -24,5 +24,7 @@ $(install_sh_DATA) "sql.icns" "$(bundledir)/Contents/Resources/sql.icns" $$($(WX_CONFIG) --rezflags | sed 's/-t[[:space:]]*APPL//') \ "$(bundledir)/Contents/Resources/pgAdmin3.rsrc" -useDF + $(install_sh_PROGRAM) "$$($(PG_CONFIG) --bindir)/pg_dump" "$(bundledir)/Contents/SharedSupport/helper/pg_dump" + $(install_sh_PROGRAM) "$$($(PG_CONFIG) --bindir)/pg_restore" "$(bundledir)/Contents/SharedSupport/helper/pg_restore" ./complete-bundle.sh "$(bundledir)" endif Modified: branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/complete-bundle.sh =================================================================== --- branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/complete-bundle.sh 2005-11-25 08:36:34 UTC (rev 4754) +++ branches/REL-1_4_0_PATCHES/pgadmin3/pkg/mac/complete-bundle.sh 2005-11-25 08:40:06 UTC (rev 4755) @@ -10,8 +10,7 @@ echo "Completing bundle: $bundle" cd "$bundle" -fw_basepath=$(dirname $(pwd)) -todo=$(find ./ | \ +todo=$(find ./ -perm +0111 ! -type d | \ xargs --replace=line file 'line' | \ sed -n 's/^\([^:][^:]*\):[[:space:]]*Mach-O executable ppc$/\1/p' | \ xargs echo -n \ @@ -22,6 +21,13 @@ todo_old=$todo ; todo="" ; for todo_obj in $todo_old; do + #Figure out the relative path from todo_obj to Contents/Frameworks + fw_relpath=$(echo "$todo_obj" |\ + sed -n 's|^\(\.//*\)\(\([^/][^/]*/\)*\)[^/][^/]*$|\2|gp' | \ + sed -n 's|[^/][^/]*/|../|gp' \ + )"Contents/Frameworks" + + #Find all libraries $todo_obj depends on, but skip system libraries for lib in $( otool -L $todo_obj | \ sed -n 's|^.*[[:space:]]\([^[:space:]]*\.dylib\).*$|\1|p' | \ @@ -30,22 +36,16 @@ lib_bn="$(basename "$lib")" ; if ! test -f "Contents/Frameworks/$lib_bn"; then echo "Adding library: $lib_bn (because of: $todo_obj)" - case "$lib" in - /*) - cp "$lib" "Contents/Frameworks/$lib_bn" - ;; - *) - cp "$fw_basepath/$lib" "Contents/Frameworks/$lib_bn" - ;; - esac + cp "$lib" "Contents/Frameworks/$lib_bn" + chmod 755 "Contents/Frameworks/$lib_bn" install_name_tool \ - -id "@executable_path/../Frameworks/$lib_bn" \ + -id "$lib_bn" \ "Contents/Frameworks/$lib_bn" || exit 1 todo="$todo Contents/Frameworks/$lib_bn" fi install_name_tool -change \ "$lib" \ - "@executable_path/../Frameworks/$lib_bn" \ + "@executable_path/$fw_relpath/$lib_bn" \ "$todo_obj" || exit 1 done done Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/base/appbase.cpp =================================================================== --- branches/REL-1_4_0_PATCHES/pgadmin3/src/base/appbase.cpp 2005-11-25 08:36:34 UTC (rev 4754) +++ branches/REL-1_4_0_PATCHES/pgadmin3/src/base/appbase.cpp 2005-11-25 08:40:06 UTC (rev 4755) @@ -1,223 +1,220 @@ -////////////////////////////////////////////////////////////////////////// -// -// pgAdmin III - PostgreSQL Tools -// RCS-ID: $Id: misc.cpp 4054 2005-03-28 16:43:01Z andreas $ -// Copyright (C) 2002 - 2005, The pgAdmin Development Team -// This software is released under the Artistic Licence -// -// base.cpp - Miscellaneous Basic Utilities -// -////////////////////////////////////////////////////////////////////////// - -#include "pgAdmin3.h" - -// wxWindows headers -#include <wx/wx.h> -#include <wx/dir.h> -#include <wx/file.h> -#include <wx/socket.h> -#include <wx/xrc/xmlres.h> -#include <wx/stdpaths.h> - -#include "copyright.h" -#include "base/base.h" -#include "base/appbase.h" -#include "base/pgConnBase.h" -#include "base/sysLogger.h" - -wxPathList path; // The search path -wxString loadPath; // Where the program is loaded from -wxString docPath; // Where docs are stored -wxString uiPath; // Where ui data is stored -wxString i18nPath; // Where i18n data is stored -wxLog *logger; - -#define DOC_DIR wxT("/docs") -#define UI_DIR wxT("/ui") -#define I18N_DIR wxT("/i18n") - -#define SCRIPT_DIR wxT("/scripts") -#define HELPER_DIR wxT("/helper") - - -void pgAppBase::InitPaths() -{ - loadPath=wxPathOnly(argv[0]); - if (loadPath.IsEmpty()) - loadPath = wxT("."); - - // Look in the app directory for things first - path.Add(loadPath); - -#if defined(__WXMSW__) - - // Search for the right paths. We check the following locations: - // - // 1) ./xxx - Running as a standalone install - // 2) ../pgAdmin/xxx - Running in a pgInstaller 8.1 installation - // (with the .exe and dlls in the main bin dir) - // 3) ../../xxx or ../xxx - Running in a development environment - - if (wxDir::Exists(loadPath + I18N_DIR)) - i18nPath = loadPath + I18N_DIR; - else if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") + I18N_DIR)) - i18nPath = loadPath + wxT("/../pgAdmin III") + I18N_DIR; - else - i18nPath = loadPath + wxT("/../..") + I18N_DIR; - - if (wxDir::Exists(loadPath + DOC_DIR)) - docPath = loadPath + DOC_DIR; - else if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") DOC_DIR)) - docPath = loadPath + wxT("/../pgAdmin III") DOC_DIR; - else - docPath = loadPath + wxT("/../..") DOC_DIR; - - if (wxDir::Exists(loadPath + UI_DIR)) - uiPath = loadPath + UI_DIR; - if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") + UI_DIR)) - uiPath = loadPath + wxT("/../pgAdmin III") + UI_DIR; - else - uiPath = loadPath + wxT("/..") UI_DIR; - - // Look for a path 'hint' on Windows. This registry setting may - // be set by the Win32 PostgreSQL installer which will generally - // install pg_dump et al. in the PostgreSQL bindir rather than - // the pgAdmin directory. - wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L); - if (hintKey.HasValue(wxT("Helper Path"))) - { - wxString hintPath; - hintKey.QueryValue(wxT("Helper Path"), hintPath); - path.Add(hintPath); - } - -#else - wxString dataDir; - -#if defined(__WXMAC__) - - //When using wxStandardPaths on OSX, wx defaults to the unix, - //not to the mac variants. Therefor, we request wxStandardPathsCF - //directly. - wxStandardPathsCF stdPaths ; - dataDir = stdPaths.GetDataDir() ; - - if (wxDir::Exists(dataDir + HELPER_DIR)) - path.Add(dataDir + HELPER_DIR) ; - if (wxDir::Exists(dataDir + SCRIPT_DIR)) - path.Add(dataDir + SCRIPT_DIR) ; - -#else // other *ixes - -// Data path (defined by configure under Unix). -#ifndef DATA_DIR -#define DATA_DIR "./" -#endif - - dataDir = wxString::FromAscii(DATA_DIR); -#endif - - - if (dataDir) - { - if (wxDir::Exists(dataDir + I18N_DIR)) - i18nPath = dataDir + I18N_DIR; - - if (wxDir::Exists(dataDir + UI_DIR)) - uiPath = dataDir + UI_DIR; - - if (wxDir::Exists(dataDir + DOC_DIR)) - docPath = dataDir + DOC_DIR ; - } - - if (i18nPath.IsEmpty()) - { - if (wxDir::Exists(loadPath + I18N_DIR)) - i18nPath = loadPath + I18N_DIR; - else - i18nPath = loadPath + wxT("/..") I18N_DIR; - } - if (uiPath.IsEmpty()) - { - if (wxDir::Exists(loadPath + UI_DIR)) - uiPath = loadPath + UI_DIR; - else - uiPath = loadPath + wxT("/..") UI_DIR; - } - - if (docPath.IsEmpty()) - { - if (wxDir::Exists(loadPath + DOC_DIR)) - docPath = loadPath + DOC_DIR ; - else - docPath = loadPath + wxT("/..") DOC_DIR ; - } -#endif - - path.AddEnvList(wxT("PATH")); -} - - -void pgAppBase::InitXml() -{ -#define chkXRC(id) XRCID(#id) == id - wxASSERT_MSG( - chkXRC(wxID_OK) && - chkXRC(wxID_CANCEL) && - chkXRC(wxID_HELP) && - chkXRC(wxID_APPLY) && - chkXRC(wxID_ADD) && - chkXRC(wxID_STOP) && - chkXRC(wxID_REMOVE)&& - chkXRC(wxID_REFRESH) && - chkXRC(wxID_CLOSE), - wxT("XRC ID not correctly assigned.")); - // if this assert fires, some event table uses XRCID(...) instead of wxID_... directly - - - -#ifdef EMBED_XRC - - // resources are loaded from memory - extern void InitXmlResource(); - InitXmlResource(); - -#else - - // for debugging, dialog resources are read from file - wxXmlResource::Get()->Load(uiPath + wxT("/*.xrc")); -#endif - -} - - -void pgAppBase::InitLogger() -{ - logger = new sysLogger(); - wxLog::SetActiveTarget(logger); -} - - -void pgAppBase::InitNetwork() -{ - // Startup the windows sockets if required -#ifdef __WXMSW__ - WSADATA wsaData; - if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) { - wxLogFatalError(__("Cannot initialise the networking subsystem!")); - } -#endif - wxSocketBase::Initialize(); - - pgConnBase::ExamineLibpqVersion(); -} - - -int pgAppBase::OnExit() -{ -#ifdef __WXMSW__ - WSACleanup(); -#endif - - return 1; -} +////////////////////////////////////////////////////////////////////////// +// +// pgAdmin III - PostgreSQL Tools +// RCS-ID: $Id: misc.cpp 4054 2005-03-28 16:43:01Z andreas $ +// Copyright (C) 2002 - 2005, The pgAdmin Development Team +// This software is released under the Artistic Licence +// +// base.cpp - Miscellaneous Basic Utilities +// +////////////////////////////////////////////////////////////////////////// + +#include "pgAdmin3.h" + +// wxWindows headers +#include <wx/wx.h> +#include <wx/dir.h> +#include <wx/file.h> +#include <wx/socket.h> +#include <wx/xrc/xmlres.h> +#include <wx/stdpaths.h> + +#include "copyright.h" +#include "base/base.h" +#include "base/appbase.h" +#include "base/pgConnBase.h" +#include "base/sysLogger.h" + +wxPathList path; // The search path +wxString loadPath; // Where the program is loaded from +wxString docPath; // Where docs are stored +wxString uiPath; // Where ui data is stored +wxString i18nPath; // Where i18n data is stored +wxLog *logger; + +#define DOC_DIR wxT("/docs") +#define UI_DIR wxT("/ui") +#define I18N_DIR wxT("/i18n") + +#define HELPER_DIR wxT("/helper") + + +void pgAppBase::InitPaths() +{ + loadPath=wxPathOnly(argv[0]); + if (loadPath.IsEmpty()) + loadPath = wxT("."); + + // Look in the app directory for things first + path.Add(loadPath); + +#if defined(__WXMSW__) + + // Search for the right paths. We check the following locations: + // + // 1) ./xxx - Running as a standalone install + // 2) ../pgAdmin/xxx - Running in a pgInstaller 8.1 installation + // (with the .exe and dlls in the main bin dir) + // 3) ../../xxx or ../xxx - Running in a development environment + + if (wxDir::Exists(loadPath + I18N_DIR)) + i18nPath = loadPath + I18N_DIR; + else if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") + I18N_DIR)) + i18nPath = loadPath + wxT("/../pgAdmin III") + I18N_DIR; + else + i18nPath = loadPath + wxT("/../..") + I18N_DIR; + + if (wxDir::Exists(loadPath + DOC_DIR)) + docPath = loadPath + DOC_DIR; + else if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") DOC_DIR)) + docPath = loadPath + wxT("/../pgAdmin III") DOC_DIR; + else + docPath = loadPath + wxT("/../..") DOC_DIR; + + if (wxDir::Exists(loadPath + UI_DIR)) + uiPath = loadPath + UI_DIR; + if (wxDir::Exists(loadPath + wxT("/../pgAdmin III") + UI_DIR)) + uiPath = loadPath + wxT("/../pgAdmin III") + UI_DIR; + else + uiPath = loadPath + wxT("/..") UI_DIR; + + // Look for a path 'hint' on Windows. This registry setting may + // be set by the Win32 PostgreSQL installer which will generally + // install pg_dump et al. in the PostgreSQL bindir rather than + // the pgAdmin directory. + wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L); + if (hintKey.HasValue(wxT("Helper Path"))) + { + wxString hintPath; + hintKey.QueryValue(wxT("Helper Path"), hintPath); + path.Add(hintPath); + } + +#else + wxString dataDir; + +#if defined(__WXMAC__) + + //When using wxStandardPaths on OSX, wx defaults to the unix, + //not to the mac variants. Therefor, we request wxStandardPathsCF + //directly. + wxStandardPathsCF stdPaths ; + dataDir = stdPaths.GetDataDir() ; + + if (wxDir::Exists(dataDir + HELPER_DIR)) + path.Add(dataDir + HELPER_DIR) ; + +#else // other *ixes + +// Data path (defined by configure under Unix). +#ifndef DATA_DIR +#define DATA_DIR "./" +#endif + + dataDir = wxString::FromAscii(DATA_DIR); +#endif + + + if (dataDir) + { + if (wxDir::Exists(dataDir + I18N_DIR)) + i18nPath = dataDir + I18N_DIR; + + if (wxDir::Exists(dataDir + UI_DIR)) + uiPath = dataDir + UI_DIR; + + if (wxDir::Exists(dataDir + DOC_DIR)) + docPath = dataDir + DOC_DIR ; + } + + if (i18nPath.IsEmpty()) + { + if (wxDir::Exists(loadPath + I18N_DIR)) + i18nPath = loadPath + I18N_DIR; + else + i18nPath = loadPath + wxT("/..") I18N_DIR; + } + if (uiPath.IsEmpty()) + { + if (wxDir::Exists(loadPath + UI_DIR)) + uiPath = loadPath + UI_DIR; + else + uiPath = loadPath + wxT("/..") UI_DIR; + } + + if (docPath.IsEmpty()) + { + if (wxDir::Exists(loadPath + DOC_DIR)) + docPath = loadPath + DOC_DIR ; + else + docPath = loadPath + wxT("/..") DOC_DIR ; + } +#endif + + path.AddEnvList(wxT("PATH")); +} + + +void pgAppBase::InitXml() +{ +#define chkXRC(id) XRCID(#id) == id + wxASSERT_MSG( + chkXRC(wxID_OK) && + chkXRC(wxID_CANCEL) && + chkXRC(wxID_HELP) && + chkXRC(wxID_APPLY) && + chkXRC(wxID_ADD) && + chkXRC(wxID_STOP) && + chkXRC(wxID_REMOVE)&& + chkXRC(wxID_REFRESH) && + chkXRC(wxID_CLOSE), + wxT("XRC ID not correctly assigned.")); + // if this assert fires, some event table uses XRCID(...) instead of wxID_... directly + + + +#ifdef EMBED_XRC + + // resources are loaded from memory + extern void InitXmlResource(); + InitXmlResource(); + +#else + + // for debugging, dialog resources are read from file + wxXmlResource::Get()->Load(uiPath + wxT("/*.xrc")); +#endif + +} + + +void pgAppBase::InitLogger() +{ + logger = new sysLogger(); + wxLog::SetActiveTarget(logger); +} + + +void pgAppBase::InitNetwork() +{ + // Startup the windows sockets if required +#ifdef __WXMSW__ + WSADATA wsaData; + if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) { + wxLogFatalError(__("Cannot initialise the networking subsystem!")); + } +#endif + wxSocketBase::Initialize(); + + pgConnBase::ExamineLibpqVersion(); +} + + +int pgAppBase::OnExit() +{ +#ifdef __WXMSW__ + WSACleanup(); +#endif + + return 1; +}