Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Merge /home/andreas/backup/laptop-home/andreas/src
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 5, 2011
2 parents 21079b5 + 1c2ef5b commit 840d316
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -21,12 +21,14 @@ pytools
pymbolic
pyublas
meshpy
datapyle
pyvisfile
cgen
codepy
pycuda
pyopencl
pymetis
pyrticle
pyublasext
quiet-beam-sampling
hedge
pyrticle
14 changes: 11 additions & 3 deletions list-active-repos.py
Expand Up @@ -2,18 +2,26 @@ def read_repo_list(name):
try:
return [x.strip() for x in open(name).readlines() if not x.strip().startswith("#")]
except IOError:
return ""
return []

import sys
my_dir = sys.argv[1]

from os.path import join

all_repos = read_repo_list(join(my_dir, "subprojects"))
all_repos = (read_repo_list(join(my_dir, "subprojects"))
+ read_repo_list(join(my_dir, "extra-subprojects")))
excluded_repos = read_repo_list(join(my_dir, "excluded-subprojects"))

for x in excluded_repos:
all_repos.remove(x)
try:
all_repos.remove(x)
except ValueError:
print>>sys.stderr, "----------------------------------------------------------------------------------"
print>>sys.stderr, "*** ERROR: %s in excluded-subprojects isn't a valid subproject" % x
print>>sys.stderr, "----------------------------------------------------------------------------------"
import sys
sys.exit(1)

for x in all_repos:
print join(my_dir, x)
51 changes: 33 additions & 18 deletions repotool
Expand Up @@ -4,9 +4,9 @@ set -e

function list_all_repos()
{
cat subprojects
if test -f extra-subprojects; then
cat extra-subprojects
cat $MYDIR/subprojects
if test -f $MYDIR/extra-subprojects; then
cat $MYDIR/extra-subprojects
fi
}

Expand Down Expand Up @@ -43,7 +43,10 @@ function show_help()


DIR=`dirname "$0"`
MYDIR=$(cd "$DIR" && pwd)
MYDIR=$(cd "$DIR" && pwd)

ACTIVE_REPOS="$(list_active_repos)"
ALL_REPOS="$(list_all_repos)"

CMD="$1"
shift
Expand All @@ -59,7 +62,7 @@ case "$CMD" in

for-* )
TP=${CMD##for-}
if test "$1" = "-v"; then
if test "$1" = "-v"; then
shift
VERBOSE=1
fi
Expand Down Expand Up @@ -88,29 +91,41 @@ case "$CMD" in
) < .gitignore > new-gitig
mv new-gitig .gitignore
;;

clone | pull )
BASE_URL="$1"
SUFFIX="$2"
BRANCH="${3:-master}"
for n in `list_all_repos`; do
if ! test -d $n; then
if ! test -d $n; then
emphasize "CLONE $n"
git clone --quiet $BASE_URL$n$SUFFIX
(cd $n && git submodule init && git submodule update )
else
( cd $n
if test "$(git status | head -n 1)" != "# On branch master"; then
emphasize "$n NOT ON MASTER BRANCH"
git status | head -n 1
echo -n "Continue? [n]"
echo -n "Continue? Skip? [ns]"
read ANSWER
if test "$ANSWER" = "s"; then
continue
fi
if ! test "$ANSWER" = "y"; then
exit 1
fi
fi
emphasize "PULL $n"
if ! git pull $BASE_URL$n$SUFFIX $BRANCH ; then
emphasize "PULL IN $n FAILED"
emphasize "PULL IN $n FAILED"
exit 1
fi
if ! git submodule init; then
emphasize "SUBMODULE INIT IN $n FAILED"
exit 1
fi
if ! git submodule update; then
emphasize "SUBMODULE UPDATE IN $n FAILED"
exit 1
fi
) || exit 1
Expand All @@ -134,26 +149,26 @@ case "$CMD" in

clean )
PREFIX="$1"
for n in `list_active_repos`; do
for n in $ACTIVE_REPOS; do
(
cd $n
if test -e setup.py ; then
$PREFIX rm -Rf build *.egg-info dist
fi
)
)
done
;;

install | develop )
PY_COMMAND="${1:-python}"
for n in `list_active_repos`; do
for n in $ACTIVE_REPOS; do
(
set -e
cd $n
if test -e setup.py; then
emphasize "INSTALLING $n"
if ! $PY_COMMAND setup.py $CMD ; then
emphasize "COMMAND $CMD ON $n FAILED!"
if ! $PY_COMMAND setup.py $CMD ; then
emphasize "COMMAND $CMD ON $n FAILED!"
exit 1
fi
fi
Expand All @@ -173,24 +188,24 @@ case "$CMD" in
fi
rm -f tags TAGS
ctags $CTAGS_EXTRA_OPTS --exclude=build --python-kinds='-i' \
--exclude='*.html' -R `list_active_repos` $MYDIR
--exclude='*.html' -R $ACTIVE_REPOS $MYDIR
;;

setup-env )
virtualenv --distribute env
virtualenv env
;;

env )
echo "export PATH=$MYDIR/env/bin:$PATH"
;;

serve | gitserve )
git daemon --export-all --verbose --base-path=`pwd` `pwd`
git daemon --enable=receive-pack --export-all --verbose --base-path=`pwd` `pwd`
;;

start-over )
export PATH=$MYDIR/env/bin:$PATH
rm "$MYDIR/env" -Rf
rm -Rf "$MYDIR/env"
$0 clean
$0 setup-env
if test "$1" = "install"; then
Expand Down
2 changes: 2 additions & 0 deletions subprojects
Expand Up @@ -4,7 +4,9 @@ pytools
pymbolic
pyublas
meshpy
datapyle
pyvisfile
cgen
codepy
pycuda
pyopencl
Expand Down

0 comments on commit 840d316

Please sign in to comment.