Review request branch wip-3768 remove perl dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi -

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

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 || :


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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux