You are not logged in.
I was looking at a PKGBUILD file (the one for lib32-libjpeg6-turbo), and I saw this line:
rm -rf "${pkgdir}"/usr/{bin,include,share}
It looks like it will attempt to erase /usr/bin, /usr/include, and /usr/share. I am wondering if this is actually the case, or if the contents of "${pkgdir}" prevents that from happening. I know that Arch Build System also creates a fake root, is that what is getting cleared?
Last edited by DCengineer (2016-05-02 04:02:23)
Offline
It's doing this in $pkgdir, not your root filesystem
Last edited by Scimmia (2016-05-02 10:51:48)
Offline
In theory it's not safe -- for example if you copied it to your own script where $pkgdir is not defined, and ran it as root, then yes it would wipe those important paths.
Within a PKGBUILD, it's practically safe since (baring any bugs) $pkgdir is always set correctly, and should be running inside a fakeroot environment as a non-root user to protect your actual filesystem.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Where is $pkgdir defined? My guess is that it is intentionally not defined directly in PKGBUILD
Offline
$pkgdir is setup by `makepkg`
Check the "PACKAGING FUNCTIONS" section of the PKGBUILD man page.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline