From 90acfc3952c09afbbbf72ef9a1883ae8358ca456 Mon Sep 17 00:00:00 2001 From: Manuel Hutter Date: Tue, 10 Jun 2014 19:19:26 +0200 Subject: [PATCH 1/2] Fixed stat on OSX --- cdist/conf/type/__ccollect_source/explorer/stat | 11 ++++++++++- cdist/conf/type/__directory/explorer/stat | 9 ++++++++- cdist/conf/type/__file/explorer/stat | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__ccollect_source/explorer/stat b/cdist/conf/type/__ccollect_source/explorer/stat index 298221b7..3b6f3dc3 100755 --- a/cdist/conf/type/__ccollect_source/explorer/stat +++ b/cdist/conf/type/__ccollect_source/explorer/stat @@ -25,7 +25,7 @@ destination="/$__object_id" os=$("$__explorer/os") case "$os" in - "freebsd") + "freebsd"|"openbsd") # FIXME: should be something like this based on man page, but can not test stat -f "type: %ST owner: %Du %Su @@ -35,6 +35,15 @@ size: %Dz links: %Dl " "$destination" ;; + "macosx") + stat -f "type: %HT + owner: %Du %Su + group: %Dg %Sg + mode: %Op %Sp + size: %Dz + links: %Dl + " "$destination" + ;; *) stat --printf="type: %F owner: %u %U diff --git a/cdist/conf/type/__directory/explorer/stat b/cdist/conf/type/__directory/explorer/stat index d8cdbb9e..6e021cdb 100755 --- a/cdist/conf/type/__directory/explorer/stat +++ b/cdist/conf/type/__directory/explorer/stat @@ -25,7 +25,7 @@ destination="/$__object_id" os=$("$__explorer/os") case "$os" in - "freebsd") + "freebsd"|"openbsd") # FIXME: should be something like this based on man page, but can not test stat -f "type: %ST owner: %Du %Su @@ -33,6 +33,13 @@ group: %Dg %Sg mode: %Op %Sp " "$destination" ;; + "macosx") + stat -f "type: %HT + owner: %Du %Su + group: %Dg %Sg + mode: %Op %Sp + " "$destination" + ;; *) stat --printf="type: %F owner: %u %U diff --git a/cdist/conf/type/__file/explorer/stat b/cdist/conf/type/__file/explorer/stat index 52570379..876988f0 100755 --- a/cdist/conf/type/__file/explorer/stat +++ b/cdist/conf/type/__file/explorer/stat @@ -33,6 +33,15 @@ group: %Dg %Sg mode: %Op %Sp size: %Dz links: %Dl +" "$destination" + ;; + "macosx") + stat -f "type: %HT +owner: %Du %Su +group: %Dg %Sg +mode: %Op %Hp +size: %Dz +links: %Dl " "$destination" ;; *) From 8a70343e2c2606a444e3c88a91125690a3b9f4d1 Mon Sep 17 00:00:00 2001 From: Manuel Hutter Date: Tue, 10 Jun 2014 19:48:02 +0200 Subject: [PATCH 2/2] Fixed wrong mode format for stat on OSX. --- cdist/conf/type/__ccollect_source/explorer/stat | 2 +- cdist/conf/type/__directory/explorer/stat | 2 +- cdist/conf/type/__file/explorer/stat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__ccollect_source/explorer/stat b/cdist/conf/type/__ccollect_source/explorer/stat index 3b6f3dc3..7c86d94f 100755 --- a/cdist/conf/type/__ccollect_source/explorer/stat +++ b/cdist/conf/type/__ccollect_source/explorer/stat @@ -39,7 +39,7 @@ links: %Dl stat -f "type: %HT owner: %Du %Su group: %Dg %Sg - mode: %Op %Sp + mode: %Lp %Sp size: %Dz links: %Dl " "$destination" diff --git a/cdist/conf/type/__directory/explorer/stat b/cdist/conf/type/__directory/explorer/stat index 6e021cdb..077aa43b 100755 --- a/cdist/conf/type/__directory/explorer/stat +++ b/cdist/conf/type/__directory/explorer/stat @@ -37,7 +37,7 @@ mode: %Op %Sp stat -f "type: %HT owner: %Du %Su group: %Dg %Sg - mode: %Op %Sp + mode: %Lp %Sp " "$destination" ;; *) diff --git a/cdist/conf/type/__file/explorer/stat b/cdist/conf/type/__file/explorer/stat index 876988f0..00e34cca 100755 --- a/cdist/conf/type/__file/explorer/stat +++ b/cdist/conf/type/__file/explorer/stat @@ -39,7 +39,7 @@ links: %Dl stat -f "type: %HT owner: %Du %Su group: %Dg %Sg -mode: %Op %Hp +mode: %Lp %Sp size: %Dz links: %Dl " "$destination"