Changeset 783


Ignore:
Timestamp:
Jan 26, 2016, 6:56:08 AM (3 years ago)
Author:
cito
Message:

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.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/4.x/MANIFEST.in

    r757 r783  
    1 include *.c
    2 include *.h
    3 include *.py
    4 include *.cfg
    5 include *.rst
    6 include *.txt
     1
     2include pgmodule.c
     3include pgtypes.h
     4include pgfs.h
     5
     6include pg.py
     7include pgdb.py
     8include setup.py
     9
     10include setup.cfg
     11
     12include README.rst
     13include LICENSE.txt
     14
    715recursive-include tests *.py
     16
    817include docs/Makefile
    918include docs/make.bat
  • branches/4.x/docs/community/source.rst

    r695 r783  
    55source code repository for PyGreSQL.
    66
    7 The repository can be checked out with the command::
     7The current trunk of the repository can be checked out with the command::
    88
    9     svn co svn://svn.pygresql.org/pygresql
     9    svn co svn://svn.pygresql.org/pygresql/trunk
    1010
    1111You can also browse through the repository using the
  • branches/4.x/mktar

    r777 r783  
    44DISTDIR=/u/pyg/files
    55
    6 # small safety tests
    7 if [ ! -f pgmodule.c ]
     6# some safety tests
     7if [ ! -d $DISTDIR ]
     8then
     9        echo "Hmmm.  Are you sure you are on the right server?"
     10        exit 1
     11fi
     12if [ ! -f setup.py -o ! -f pgmodule.c -o ! -d tests -o ! -d docs ]
    813then
    914        echo "Hmmm.  Are you sure you are in the right directory?"
    1015        exit 1
    1116fi
    12 if [ ! -d $DISTDIR ]
     17FILES="*.c *.h *.py *.cfg *.rst *.txt"
     18NUMFILES=`ls $FILES | wc -l`
     19if [ "$NUMFILES" != "9" ]
    1320then
    14         echo "Hmmm.  Are you sure you are on the right server?"
    15         exit 1
     21    echo "Hmmm.  The number of top-level files seems to be wrong:"
     22    ls $FILES
     23    echo "Maybe you should do a clean checkout first."
     24    echo "If something has changed, edit MANIFEST.in and mktar."
     25    exit 1
     26fi
     27FILES="mktar mkdocs docs tests pg.py pgdb.py pgmodule.c setup.cfg"
     28PERMS=`stat --printf="%a" $FILES`
     29if [ $? -ne 0 -o "$PERMS" != '755755755755644644644644' ]
     30then
     31    echo "Hmmm.  File permissions are not set properly."
     32    echo "Use a filesystem with permissions and do a clean checkout first."
     33    exit 1
    1634fi
    1735
     
    2947
    3048echo "Making source tarball..."
     49echo
     50
     51umask 0022
    3152
    3253# Make sure that the documentation has been built.
    3354
    34 ./mkdocs
     55if ! ./mkdocs
     56then
     57        echo "Hmmm.  The documentation could not be built."
     58        exit 1
     59fi
    3560
    3661# Package as source distribution.
     
    3863rm -rf build dist
    3964
    40 python setup.py sdist
     65if ! python2 setup.py sdist
     66then
     67        echo "Hmmm.  The source distribution could not be created."
     68        exit 1
     69fi
    4170
    4271DF=`ls dist`
     72if [ $? -ne 0 -o -z "$DF" ]
     73then
     74        echo "Hmmm.  The source distribution could not be found."
     75        exit 1
     76fi
     77
    4378TF=$DISTDIR/$DF
    4479
    45 cp dist/$DF $TF
     80if ! cp dist/$DF $TF
     81then
     82        echo "Hmmm.  The source distribution could not be copied."
     83        exit 1
     84fi
     85
    4686chmod 644 $TF
    4787
     
    4989ln -s $DF $DISTDIR/$SYMLINK
    5090
     91echo
    5192echo "$TF has been built."
  • trunk/MANIFEST.in

    r757 r783  
    1 include *.c
    2 include *.h
    3 include *.py
    4 include *.cfg
    5 include *.rst
    6 include *.txt
     1
     2include pgmodule.c
     3include pgtypes.h
     4include py3c.h
     5
     6include pg.py
     7include pgdb.py
     8include setup.py
     9
     10include setup.cfg
     11
     12include README.rst
     13include LICENSE.txt
     14
    715recursive-include tests *.py
     16
    817include docs/Makefile
    918include docs/make.bat
  • trunk/docs/community/source.rst

    r710 r783  
    55source code repository for PyGreSQL.
    66
    7 The repository can be checked out with the command::
     7The current trunk of the repository can be checked out with the command::
    88
    9     svn co svn://svn.pygresql.org/pygresql
     9    svn co svn://svn.pygresql.org/pygresql/trunk
    1010
    1111You can also browse through the repository using the
  • trunk/mktar

    r777 r783  
    44DISTDIR=/u/pyg/files
    55
    6 # small safety tests
    7 if [ ! -f pgmodule.c ]
     6# some safety tests
     7if [ ! -d $DISTDIR ]
     8then
     9        echo "Hmmm.  Are you sure you are on the right server?"
     10        exit 1
     11fi
     12if [ ! -f setup.py -o ! -f pgmodule.c -o ! -d tests -o ! -d docs ]
    813then
    914        echo "Hmmm.  Are you sure you are in the right directory?"
    1015        exit 1
    1116fi
    12 if [ ! -d $DISTDIR ]
     17FILES="*.c *.h *.py *.cfg *.rst *.txt"
     18NUMFILES=`ls $FILES | wc -l`
     19if [ "$NUMFILES" != "9" ]
    1320then
    14         echo "Hmmm.  Are you sure you are on the right server?"
    15         exit 1
     21    echo "Hmmm.  The number of top-level files seems to be wrong:"
     22    ls $FILES
     23    echo "Maybe you should do a clean checkout first."
     24    echo "If something has changed, edit MANIFEST.in and mktar."
     25    exit 1
     26fi
     27FILES="mktar mkdocs docs tests pg.py pgdb.py pgmodule.c setup.cfg"
     28PERMS=`stat --printf="%a" $FILES`
     29if [ $? -ne 0 -o "$PERMS" != '755755755755644644644644' ]
     30then
     31    echo "Hmmm.  File permissions are not set properly."
     32    echo "Use a filesystem with permissions and do a clean checkout first."
     33    exit 1
    1634fi
    1735
     
    2947
    3048echo "Making source tarball..."
     49echo
     50
     51umask 0022
    3152
    3253# Make sure that the documentation has been built.
    3354
    34 ./mkdocs
     55if ! ./mkdocs
     56then
     57        echo "Hmmm.  The documentation could not be built."
     58        exit 1
     59fi
    3560
    3661# Package as source distribution.
     
    3863rm -rf build dist
    3964
    40 python setup.py sdist
     65if ! python3 setup.py sdist
     66then
     67        echo "Hmmm.  The source distribution could not be created."
     68        exit 1
     69fi
    4170
    4271DF=`ls dist`
     72if [ $? -ne 0 -o -z "$DF" ]
     73then
     74        echo "Hmmm.  The source distribution could not be found."
     75        exit 1
     76fi
     77
    4378TF=$DISTDIR/$DF
    4479
    45 cp dist/$DF $TF
     80if ! cp dist/$DF $TF
     81then
     82        echo "Hmmm.  The source distribution could not be copied."
     83        exit 1
     84fi
     85
    4686chmod 644 $TF
    4787
     
    4989ln -s $DF $DISTDIR/$SYMLINK
    5090
     91echo
    5192echo "$TF has been built."
Note: See TracChangeset for help on using the changeset viewer.