sudo: Elevate priviliges before adding metadata after relocating a cask, if necessary
Homebrew cannot assume that target location is writable for chmod and xattr.
This commit is contained in:
parent
55f399c10d
commit
730a3de1b9
@ -89,11 +89,14 @@ module Cask
|
|||||||
altnames = "(#{altnames})"
|
altnames = "(#{altnames})"
|
||||||
|
|
||||||
# Some packages are shipped as u=rx (e.g. Bitcoin Core)
|
# Some packages are shipped as u=rx (e.g. Bitcoin Core)
|
||||||
command.run!("/bin/chmod", args: ["--", "u+rw", file, file.realpath])
|
command.run!("/bin/chmod",
|
||||||
|
args: ["--", "u+rw", file, file.realpath],
|
||||||
|
sudo: !file.writable? || !file.realpath.writable?)
|
||||||
|
|
||||||
command.run!("/usr/bin/xattr",
|
command.run!("/usr/bin/xattr",
|
||||||
args: ["-w", ALT_NAME_ATTRIBUTE, altnames, file],
|
args: ["-w", ALT_NAME_ATTRIBUTE, altnames, file],
|
||||||
print_stderr: false)
|
print_stderr: false,
|
||||||
|
sudo: !file.writable?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def printable_target
|
def printable_target
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user