diff mbox

Review request branch wip-3768 remove perl dependency

Message ID F40EEEA9-2D0B-41E3-8C5A-D84AADFFED88@inktank.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gary Lowell Feb. 5, 2013, 1:35 a.m. UTC
Hi -

This is a relatively small change but involves changing a perl regex to sed:


I'd really appreciate any feedback on the new sed regex.  Also, I suspect that the for loop is not needed any longer since type is unused.

Thanks
Gary

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/logrotate.conf b/src/logrotate.conf
index 9af3104..0a4a5a2 100644
--- a/src/logrotate.conf
+++ b/src/logrotate.conf
@@ -15,7 +15,7 @@ 
             #   https://bugs.launchpad.net/upstart/+bug/1012938
             for type in mon osd mds; do
                initctl list \
-                   | perl -ne 'print "$+{service} cluster=$+{cluster} id=$+{id}\n" if m{^(?<service>ceph-(mon|osd|mds)+)\s+\((?<cluster>[^/)]+)/(?<id>[^)]+)\) start/}' \
+                   | sed -n 's/^\(ceph-\(mon\|osd\|mds\)\+\)[ \t]\+(\([^ \/]\+\)\/\([^ \/]\+\))[ \t]\+start\/.*$/\1 cluster=\3 id=\4/p' \
                    | while read l; do
                    initctl reload -- $l 2>/dev/null || :