add tool script to check proper packaging of a git python repository

This commit is contained in:
Benjamin Dauvergne 2013-04-25 18:29:12 +02:00
parent f9e8f62339
commit 56c2f01736
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ ! -f setup.py ]; then
echo Not in a python package root directory, no setup.py file
exit 1
fi
echo Cleaning...
rm -rf dist/ build/ *.egg-info/
echo Building distribution file...
python setup.py sdist
if [ -d .git ]; then
DIST=`ls dist/*.tar.gz`
NAME=`basename $DIST | sed s/\\.tar\\.gz//`
echo $DIST
echo $NAME
echo "tar tzf $DIST | sed s/$NAME\/// | grep -v '/$' | sort -u"
diff -ub <(git ls-files|sort) <(tar tzf $DIST | sed s/$NAME\\/// | grep -v '/$' | sort -u) | less
fi