Set attributes to existing directories 01/87101/1
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 6 Sep 2016 09:44:22 +0000 (18:44 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 6 Sep 2016 09:44:22 +0000 (18:44 +0900)
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 <sunm.lee@samsung.com>
packaging/tizen-platform-config.spec

index ef01941..91a3013 100644 (file)
@@ -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