From 0538713262af8f67bebb9b43dd2312db2963418d Mon Sep 17 00:00:00 2001 From: Keshav Kini Date: Wed, 13 Jun 2012 11:37:32 -0700 Subject: [PATCH] Fix packaging of git repo `setup.py sdist` doesn't copy empty directories, as I found out after a lot of head scratching. This breaks git repos, so we can't trust sdist to copy our git repo into the source tarball of sagenb. So we'll store the git repo separately as sagenb.git , and move it into place when running spkg-install. --- MANIFEST.in | 10 +++++----- dist.sh | 15 +++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index f92718bea..65c8e0772 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,8 @@ -recursive-include sagenb * -recursive-include sass * -recursive-include util * +graft sagenb +graft sass +graft util prune sass/src/.sass-cache -recursive-include flask_version * +graft flask_version include *.txt MANIFEST.in .gitignore dist.sh README.rst -recursive-include .git * +prune .git global-exclude *.pyc *.pyo *.orig *.rej *~ \#* *\# *.sassc *.scssc *.DS_Store diff --git a/dist.sh b/dist.sh index 17f4180fd..a60acc85f 100755 --- a/dist.sh +++ b/dist.sh @@ -11,26 +11,29 @@ die () { cd ${0%/*} +git diff --quiet || + die "Uncommitted changes in sagenb - please commit, stash, or discard" + rm -rf dist mkdir -p dist -echo "Fetching source tarballs of (sub)dependencies of sagenb" +echo "Fetching source tarballs of (sub)dependencies of sagenb to dist/" python util/fetch_deps.py dist || die "Couldn't fetch all (sub)dependencies" +echo "Creating source tarball of sagenb itself in dist/" +python setup.py sdist > sdist.log || die "Couldn't make sagenb source tarball" + echo "Sanitizing sagenb git repo (with backup)" -git diff --quiet || - die "Uncommitted changes in sagenb - please commit, stash, or discard" mv .git .git-backup git init git fetch .git-backup git branch -f master FETCH_HEAD git gc --aggressive --prune=0 -echo "Creating source tarball of sagenb itself" -python setup.py sdist || die "Couldn't make sagenb source tarball" +echo "Moving sanitized sagenb git repo to dist/" +mv .git dist/sagenb.git echo "Restoring backup of git repo" -rm -rf .git mv .git-backup .git echo "Done!"