Author: cito
Date: Tue Jan 26 06:56:08 2016
New Revision: 783

Log:
Add more safety checks to the mktar script

Make sure the right files are packaged, and with the right permissions.

Also specified the exact top-level source files in MANIFEST.in,
in order to make sure that other files used for testing etc.
do not accidentally get packaged. The mktar script now also checks
the number of top-level files and warns if something does not fit.

Modified:
   branches/4.x/MANIFEST.in
   branches/4.x/docs/community/source.rst
   branches/4.x/mktar
   trunk/MANIFEST.in
   trunk/docs/community/source.rst
   trunk/mktar

Modified: branches/4.x/MANIFEST.in
==============================================================================
--- branches/4.x/MANIFEST.in    Mon Jan 25 17:19:50 2016        (r782)
+++ branches/4.x/MANIFEST.in    Tue Jan 26 06:56:08 2016        (r783)
@@ -1,10 +1,19 @@
-include *.c
-include *.h
-include *.py
-include *.cfg
-include *.rst
-include *.txt
+
+include pgmodule.c
+include pgtypes.h
+include pgfs.h
+
+include pg.py
+include pgdb.py
+include setup.py
+
+include setup.cfg
+
+include README.rst
+include LICENSE.txt
+
 recursive-include tests *.py
+
 include docs/Makefile
 include docs/make.bat
 include docs/*.py

Modified: branches/4.x/docs/community/source.rst
==============================================================================
--- branches/4.x/docs/community/source.rst      Mon Jan 25 17:19:50 2016        
(r782)
+++ branches/4.x/docs/community/source.rst      Tue Jan 26 06:56:08 2016        
(r783)
@@ -4,9 +4,9 @@
 We are using a central `Subversion <https://subversion.apache.org/>`_
 source code repository for PyGreSQL.
 
-The repository can be checked out with the command::
+The current trunk of the repository can be checked out with the command::
 
-    svn co svn://svn.pygresql.org/pygresql
+    svn co svn://svn.pygresql.org/pygresql/trunk
 
 You can also browse through the repository using the
 `PyGreSQL Trac browser 
<http://trac.pygresql.org:8000/pgtracker/browser/trunk>`_.

Modified: branches/4.x/mktar
==============================================================================
--- branches/4.x/mktar  Mon Jan 25 17:19:50 2016        (r782)
+++ branches/4.x/mktar  Tue Jan 26 06:56:08 2016        (r783)
@@ -3,17 +3,35 @@
 VERSION=4.2
 DISTDIR=/u/pyg/files
 
-# small safety tests
-if [ ! -f pgmodule.c ]
+# some safety tests
+if [ ! -d $DISTDIR ]
 then
-       echo "Hmmm.  Are you sure you are in the right directory?"
+       echo "Hmmm.  Are you sure you are on the right server?"
        exit 1
 fi
-if [ ! -d $DISTDIR ]
+if [ ! -f setup.py -o ! -f pgmodule.c -o ! -d tests -o ! -d docs ]
 then
-       echo "Hmmm.  Are you sure you are on the right server?"
+       echo "Hmmm.  Are you sure you are in the right directory?"
        exit 1
 fi
+FILES="*.c *.h *.py *.cfg *.rst *.txt"
+NUMFILES=`ls $FILES | wc -l`
+if [ "$NUMFILES" != "9" ]
+then
+    echo "Hmmm.  The number of top-level files seems to be wrong:"
+    ls $FILES
+    echo "Maybe you should do a clean checkout first."
+    echo "If something has changed, edit MANIFEST.in and mktar."
+    exit 1
+fi
+FILES="mktar mkdocs docs tests pg.py pgdb.py pgmodule.c setup.cfg"
+PERMS=`stat --printf="%a" $FILES`
+if [ $? -ne 0 -o "$PERMS" != '755755755755644644644644' ]
+then
+    echo "Hmmm.  File permissions are not set properly."
+    echo "Use a filesystem with permissions and do a clean checkout first."
+    exit 1
+fi
 
 if [ -f BETA ]
 then
@@ -28,24 +46,47 @@
 # Package up as a source tarball in the distribution directory.
 
 echo "Making source tarball..."
+echo
+
+umask 0022
 
 # Make sure that the documentation has been built.
 
-./mkdocs
+if ! ./mkdocs
+then
+       echo "Hmmm.  The documentation could not be built."
+       exit 1
+fi
 
 # Package as source distribution.
 
 rm -rf build dist
 
-python setup.py sdist
+if ! python2 setup.py sdist
+then
+       echo "Hmmm.  The source distribution could not be created."
+       exit 1
+fi
 
 DF=`ls dist`
+if [ $? -ne 0 -o -z "$DF" ]
+then
+       echo "Hmmm.  The source distribution could not be found."
+       exit 1
+fi
+
 TF=$DISTDIR/$DF
 
-cp dist/$DF $TF
+if ! cp dist/$DF $TF
+then
+       echo "Hmmm.  The source distribution could not be copied."
+       exit 1
+fi
+
 chmod 644 $TF
 
 rm -f $DISTDIR/$SYMLINK
 ln -s $DF $DISTDIR/$SYMLINK
 
+echo
 echo "$TF has been built."

Modified: trunk/MANIFEST.in
==============================================================================
--- trunk/MANIFEST.in   Mon Jan 25 17:19:50 2016        (r782)
+++ trunk/MANIFEST.in   Tue Jan 26 06:56:08 2016        (r783)
@@ -1,10 +1,19 @@
-include *.c
-include *.h
-include *.py
-include *.cfg
-include *.rst
-include *.txt
+
+include pgmodule.c
+include pgtypes.h
+include py3c.h
+
+include pg.py
+include pgdb.py
+include setup.py
+
+include setup.cfg
+
+include README.rst
+include LICENSE.txt
+
 recursive-include tests *.py
+
 include docs/Makefile
 include docs/make.bat
 include docs/*.py

Modified: trunk/docs/community/source.rst
==============================================================================
--- trunk/docs/community/source.rst     Mon Jan 25 17:19:50 2016        (r782)
+++ trunk/docs/community/source.rst     Tue Jan 26 06:56:08 2016        (r783)
@@ -4,9 +4,9 @@
 We are using a central `Subversion <https://subversion.apache.org/>`_
 source code repository for PyGreSQL.
 
-The repository can be checked out with the command::
+The current trunk of the repository can be checked out with the command::
 
-    svn co svn://svn.pygresql.org/pygresql
+    svn co svn://svn.pygresql.org/pygresql/trunk
 
 You can also browse through the repository using the
 `PyGreSQL Trac browser 
<http://trac.pygresql.org:8000/pgtracker/browser/trunk>`_.

Modified: trunk/mktar
==============================================================================
--- trunk/mktar Mon Jan 25 17:19:50 2016        (r782)
+++ trunk/mktar Tue Jan 26 06:56:08 2016        (r783)
@@ -3,17 +3,35 @@
 VERSION=5.0
 DISTDIR=/u/pyg/files
 
-# small safety tests
-if [ ! -f pgmodule.c ]
+# some safety tests
+if [ ! -d $DISTDIR ]
 then
-       echo "Hmmm.  Are you sure you are in the right directory?"
+       echo "Hmmm.  Are you sure you are on the right server?"
        exit 1
 fi
-if [ ! -d $DISTDIR ]
+if [ ! -f setup.py -o ! -f pgmodule.c -o ! -d tests -o ! -d docs ]
 then
-       echo "Hmmm.  Are you sure you are on the right server?"
+       echo "Hmmm.  Are you sure you are in the right directory?"
        exit 1
 fi
+FILES="*.c *.h *.py *.cfg *.rst *.txt"
+NUMFILES=`ls $FILES | wc -l`
+if [ "$NUMFILES" != "9" ]
+then
+    echo "Hmmm.  The number of top-level files seems to be wrong:"
+    ls $FILES
+    echo "Maybe you should do a clean checkout first."
+    echo "If something has changed, edit MANIFEST.in and mktar."
+    exit 1
+fi
+FILES="mktar mkdocs docs tests pg.py pgdb.py pgmodule.c setup.cfg"
+PERMS=`stat --printf="%a" $FILES`
+if [ $? -ne 0 -o "$PERMS" != '755755755755644644644644' ]
+then
+    echo "Hmmm.  File permissions are not set properly."
+    echo "Use a filesystem with permissions and do a clean checkout first."
+    exit 1
+fi
 
 if [ -f BETA ]
 then
@@ -28,24 +46,47 @@
 # Package up as a source tarball in the distribution directory.
 
 echo "Making source tarball..."
+echo
+
+umask 0022
 
 # Make sure that the documentation has been built.
 
-./mkdocs
+if ! ./mkdocs
+then
+       echo "Hmmm.  The documentation could not be built."
+       exit 1
+fi
 
 # Package as source distribution.
 
 rm -rf build dist
 
-python setup.py sdist
+if ! python3 setup.py sdist
+then
+       echo "Hmmm.  The source distribution could not be created."
+       exit 1
+fi
 
 DF=`ls dist`
+if [ $? -ne 0 -o -z "$DF" ]
+then
+       echo "Hmmm.  The source distribution could not be found."
+       exit 1
+fi
+
 TF=$DISTDIR/$DF
 
-cp dist/$DF $TF
+if ! cp dist/$DF $TF
+then
+       echo "Hmmm.  The source distribution could not be copied."
+       exit 1
+fi
+
 chmod 644 $TF
 
 rm -f $DISTDIR/$SYMLINK
 ln -s $DF $DISTDIR/$SYMLINK
 
+echo
 echo "$TF has been built."
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to