[Pkg-puppet-devel] New "make-mrconfig" in the pkg-puppet meta repository

Stig Sandbeck Mathisen ssm at debian.org
Fri Dec 18 20:37:15 UTC 2015


Sebastien Badia <seb at sebian.fr> writes:

> Hi Team!
>
> I've just pushed a new script in our project repository, this script
> is called « make-mrconfig », his goal is to generate the .mrconfig
> file using the list of our project repos in git.d.o:/git/pkg-puppet.
>
> https://anonscm.debian.org/cgit/pkg-puppet/meta.git/tree/bin/make-mrconfig
>
> If you're ok with this new script, I can maybe update mrconfig and
> gitignore with an initial launch of make-mrconfig.

Good idea.  Please go ahead and update.

We could probably just delete the pkg-puppet.git repo.


I'd like to propose a few changes, since I really can't resist tinkering
with shell scripts:

diff --git a/bin/make-mrconfig b/bin/make-mrconfig
index 943baa5..a63ef07 100755
--- a/bin/make-mrconfig
+++ b/bin/make-mrconfig
@@ -9,7 +9,7 @@ function msg() {
 }
 
 function output() {
-    echo "$1" >> $OUTPUT
+    echo "$1" >> "$OUTPUT"
 }
 
 msg "Setting up output file"
@@ -25,7 +25,14 @@ GIT_REPODIR="/git/pkg-puppet/"
 
 # Ignore pkg-puppet.git (it's a empty repo)
 # Ignore meta.git it's this repo :-)
-GIT_PKGS=`ssh git.debian.org "(cd $GIT_REPODIR && LC_ALL=C ls -1d *.git)" | sed '/meta.git/d;/pkg-puppet.git/d;s/.git$//' | LC_ALL=C sort`
+GIT_PKGS=$(
+export LC_ALL=C
+ssh git.debian.org \
+  find "$GIT_REPODIR" -maxdepth 1 -type d -name '*.git' -not -name 'meta.git' -not -name 'pkg-puppet.git' -print0 \
+  | xargs -r -0 -n1 basename \
+  | sort \
+  | sed -e 's/.git//'
+)
 
 msg "Generating mrconfig file in $OUTPUT"
 
@@ -82,7 +89,7 @@ checkout = git_checkout $i
 done
 
 for i in $GIT_PKGS; do
-       echo packages/$i
+       echo "packages/$i"
 done > .gitignore
 cat >> .gitignore <<EOF
 .mrconfig~



-- 
Stig Sandbeck Mathisen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20151218/8389f512/attachment.sig>


More information about the Pkg-puppet-devel mailing list