From eef7b8b5a57199d5c2c5a4c905f148a53d5a8577 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 30 Nov 2016 22:18:16 -0500 Subject: [PATCH] now also unifies plugins in same dir structure --- hacking/unify_repos.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hacking/unify_repos.sh b/hacking/unify_repos.sh index fde2953862e..57f7e019141 100755 --- a/hacking/unify_repos.sh +++ b/hacking/unify_repos.sh @@ -33,3 +33,24 @@ git commit -am 'core modules back to main repo' git merge -s ours --allow-unrelated-histories --no-commit extras_modules/devel git read-tree --prefix=lib/ansible/modules/extras -u extras_modules/devel git commit -am 'extras modules back to main repo' + +for subdir in core extras +do + # unify directories + for mydir in $(find lib/ansible/modules/${subdir} -type d) + do + mkdir -p ${mydir/$subdir\//} + done + + # move plugins + for myfile in $(find lib/ansible/modules/${subdir} -type f|grep -v '.github') + do + if [ -e ${myfile/$subdir\///} ]; then #mostly to avoid __init__.py clobering + echo "skipping ${myfile} as it already exists in destination" + else + git mv ${myfile} ${myfile/$subdir\//} + fi + done + + git rm -rf lib/ansible/modules/${subdir} +done