On Mon, 26 Sep 2011 19:03, Frederic Crozat
Le lundi 26 septembre 2011 à 18:52 +0200, Jan Engelhardt a écrit :
On Monday 2011-09-26 17:35, Frederic Crozat wrote: <snip>
for service in %{?*} ; do \ sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'` \
What is it that is being stripped here? \.[a-z]* looks like it can wreak havoc all over the string. I guess something like this goes faster:
sysv_service="$service"; sysv_service="${service%.service}"; sysv_service="${service%.unit}";
Except I don't want to list all possible extensions units might have.
if not, $service should at least be quoted.
Not sure I'm following you here..
Hmm, I'm not a regex-guru, but think about adding a '$' sysv_service=`echo $service | sed -e 's/\\.[a-z]*$//g'` to make sure only the end of the string is cut. If you make this (the scripts) a extra package, a added "-branding" would be wrong, maybe a systemd-presets-<DISTRO> ? openSUSE would be systemd-presets-openSUSE and systemd-presets-SLE, RedHat could add systemd-presets-fedora and systemd-presets-RHEL, Ubuntu would be systemd-presets-ubuntu and so on. That way the real presets / defaults (default service on /off), and the distro diverse handling scripts could be handled in a transparent and easy to manage way (future updates, changes, ...) Just my 2 ct, and yes a cul-de-sac / blind alley in maintainance is ugly, let think and talk with the other distro's for a common nameing scheme beforehand. Cheers, Yamaban.