-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic qnx support for train (#203)
* add basic qnx support for train Signed-off-by: Christoph Hartmann <[email protected]> * lint Signed-off-by: Dominik Richter <[email protected]>
- Loading branch information
1 parent
8fb6a6b
commit 38e0fde
Showing
5 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# encoding: utf-8 | ||
# author: Christoph Hartmann | ||
# author: Dominik Richter | ||
|
||
module Train::Extras | ||
class QnxFile < UnixFile | ||
def content | ||
cat = 'cat' | ||
cat = '/proc/boot/cat' if @backend.os[:release].to_i >= 7 | ||
@content ||= case | ||
when !exist? | ||
nil | ||
else | ||
@backend.run_command("#{cat} #{@spath}").stdout || '' | ||
end | ||
end | ||
|
||
def type | ||
if @backend.run_command("file #{@spath}").stdout.include?('directory') | ||
return :directory | ||
else | ||
return :file | ||
end | ||
end | ||
|
||
%w{ | ||
mode owner group uid gid mtime size selinux_label link_path mounted stat | ||
}.each do |field| | ||
define_method field.to_sym do | ||
fail NotImplementedError, "QNX does not implement the #{m}() method yet." | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters