Archived
3
0

Weird backend manifest format update.

This commit is contained in:
Luka Vandervelden 2019-09-14 17:44:01 +02:00
parent 817f6fe51c
commit 5bfaacfd09

View File

@ -60,15 +60,17 @@ class WeirdBackend < Package::Backend::Packaging
Dir.cd package.fake_root_directory
FileUtils.find "." do |path|
file = path.lchop
if File.symlink? path
manifest.puts [path, "symlink", File.readlink(path)].join ':'
manifest.puts [file, "symlink", File.readlink(path)].join ':'
elsif File.directory? path
manifest.puts [path, "directory"].join ':'
manifest.puts [file, "directory"].join ':'
elsif File.info?(path).try &.file?
digest = OpenSSL::Digest.new("sha256").file(path).hexdigest
manifest.puts [path, "file", digest].join ':'
manifest.puts [file, "file", digest].join ':'
else
manifest.puts [path, "other"].join ':'
manifest.puts [file, "other"].join ':'
end
end