This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6267934
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def bootstrap(): | ||
local("virtualenv ve") | ||
local("mkdir src") | ||
local("python grab_repos.py") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env python | ||
""" | ||
1. Parses repo_list.txt | ||
2. Downloads source code to the `src` folder | ||
3. Adds source to `ve` virtualenv PYTHONPATH | ||
""" | ||
|
||
|
||
import commands | ||
|
||
f = open("repo_list.txt") | ||
stat, cwd = commands.getstatusoutput('pwd') | ||
|
||
|
||
for line in f.readlines(): | ||
|
||
#ignore comments | ||
if line.startswith('#'): | ||
continue | ||
|
||
name, url, vcs, version = line.split() | ||
|
||
#SUBVERSION/GIT | ||
if vcs == 'svn' or vcs == 'git': | ||
#if setup.py isn't available use pipe delimiter to determine source directory and python module | ||
#names for symlinking | ||
try: | ||
src_dir, py_module = name.split('|') | ||
ln_cmd = "cd %s/ve/lib/python2.5/site-packages; ln -s ../../../../src/%s/%s ." % (cwd, src_dir, py_module) | ||
except ValueError: | ||
src_dir = name | ||
ln_cmd = 'cd %s; %s/ve/bin/python setup.py install' % (src_dir, cwd) | ||
#TODO handle version/head logic | ||
if vcs == 'svn': | ||
co_cmd = "svn co -r %s %s %s" % (version, url, src_dir) | ||
else: #vcs == git | ||
co_cmd = "git clone %s" % url | ||
#TODO handle branching | ||
cmd = '%s; %s' % (co_cmd, ln_cmd) | ||
|
||
#SINGLE FILE DOWNLOAD | ||
elif vcs == 'wget': | ||
co_cmd = "wget %s" % url | ||
ln_cmd = "cd %s/ve/lib/python2.5/site-packages; ln -s ../../../../src/%s ." % (cwd, name) | ||
cmd = '%s; %s' % (co_cmd, ln_cmd) | ||
|
||
#CHEESESHOP | ||
elif vcs == 'pypi': | ||
cmd = "easy_install %s==%s" % (name, version) | ||
else: | ||
raise Exception, "Can't handle %s" % vcs | ||
print cmd | ||
|
||
#move to `src` directory and run command(s) | ||
stat, output = commands.getstatusoutput('(cd src; %s)' % cmd) | ||
if stat: | ||
raise Exception, '`%s` failed: %s' % (cmd, output) | ||
else: | ||
pass #print output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#name repo vcs version | ||
dateutil http://pypi.python.org/pypi/dateutil pypi 1.1 | ||
html2text.py http://www.aaronsw.com/2002/html2text/html2text.py wget 2.34 | ||
django-1.0 http://code.djangoproject.com/svn/django/branches/releases/1.0.X svn 9560 | ||
gondola|lincolnloop git@lincolnloop.unfuddle.com:lincolnloop/gondola.git git head|master | ||
django-command-extensions http://django-command-extensions.googlecode.com/svn/trunk svn 135 | ||
django-registration http://django-registration.googlecode.com/svn/trunk svn 168 | ||
sorl-thumbnail|sorl http://sorl-thumbnail.googlecode.com/svn/trunk svn 430 | ||
#setup.py fails for tagging without DJANGO_SETTINGS_MODULE defined | ||
django-tagging|tagging http://django-tagging.googlecode.com/svn/trunk svn 149 | ||
django-template-utils http://django-template-utils.googlecode.com/svn/trunk svn 109 |