diff options
author | Stijn Seghers | 2020-05-03 18:23:44 +1200 |
---|---|---|
committer | Stijn Seghers | 2020-05-03 18:23:44 +1200 |
commit | e1002f13fcc953ba01878dde179667c426a9d27d (patch) | |
tree | 5a6b94dccb9d5e64636f9103d00286ded28ae0d6 | |
parent | 3c80c150644ceed5ae4d2edd17b9fe842136a5e0 (diff) | |
download | aur-e1002f13fcc953ba01878dde179667c426a9d27d.tar.gz |
Ensure correct file ownership & permissions
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 11 |
2 files changed, 9 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = stylelint-config-standard pkgdesc = The standard shareable config for stylelint pkgver = 20.0.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/stylelint/stylelint-config-standard arch = any license = MIT @@ -2,7 +2,7 @@ pkgname=stylelint-config-standard pkgver=20.0.0 -pkgrel=1 +pkgrel=2 pkgdesc='The standard shareable config for stylelint' arch=('any') url="https://github.com/stylelint/$pkgname" @@ -14,11 +14,16 @@ noextract=("$pkgname-$pkgver.tgz") sha256sums=('319be7098308a54e59148bd874eb97a25febf0b33c677d88b4adb87884720d79') package() { - npm install -g --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz" + npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz" - # For some odd reason, npm makes some directories world writeable D: + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. find "$pkgdir/usr" -type d -exec chmod 755 {} + + # npm gives ownership of ALL FILES to build user + # https://bugs.archlinux.org/task/63396 + chown -R root:root "$pkgdir" + # Install license in the usual place local _npmdir="$pkgdir/usr/lib/node_modules/" install -Dm644 "$_npmdir/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" |