From 44c9d09383ca8b3d9fc54fe6574e6fde65e30d83 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Fri, 12 Apr 2019 16:03:38 +0300 Subject: [PATCH 1/5] fix __(file|directory)/explorer/stat for BSDs --- cdist/conf/type/__directory/explorer/stat | 16 ++++------------ cdist/conf/type/__file/explorer/stat | 16 +++------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/cdist/conf/type/__directory/explorer/stat b/cdist/conf/type/__directory/explorer/stat index 41bc8b04..3d150a21 100755 --- a/cdist/conf/type/__directory/explorer/stat +++ b/cdist/conf/type/__directory/explorer/stat @@ -25,21 +25,13 @@ destination="/$__object_id" os=$("$__explorer/os") case "$os" in - "freebsd"|"netbsd"|"openbsd") - # FIXME: should be something like this based on man page, but can not test - stat -f "type: %ST + "freebsd"|"netbsd"|"openbsd"|"macosx") + stat -f "type: %HT owner: %Du %Su group: %Dg %Sg -mode: %Op %Sp -" "$destination" +mode: %Lp %Sp +" "$destination" | awk '/^type/ { print tolower($0); next; } { print; }' ;; - "macosx") - stat -f "type: %HT - owner: %Du %Su - group: %Dg %Sg - mode: %Lp %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 8a917556..fec0d6f3 100755 --- a/cdist/conf/type/__file/explorer/stat +++ b/cdist/conf/type/__file/explorer/stat @@ -25,24 +25,14 @@ destination="/$__object_id" os=$("$__explorer/os") case "$os" in - "freebsd"|"netbsd"|"openbsd") - # FIXME: should be something like this based on man page, but can not test - stat -f "type: %ST -owner: %Du %Su -group: %Dg %Sg -mode: %Op %Sp -size: %Dz -links: %Dl -" "$destination" - ;; - "macosx") - stat -f "type: %HT + "freebsd"|"netbsd"|"openbsd"|"macosx") + stat -f "type: %HT owner: %Du %Su group: %Dg %Sg mode: %Lp %Sp size: %Dz links: %Dl -" "$destination" +" "$destination" | awk '/^type/ { print tolower($0); next; } { print; }' ;; *) stat --printf="type: %F From 4d9a8d78f7cac887e8589e05aba511941db85117 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 13 Apr 2019 19:50:44 +0200 Subject: [PATCH 2/5] ++changelog --- docs/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog b/docs/changelog index 7a89dd75..202fa00c 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,6 +5,8 @@ next: * Core: Fix broken quiet mode (Darko Poljak) * Build: Add version.py into generated raw source archive (Darko Poljak) * Explorer disks: Fix detecting disks, fix/add support for BSDs (Ander Punnar) + * Type __file: Fix stat explorer for BSDs (Ander Punnar) + * Type __directory: Fix stat explorer for BSDs (Ander Punnar) 4.10.10: 2019-04-11 * New types: __ufw and __ufw_rule (Mark Polyakov) From b37b25f57332aaf9fd91b09503a3e88cf213a6fc Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 13 Apr 2019 19:53:54 +0200 Subject: [PATCH 3/5] Release 4.10.11 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 202fa00c..84c59d98 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +4.10.11: 2019-04-13 * Core: Fix broken quiet mode (Darko Poljak) * Build: Add version.py into generated raw source archive (Darko Poljak) * Explorer disks: Fix detecting disks, fix/add support for BSDs (Ander Punnar) From 51e650423e1075d3a49816c31a6fefee5896517b Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 13 Apr 2019 20:43:11 +0200 Subject: [PATCH 4/5] Fix version.py location inside raw source archive Note that this fix only matters for maintainers using build-helper script. Source archive is generated during release process and uploaded to github, along its signature. For 4.10.11 those files were fixed and uploaded manually after build-helper script process has been finished. In future releases this process will be automatic - no need for manual step that was necessary for 4.10.11. --- bin/build-helper | 5 ++++- bin/build-helper.freebsd | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index de4ced71..963f02f9 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -200,7 +200,10 @@ eof || exit 1 # make sure target version is generated "$0" target-version - tar -r -f "${archivename}" cdist/version.py || exit 1 + tar -x -f "${archivename}" || exit 1 + cp cdist/version.py "cdist-${tag}/cdist/version.py" || exit 1 + tar -c -f "${archivename}" "cdist-${tag}/" || exit 1 + rm -r -f "cdist-${tag}/" gzip "${archivename}" || exit 1 archivename="${archivename}.gz" fi diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index 2c5a54a7..58d985a6 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -235,7 +235,10 @@ eof || exit 1 # make sure target version is generated "$0" target-version - tar -r -f "${archivename}" cdist/version.py || exit 1 + tar -x -f "${archivename}" || exit 1 + cp cdist/version.py "cdist-${tag}/cdist/version.py" || exit 1 + tar -c -f "${archivename}" "cdist-${tag}/" || exit 1 + rm -r -f "cdist-${tag}/" gzip "${archivename}" || exit 1 archivename="${archivename}.gz" fi From d18584b4ffd29e295042b0498953ba622adccfd0 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 13 Apr 2019 20:54:59 +0200 Subject: [PATCH 5/5] Update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 320d150d..460bbf28 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ _build/ docs/dist # Ignore temp files used for signing +cdist-*.tar cdist-*.tar.gz cdist-*.tar.gz.asc