logo       

SVN Commit by dpage: r4754 - in trunk/pgadmin3: pkg/mac src/base: msg#00269

Subject: SVN Commit by dpage: r4754 - in trunk/pgadmin3: pkg/mac src/base
Author: dpage
Date: 2005-11-25 08:36:34 +0000 (Fri, 25 Nov 2005)
New Revision: 4754

Modified:
   trunk/pgadmin3/pkg/mac/Makefile.am
   trunk/pgadmin3/pkg/mac/complete-bundle.sh
   trunk/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: trunk/pgadmin3/pkg/mac/Makefile.am
===================================================================
--- trunk/pgadmin3/pkg/mac/Makefile.am  2005-11-24 09:33:31 UTC (rev 4753)
+++ trunk/pgadmin3/pkg/mac/Makefile.am  2005-11-25 08:36:34 UTC (rev 4754)
@@ -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: trunk/pgadmin3/pkg/mac/complete-bundle.sh
===================================================================
--- trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-11-24 09:33:31 UTC (rev 
4753)
+++ trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-11-25 08:36:34 UTC (rev 
4754)
@@ -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: trunk/pgadmin3/src/base/appbase.cpp
===================================================================
--- trunk/pgadmin3/src/base/appbase.cpp 2005-11-24 09:33:31 UTC (rev 4753)
+++ trunk/pgadmin3/src/base/appbase.cpp 2005-11-25 08:36:34 UTC (rev 4754)
@@ -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;
+}


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe