diff options
author | Khai Do <zaro0508@gmail.com> | 2013-10-30 14:28:47 -0700 |
---|---|---|
committer | Khai Do <zaro0508@gmail.com> | 2013-12-03 20:06:53 +0000 |
commit | 9625e23b86090de17e7402f3dbfbe41924f73ed8 (patch) | |
tree | 2e14a7ff3314ef0227884229d07b755ff581504d /tools | |
parent | fc9ea6083714f4a0b29a7827441c6d314d880771 (diff) | |
download | pbr-9625e23b86090de17e7402f3dbfbe41924f73ed8.tar.gz |
show diff between pip installed packages and requirements
This change will display the difference between which python packages pip
installed and the packages from the requirements lists. It will print
the list of dependencies to the console (not including the directly declared
dependencies from the requirements list).
Closes-Bug: #1172417
Change-Id: I9363b50d6d7f5ef19c42bb2e30de45e352060ccd
Diffstat (limited to 'tools')
-rw-r--r-- | tools/integration.sh | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/tools/integration.sh b/tools/integration.sh index 53c0602..d74012f 100644 --- a/tools/integration.sh +++ b/tools/integration.sh @@ -7,9 +7,36 @@ function mkvenv { virtualenv $venv $venv/bin/pip install -U pip wheel } - export PIP_USE_WHEEL=true +# This function takes a list of files that contains +# a list of python packages (in pip freeze format) and +# strips the version info from each entry. +# $1 - The files containing python packages (with version). +function gen_bare_package_list () { + set +x + IN_FILES=$1 + for FILE in $IN_FILES + do + while read line; do + if [[ "$line" == "" ]] || [[ "$line" == \#* ]] || [[ "$line" == \-f* ]]; then + continue + elif [[ "$line" == \-e* ]]; then + echo "${line#*=}" + elif [[ "$line" == *\>* ]]; then + echo "${line%%>*}" + elif [[ "$line" == *\=* ]]; then + echo "${line%%=*}" + elif [[ "$line" == *\<* ]]; then + echo "${line%%<*}" + else + echo "${line%%#*}" + fi + done < $FILE + done + set -x +} + # BASE should be a directory with a subdir called "new" and in that # dir, there should be a git repository for every entry in PROJECTS BASE=${BASE:-/opt/stack} @@ -87,7 +114,13 @@ pbrsdistdir=$tmpdir/pbrsdist git clone $REPODIR/pbr $pbrsdistdir cd $pbrsdistdir -$pypimirrorvenv/bin/run-mirror -b remotes/origin/master --verbose -c $tmpdir/mirror.yaml --no-process +$pypimirrorvenv/bin/run-mirror -b remotes/origin/master --verbose -c $tmpdir/mirror.yaml --no-process --export=$HOME/mirror_package_list.txt +# Compare packages in the mirror with the list of requirements +gen_bare_package_list "$REPODIR/requirements/global-requirements.txt $REPODIR/requirements/dev-requirements.txt" > bare_all_requirements.txt +gen_bare_package_list $HOME/mirror_package_list.txt > bare_mirror_package_list.txt +echo "Diff between python mirror packages and requirements packages:" +grep -v -f bare_all_requirements.txt bare_mirror_package_list.txt > diff_requirements_mirror.txt +cat diff_requirements_mirror.txt $pypimirrorvenv/bin/pip install -i http://pypi.python.org/simple -d $tmpdownload/pip/openstack 'pip==1.0' 'setuptools>=0.7' |