[PATCH] Patches for pg_dumpall, complete-bundle.sh and dmg creation - Mailing list pgadmin-hackers

From Florian G. Pflug
Subject [PATCH] Patches for pg_dumpall, complete-bundle.sh and dmg creation
Date
Msg-id 45D51B02.3090907@phlo.org
Whole thread Raw
Responses Re: [PATCH] Patches for pg_dumpall, complete-bundle.sh and dmg creation  (Dave Page <dpage@postgresql.org>)
List pgadmin-hackers
Hi

Here are various small patches I created today.

1) The first
(pgadmin3-dumpall.patch) adds pg_dumpall to the list
of postgres binaries that are copied into the app bundle.

2) When testing that one, I noticed that complete-bundle.sh seems
to be broken - at lost on my 10.3.9 buildserver. The reason is
that awk is called with "-F: -F\ " - which I guess ist meant to
mean "treat either a color or a space as field seperator". It
seems, however, that the second -F just overrides that first,
and therefore the filename followed by a colon is put into todo_obj,
instead of just the filename. Since -F takes a regex as parameter,
the fix is easy - just use ":| " as parameter to -F. While I was
at it, I also changed the output record seperator from newline (default)
to space. This is purely cosemtic, but makes the output of the script
a bit more readable. This patch should probably be applied to head and
1.6.

Either awk behaves differently on 10.3 and 10.4, or complete-bundle.sh
has been broken for a while :-(. The reason that apparently nobody noticed
is probably that
a) Things always work in the machine the binary way compiled on, because
there absolute references to the library are ok, meaning that a developer
probably won't recognize that there is a problem
b) The official pgadmin3 binaries are linked statically against wx and
libpq.

Since pg_dump, pg_restore (and now pg_dumpall) are probably _not_ linked
statically, breakage still occurs if complete-bundle.sh doesn't work
correctly - but you'd only notice if you try backing up a database with
pgadmin3.

3) The last patch ist a first shot at a create-dmg script. It seems to work
quite fine - it even attaches a license to the dmg that the user has to
accept before the dmg is mounted ;-)

greetings, Florian Pflug

Index: pkg/mac/create-dmg.sh
===================================================================
--- pkg/mac/create-dmg.sh    (revision 0)
+++ pkg/mac/create-dmg.sh    (revision 0)
@@ -0,0 +1,32 @@
+#!/bin/bash
+DMG_SOURCES="./pgAdmin3.app"
+DMG_LICENCE=./pkg/mac/licence.r
+DMG_IMAGE=./pgAdmin3.dmg
+DMG_NAME=pgAdmin3
+HDIUTIL=/usr/bin/hdiutil
+REZ="/Developer/Tools/Rez /Developer/Headers/FlatCarbon/*.r"
+
+DMG_DIR=$DMG_IMAGE.src
+
+if test -e "$DMG_DIR"; then
+    echo "Directory $DMG_DIR already exists. Please delete it manually." >&2
+    exit 1
+fi
+
+echo "Cleaning up"
+rm -f "$DMG_IMAGE" || exit 1
+mkdir "$DMG_DIR" || exit 1
+
+echo "Copying data into temporary directory"
+for src in $DMG_SOURCES; do
+    cp -r "$src" "$DMG_DIR" || exit 1
+done
+
+echo "Creating image"
+$HDIUTIL create -quiet -srcfolder "$DMG_DIR" -format UDZO -volname "$DMG_NAME" -ov "$DMG_IMAGE" || exit 1
+rm -rf "$DMG_DIR" || exit 1
+
+echo "Attaching License to image"
+$HDIUTIL unflatten -quiet "$DMG_IMAGE" || exit 1
+$REZ "$DMG_LICENCE" -a -o "$DMG_IMAGE" || exit 1
+$HDIUTIL flatten -quiet "$DMG_IMAGE" || exit 1

Property changes on: pkg/mac/create-dmg.sh
___________________________________________________________________
Name: svn:executable
   + *

