Skip to content

Commit

Permalink
importer: Allow /usr/local RPM content
Browse files Browse the repository at this point in the history
Obviously, this alone is not enough to expose that content but it's a
start. Currently as is, it'll get nuked when we replace `/usr/local` by
a symlink in postprocessing. A future patch will address that part.

Part of coreos#233.
  • Loading branch information
jlebon committed Jan 26, 2024
1 parent 6844bc2 commit d7e2975
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rust/src/importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ fn path_is_ostree_compliant(path: &str) -> bool {
return true;
}

if path.starts_with("/usr/") && !path.starts_with("/usr/local") {
if path.starts_with("/usr/") {
return true;
}

Expand Down Expand Up @@ -491,7 +491,7 @@ mod tests {
assert_eq!(path_is_ostree_compliant(entry), false, "{}", entry);
}

let denied_cases = &["/var", "/etc", "/var/run", "/usr/local", "", "./", "usr/"];
let denied_cases = &["/var", "/etc", "/var/run", "", "./", "usr/"];
for entry in denied_cases {
assert_eq!(path_is_ostree_compliant(entry), false, "{}", entry);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/vmcheck/test-layering-basic-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ vm_build_rpm test-usrlocal \
if vm_rpmostree install test-usrlocal-1.0 2>err.txt; then
assert_not_reached "Was able to install a package in /usr/local/"
fi
assert_file_has_content err.txt "Unsupported path; see https://github.com/projectatomic/rpm-ostree/issues/233"
# this error is worse now than it used to be now that we experimentally *do* support /usr/local RPMs
assert_file_has_content err.txt "opendir(local): No such file or directory"

echo "ok failed to install in /usr/local"

Expand Down

0 comments on commit d7e2975

Please sign in to comment.