From d79061fb44090497e31b9644105b7c59a62e40b3 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Sun, 7 Jul 2013 18:16:18 +0400 Subject: [PATCH] xdg-user-dirs: employ control feature Maybe the conditionals shouldn't be too terse, by the way... --- features.in/xdg-user-dirs/config.mk | 3 ++- .../rootfs/image-scripts.d/35-xdg-user-dirs | 13 +++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/features.in/xdg-user-dirs/config.mk b/features.in/xdg-user-dirs/config.mk index 65f70806..e582a921 100644 --- a/features.in/xdg-user-dirs/config.mk +++ b/features.in/xdg-user-dirs/config.mk @@ -1,5 +1,6 @@ -use/xdg-user-dirs: +use/xdg-user-dirs: use/control @$(call add_feature) + @$(call add,CONTROL,xdg-user-dirs:enabled) @$(call add,THE_PACKAGES,xdg-user-dirs) @$(call xport,XDG_USER_DIRS) diff --git a/features.in/xdg-user-dirs/rootfs/image-scripts.d/35-xdg-user-dirs b/features.in/xdg-user-dirs/rootfs/image-scripts.d/35-xdg-user-dirs index 7461d018..426dc239 100755 --- a/features.in/xdg-user-dirs/rootfs/image-scripts.d/35-xdg-user-dirs +++ b/features.in/xdg-user-dirs/rootfs/image-scripts.d/35-xdg-user-dirs @@ -1,18 +1,15 @@ #!/bin/sh -# turn on xdg-user-dirs.and tweak its defaults if told so -# (using tuples like "PHOTOS:Documents/Pictures") +# tweak xdg-user-dirs defaults if told so +# using tuples like "PHOTOS:Documents/Pictures" . shell-config CONFIG="/etc/xdg/user-dirs.defaults" -if control xdg-user-dirs enabled; then - if [ -n "$GLOBAL_XDG_USER_DIRS" ]; then - echo "$GLOBAL_XDG_USER_DIRS" \ - | tr ' ' '\n' \ +[ -z "$GLOBAL_XDG_USER_DIRS" ] || + echo "$GLOBAL_XDG_USER_DIRS" \ + | tr ' ' '\n' \ | while IFS=':' read k v; do [ -n "$k" -a -n "$v" ] || continue shell_config_set "$CONFIG" "$k" "$v" done - fi -fi