Skip to content

Commit

Permalink
Generalize distributions imports listing
Browse files Browse the repository at this point in the history
This makes it really easy to add new parts to keep lists of which
distributions import a specific, or a group of, distributions.
  • Loading branch information
gforcada committed Feb 20, 2014
1 parent cfdfb0a commit e9dccee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
5 changes: 3 additions & 2 deletions jenkins-package-dependencies.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ distributions = CMFCore CMFDefault CMFDiffTool CMFDynamicViewFTI CMFEditions CMF

[jenkins-package-dependencies-cmf-imports]
recipe = collective.recipe.template
input = templates/jenkins-package-dependencies-cmf-imports.sh
input = templates/jenkins-package-dependencies-imports.sh
output = ${buildout:bin-directory}/jenkins-package-dependencies-cmf-imports
mode = 755
distributions = Products.CMFCore Products.CMFDefault Products.CMFDiffTool Products.CMFDynamicViewFTI Products.CMFEditions Products.CMFFormController Products.CMFPlacefulWorkflow Products.CMFQuickInstallerTool Products.CMFUid

[jenkins-package-dependencies-pac]
recipe = collective.recipe.template
Expand All @@ -51,4 +52,4 @@ recipe = collective.recipe.template
input = templates/jenkins-package-dependencies-imports.sh
output = ${buildout:bin-directory}/jenkins-package-dependencies-pac-imports
mode = 755
distribution = plone.app.contenttypes
distributions = plone.app.contenttypes
19 changes: 0 additions & 19 deletions templates/jenkins-package-dependencies-cmf-imports.sh

This file was deleted.

23 changes: 17 additions & 6 deletions templates/jenkins-package-dependencies-imports.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/bin/sh
package_name="${distribution}"
echo "Scanning for imports of $package_name"
DISTRIBUTIONS="${distributions}"
FOLDER=deps
if [ ! -d $FOLDER ]
then
mkdir $FOLDER
fi

grep --include=*.py -R $package_name parts/packages | grep -v "plone/app/contenttypes" > $package_name.txt
sed -i 's/parts\/packages\///' $package_name.txt
for dist in $DISTRIBUTIONS
do
echo "Scanning for imports of $dist"
dist_folder=`echo $dist | sed 's/\./\//g'`
dist_path="$FOLDER/$dist"

counter=`wc -l $package_name.txt |cut -d" " -f1`
echo "Found $counter imports"
grep --include=*.py -R $dist parts/packages | grep -v $dist_folder > $dist_path.txt
sed -i 's/parts\/packages\///' $dist_path.txt

counter=`wc -l $dist_path.txt |cut -d" " -f1`
echo "Found $counter imports"
done

0 comments on commit e9dccee

Please sign in to comment.