From edaf0c46a83275e57f92462ccc7f1aa1357c353f Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 6 Mar 2013 20:33:20 +0000 Subject: [PATCH] Add script for updating requirements This is a hacky little script for pulling all of the requirements from each project into a consolidate pair of pip-requires and test-requires files. The output of this can't be passed to 'pip install -r' without some further sanitation to clean up duplicates. Change-Id: I47159f744086dc1de1b9fa07ef4cc5a0f85087b0 --- tools/update.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/update.sh diff --git a/tools/update.sh b/tools/update.sh new file mode 100755 index 0000000000..4f7a812ea0 --- /dev/null +++ b/tools/update.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +GIT_DIR=${GIT_DIR-~/git/openstack} +FETCH_REMOTE=${FETCH_REMOTE-} +REMOTE_BRANCH=${REMOTE_BRANCH-gerrit/master} +PROJECTS=${PROJECTS-"nova glance keystone cinder quantum horizon swift heat ceilometer oslo-incubator python-novaclient python-glanceclient python-keystoneclient python-cinderclient python-quantumclient python-swiftclient"} + +fetch() { + for p in $PROJECTS; do + cd $GIT_DIR/$p + git fetch gerrit + done +} + +concat() { + path=$1; shift + + for p in $PROJECTS; do + cd $GIT_DIR/$p + git cat-file -p $REMOTE_BRANCH:$path + done | tr A-Z a-z| sed 's/#.*$//; s/ *$//; /^ *$/d' | sort | uniq +} + +[ -n "$FETCH_REMOTE" ] && fetch + +concat tools/pip-requires > $GIT_DIR/requirements/tools/pip-requires + +(sed p $GIT_DIR/requirements/tools/pip-requires; + concat tools/test-requires ) | +sort | uniq -u > $GIT_DIR/requirements/tools/test-requires