[OpenWrt-Devel] [PATCH] Fix regular expression in sysupgrade

Преподобный Гомер mk.43.ecko at gmail.com
Fri Aug 19 11:47:29 EDT 2016


Previous regular expression in sed allowed strings that starts with space.

$ cat sysupgrade.conf
## This file contains files and directories that should
## be preserved during an upgrade.

# /etc/example.conf
 # /etc/openvpn/
/etc/config
/etc/profile
/etc/firewall.user
/etc/TC_hfsc.sh
/etc/hotplug.d/iface/30-trafficc
/etc/init.d/trafficc
/root
/etc/crontabs/root
$ sed -ne '/^[[:space:]]*$/d; /^#/d; p' sysupgrade.conf
 # /etc/openvpn/
/etc/config
/etc/profile
/etc/firewall.user
/etc/TC_hfsc.sh
/etc/hotplug.d/iface/30-trafficc
/etc/init.d/trafficc
/root
/etc/crontabs/root

This patch fixes that problem
$ sed -ne '/^[[:space:]]*\($\|#\)/d; p' sysupgrade.conf
/etc/config
/etc/profile
/etc/firewall.user
/etc/TC_hfsc.sh
/etc/hotplug.d/iface/30-trafficc
/etc/init.d/trafficc
/root
/etc/crontabs/root

--
Regards,
R.H.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sysupgrade-Fix-regular-expression.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160819/51e70c45/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list