Properly handle unit names with dashes in them

We ended up with files in /etc/systemd/system called
"bigx2ddata.mount.wants" rather than "big\x2ddata.mount.wants".
This commit is contained in:
Eelco Dolstra 2013-11-12 16:58:36 +01:00
parent 86038eaa1d
commit 4cada34b7f

View File

@ -348,14 +348,14 @@ let
${concatStrings (mapAttrsToList (name: unit: ${concatStrings (mapAttrsToList (name: unit:
concatMapStrings (name2: '' concatMapStrings (name2: ''
mkdir -p $out/${name2}.wants mkdir -p $out/'${name2}.wants'
ln -sfn ../${name} $out/${name2}.wants/ ln -sfn '../${name}' $out/'${name2}.wants'/
'') unit.wantedBy) cfg.units)} '') unit.wantedBy) cfg.units)}
${concatStrings (mapAttrsToList (name: unit: ${concatStrings (mapAttrsToList (name: unit:
concatMapStrings (name2: '' concatMapStrings (name2: ''
mkdir -p $out/${name2}.requires mkdir -p $out/'${name2}.requires'
ln -sfn ../${name} $out/${name2}.requires/ ln -sfn '../${name}' $out/'${name2}.requires'/
'') unit.requiredBy) cfg.units)} '') unit.requiredBy) cfg.units)}
ln -s ${cfg.defaultUnit} $out/default.target ln -s ${cfg.defaultUnit} $out/default.target