From: Sunmin Lee Date: Tue, 6 Sep 2016 09:44:22 +0000 (+0900) Subject: Set attributes to existing directories X-Git-Tag: submit/tizen/20160909.055251~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55bd39bbd04019b9872e94bc900c65ad2379324e;p=platform%2Fcore%2Fsystem%2Ftizen-platform-config.git Set attributes to existing directories In spec files, this package includes a list of directories which made by this package with some attributes (permission, smack). However, if some directory already existed, the mkdir command is ignored and so the file permission is not changed. To apply the attributes in the list properly, the chmod should be done instead if the directory exists. Change-Id: I6044ba06dbefb639ee781fddab564a5ec23fa3e7 Signed-off-by: Sunmin Lee --- diff --git a/packaging/tizen-platform-config.spec b/packaging/tizen-platform-config.spec index ef01941..91a3013 100644 --- a/packaging/tizen-platform-config.spec +++ b/packaging/tizen-platform-config.spec @@ -132,7 +132,11 @@ while read s1 s2 s3; do done | LANG=C sort | while read dirname mode context transmute; do - mkdir -p -m "$mode" "$dirname" + if [ -e "$dirname" ]; then + chmod "$mode" "$dirname" + else + mkdir -p -m "$mode" "$dirname" + fi if [ "$transmute" = true ]; then chsmack -a "$context" -t "$dirname" else