Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // By convention, anything in the bin/ directory of the package is a
  2. // binary. This is done for some old dists missing the X bits in those dirs
  3. let is_bin = if let Some(p) = full_path.parent() {
  4. // An optimisation for efficiency would be to detect this in the
  5. // components iteration rather than re-calculating path parent() here.
  6. p.ends_with("bin")
  7. } else {
  8. false
  9. };
  10. // Directories and any files marked X and anything shipped in bin keep the X bit.
  11. let needs_x = is_dir || tar_mode & 0o100 == 0o100 || is_bin;
  12. let mode = if needs_x { 0o755 } else { 0o644 };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement