swhid 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/swhid/from_filesystem.rb +8 -4
- data/lib/swhid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55ef264a7547cae4c3e201c8c4b745ea42437173efd681623bf7307c0bf58b0d
|
|
4
|
+
data.tar.gz: d851e19c5511018c5ded8e853306650414b1708a99fd10837f2e6d62a6266f13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db250c4038a39aa01d3a73c83a1d11ebf907a7465649b69cbff3ed3c9b44e758519c2573ca949fabc996b43ae737a5259d41c1d143ecb1dc980813dc2d6c54cc
|
|
7
|
+
data.tar.gz: abaa8a4ca6c33cc718c28f573641a207c6458c8dcb4df4440759583cd1dd9394a60c507c0d29795e4149218b1bcba8b212ee83114e1bbf6a6f0ebe99135328ef
|
data/CHANGELOG.md
CHANGED
|
@@ -57,7 +57,8 @@ module Swhid
|
|
|
57
57
|
def self.file_executable?(full_path, stat, git_repo, permissions = nil)
|
|
58
58
|
# Check explicit permissions map first (from tar extraction, etc.)
|
|
59
59
|
if permissions
|
|
60
|
-
|
|
60
|
+
real_path = File.realpath(full_path) rescue File.expand_path(full_path)
|
|
61
|
+
mode = permissions[full_path] || permissions[real_path]
|
|
61
62
|
return (mode & 0o111) != 0 if mode
|
|
62
63
|
end
|
|
63
64
|
|
|
@@ -81,13 +82,16 @@ module Swhid
|
|
|
81
82
|
repo_workdir = git_repo.workdir
|
|
82
83
|
return nil unless repo_workdir
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
# Use realpath to resolve symlinks (e.g., /tmp -> /private/tmp on macOS)
|
|
86
|
+
full_path = File.realpath(full_path) rescue File.expand_path(full_path)
|
|
87
|
+
repo_workdir = File.realpath(repo_workdir) rescue File.expand_path(repo_workdir)
|
|
88
|
+
|
|
89
|
+
# Ensure repo_workdir ends with separator for proper prefix matching
|
|
90
|
+
repo_workdir = repo_workdir.chomp("/").chomp("\\") + "/"
|
|
86
91
|
|
|
87
92
|
return nil unless full_path.start_with?(repo_workdir)
|
|
88
93
|
|
|
89
94
|
relative = full_path.sub(repo_workdir, "")
|
|
90
|
-
relative = relative[1..] if relative.start_with?("/") || relative.start_with?("\\")
|
|
91
95
|
relative.tr("\\", "/")
|
|
92
96
|
end
|
|
93
97
|
end
|
data/lib/swhid/version.rb
CHANGED