Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Fix packaging of git repo
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
kini committed Jun 13, 2012
1 parent 97a817f commit 0538713
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions 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
15 changes: 9 additions & 6 deletions dist.sh
Expand Up @@ -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!"

0 comments on commit 0538713

Please sign in to comment.