Index: pkg/mac/licence.r
===================================================================
--- pkg/mac/licence.r    (revision 0)
+++ pkg/mac/licence.r    (revision 0)
@@ -0,0 +1,197 @@
+data 'LPic' (5000) {
+    $"0000 0001 0000 0000 0000"
+};
+
+resource 'STR#' (5000, "English buttons") {
+    {   /* array StringArray: 9 elements */
+        /* [1] */
+        "English",
+        /* [2] */
+        "Agree",
+        /* [3] */
+        "Disagree",
+        /* [4] */
+        "Print",
+        /* [5] */
+        "Save...",
+        /* [6] */
+        "IMPORTANT - Read this License Agreement carefully before clicking on "
+        "the \"Agree\" button.  By clicking on the \"Agree\" button, you agree "
+        "to be bound by the terms of the License Agreement.",
+        /* [7] */
+        "Software License Agreement",
+        /* [8] */
+        "This text cannot be saved. This disk may be full or locked, or the file "
+        "may be locked.",
+        /* [9] */
+        "Unable to print. Make sure you've selected a printer."
+    }
+};
+
+data 'TEXT' (5000, "English") {
+    "BY INSTALLING OR DISTRIBUTING PGADMIN AND RELATED\n"
+    "SOFTWARE, YOU AGREE WITH THE FOLLOWING DISCLAIMER:\n"
+    "\n"
+    "PGADMIN AND RELATED SOFTWARE IS PROVIDED WITHOUT\n"
+    "GUARANTEE OR WARRANTY OF ANY KIND. TO THE FULLEST\n"
+    "EXTENT ALLOWED BY LAW YOU AGREE THAT THE PGADMIN\n"
+    "DEVELOPMENT TEAM MEMBERS, CONTRIBUTERS OR\n"
+    "DISTRIBUTORS OF THE SOFTWARE CANNOT AND WILL NOT\n"
+    "BE HELD LIABLE FOR ANY DIRECT OR INDIRECT DAMAGE\n"
+    "OR LOSSES CAUSED WHOLLY OR IN PART BY THE\n"
+    "SOFTWARE.\n"
+    "\n"
+    "IN COUNTRIES WHERE THE ABSENCE OF LIABILITY MAY\n"
+    "NOT EXIST OR BE RESTRICTED BY LAW, PGADMIN\n"
+    "DEVELOPMENT TEAM MEMBERS, CONTRIBUTORS AND\n"
+    "DISTRIBUTORS LIABILITY SHALL BE LIMITED TO ONE\n"
+    "EURO.\n"
+    "\n"
+    "The Artistic License\n"
+    "\n"
+    "Preamble\n"
+    "\n"
+    "The intent of this document is to state the\n"
+    "conditions under which a Package may be copied,\n"
+    "such that the Copyright Holder maintains some\n"
+    "semblance of artistic control over the development\n"
+    "of the package, while giving the users of the\n"
+    "package the right to use and distribute the\n"
+    "Package in a more-or-less customary fashion, plus\n"
+    "the right to make reasonable modifications.\n"
+    "\n"
+    "Definitions:\n"
+    "�   \"Package\" refers to the collection of files\n"
+    "    distributed by the Copyright Holder, and\n"
+    "    derivatives of that collection of files created\n"
+    "    through textual modification.\n"
+    "�   \"Standard Version\" refers to such a Package if\n"
+    "    it has not been modified, or has been modified in\n"
+    "    accordance with the wishes of the Copyright\n"
+    "    Holder.\n"
+    "�   \"Copyright Holder\" is whoever is named in the\n"
+    "    copyright or copyrights for the package.\n"
+    "�   \"You\" is you, if you're thinking about copying\n"
+    "    or distributing this Package.\n"
+    "�   \"Reasonable copying fee\" is whatever you can\n"
+    "    justify on the basis of media cost, duplication\n"
+    "    charges, time of people involved, and so on. (You\n"
+    "    will not be required to justify it to the\n"
+    "    Copyright Holder, but only to the computing\n"
+    "    community at large as a market that must bear the\n"
+    "    fee.)\n"
+    "�   \"Freely Available\" means that no fee is\n"
+    "    charged for the item itself, though there may be\n"
+    "    fees involved in handling the item. It also means\n"
+    "    that recipients of the item may redistribute it\n"
+    "    under the same conditions they received it.\n"
+    "    \n"
+    "1. You may make and give away verbatim copies of\n"
+    "the source form of the Standard Version of this\n"
+    "Package without restriction, provided that you\n"
+    "duplicate all of the original copyright notices\n"
+    "and associated disclaimers.\n"
+    "\n"
+    "2. You may apply bug fixes, portability fixes and\n"
+    "other modifications derived from the Public Domain\n"
+    "or from the Copyright Holder. A Package modified\n"
+    "in such a way shall still be considered the\n"
+    "Standard Version.\n"
+    "\n"
+    "3. You may otherwise modify your copy of this\n"
+    "Package in any way, provided that you insert a\n"
+    "prominent notice in each changed file stating how\n"
+    "and when you changed that file, and provided that\n"
+    "you do at least ONE of the following:\n"
+    "\n"
+    "    a) place your modifications in the Public\n"
+    "    Domain or otherwise make them Freely\n"
+    "    Available, such as by posting said\n"
+    "    modifications to Usenet or an equivalent\n"
+    "    medium, or placing the modifications on a\n"
+    "    major archive site such as ftp.uu.net, or by\n"
+    "    allowing the Copyright Holder to include your\n"
+    "    modifications in the Standard Version of the\n"
+    "    Package.\n"
+    "\n"
+    "    b) use the modified Package only within your\n"
+    "    corporation or organization.\n"
+    "\n"
+    "    c) rename any non-standard executables so the\n"
+    "    names do not conflict with standard\n"
+    "    executables, which must also be provided, and\n"
+    "    provide a separate manual page for each\n"
+    "    non-standard executable that clearly\n"
+    "    documents how it differs from the Standard\n"
+    "    Version.\n"
+    "\n"
+    "    d) make other distribution arrangements with\n"
+    "    the Copyright Holder.\n"
+    "\n"
+    "4. You may distribute the programs of this Package\n"
+    "in object code or executable form, provided that\n"
+    "you do at least ONE of the following:\n"
+    "\n"
+    "    a) distribute a Standard Version of the\n"
+    "    executables and library files, together with\n"
+    "    instructions (in the manual page or\n"
+    "    equivalent) on where to get the Standard\n"
+    "    Version.\n"
+    "\n"
+    "    b) accompany the distribution with the\n"
+    "    machine-readable source of the Package with\n"
+    "    your modifications.\n"
+    "\n"
+    "    c) accompany any non-standard executables\n"
+    "    with their corresponding Standard Version\n"
+    "    executables, giving the non-standard\n"
+    "    executables non-standard names, and clearly\n"
+    "    documenting the differences in manual pages\n"
+    "    (or equivalent), together with instructions\n"
+    "    on where to get the Standard Version.\n"
+    "\n"
+    "    d) make other distribution arrangements with\n"
+    "    the Copyright Holder.\n"
+    "\n"
+    "5. You may charge a reasonable copying fee for any\n"
+    "distribution of this Package. You may charge any\n"
+    "fee you choose for support of this Package. You\n"
+    "may not charge a fee for this Package itself.\n"
+    "However, you may distribute this Package in\n"
+    "aggregate with other (possibly commercial)\n"
+    "programs as part of a larger (possibly commercial)\n"
+    "software distribution provided that you do not\n"
+    "advertise this Package as a product of your own.\n"
+    "\n"
+    "6. The scripts and library files supplied as input\n"
+    "to or produced as output from the programs of this\n"
+    "Package do not automatically fall under the\n"
+    "copyright of this Package, but belong to whomever\n"
+    "generated them, and may be sold commercially, and\n"
+    "may be aggregated with this Package.\n"
+    "\n"
+    "7. C or perl subroutines supplied by you and\n"
+    "linked into this Package shall not be considered\n"
+    "part of this Package.\n"
+    "\n"
+    "8. The name of the Copyright Holder may not be\n"
+    "used to endorse or promote products derived from\n"
+    "this software without specific prior written\n"
+    "permission.\n"
+    "\n"
+    "9. THIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT\n"
+    "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\n"
+    "WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\n"
+    "MERCHANTIBILITY AND FITNESS FOR A PARTICULAR\n"
+    "PURPOSE.\n"
+    "\n"
+    "The End\n"
+};
+
+data 'styl' (5000) {
+    $"0003 0000 0000 0010 000C 0004 0000 000C"            /* ................ */
+    $"0000 0000 0000 0000 0277 0015 0010 0004"            /* .........w...... */
+    $"0100 0010 0000 0000 0000 0000 028B 0010"            /* .............�.. */
+    $"000C 0004 0000 000C 0000 0000 0000"                 /* .............. */
+};
+
Index: pkg/mac/complete-bundle.sh
===================================================================
--- pkg/mac/complete-bundle.sh    (revision 5917)
+++ pkg/mac/complete-bundle.sh    (working copy)
@@ -12,7 +12,7 @@

 cd "$bundle"

-todo=$(file `find ./ -perm +0111 ! -type d` | grep "Mach-O executable" | awk -F: -F\  '{print $1}' | uniq)
+todo=$(file `find ./ -perm +0111 ! -type d` | grep "Mach-O executable" | awk -F ':| ' '{ORS=" "; print $1}' | uniq)

 echo "Found executables: $todo"

Index: pkg/mac/Makefile.am
===================================================================
--- pkg/mac/Makefile.am    (revision 5917)
+++ pkg/mac/Makefile.am    (working copy)
@@ -31,6 +31,7 @@
     $$($(WX_CONFIG) --rescomp | 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_dumpall"
"$(bundledir)/Contents/SharedSupport/helper/pg_dumpall"
     $(install_sh_PROGRAM) "$$($(PG_CONFIG) --bindir)/pg_restore"
"$(bundledir)/Contents/SharedSupport/helper/pg_restore"
     ./complete-bundle.sh "$(bundledir)"
 endif

pgadmin-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: SVN Commit by dpage: r5916 - in trunk/pgadmin 3:. pgadmin pgadmin/frm pgadmin/include/frm pgadmin/include/schema pgadmin/u ipkg/win32/src
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r5923 - in trunk/pgadmin3: . pkg/mac