From 84f8e4ef362736395819077e01d15b4a4a9382c8 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 31 Aug 2016 12:24:06 +0200 Subject: [PATCH] use stat -c for alpine linux --- lib/train/extras/stat.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/train/extras/stat.rb b/lib/train/extras/stat.rb index 359c875d..d045e3d8 100644 --- a/lib/train/extras/stat.rb +++ b/lib/train/extras/stat.rb @@ -34,9 +34,8 @@ def self.stat(shell_escaped_path, backend, follow_symlink) def self.linux_stat(shell_escaped_path, backend, follow_symlink) lstat = follow_symlink ? ' -L' : '' - format = backend.os.esx? ? '-c' : '--printf' + format = (backend.os.esx? || backend.os[:name] == 'alpine') ? '-c' : '--printf' res = backend.run_command("stat#{lstat} #{shell_escaped_path} 2>/dev/null #{format} '%s\n%f\n%U\n%u\n%G\n%g\n%X\n%Y\n%C'") - # ignore the exit_code: it is != 0 if selinux labels are not supported # on the system.