coreutils
coreutils copied to clipboard
install: arch - yay build may failed due to not finding or permissions of files in cache
Upgrading packaged on arch using yay (to build google-chrome as example) may fail due to missing permissions to folder or not being able to find files in there it self.
Test case:
#!/bin/sh
export projRoot=$HOME/TestError/
export projDest=$HOME/TestError/dest/
mkdir -p $projRoot/
mkdir -p $projRoot/src/
mkdir -p $projRoot/dest/
cd $projRoot
touch test.sh
ln -fs /opt/FakeDestination "$projDest"test.sh # Fake destination
# Permissions
chmod +x test.sh
cd $projRoot/src/
ln -sf $projRoot/test.sh test.sh
install "$projRoot"test.sh "$projDest"test.sh
I am sorry but I don't see how this bug is actionable ?!
Removing the rewrite of install and using the default does not causes this issue.
ok but sorry: not providing any step to reproduce or error message isn't helping.
Sorry, fixed with log as well as with a StR.
Thanks but the str should be simple test case, not install Chrome with a package manager ;)
It's the easiest way of replicate it ;D Unsure exactly what is up else i would have done a better test case.
we need something like
$ mkdir foo
$ install --fail-option foo bar
KABOOM
Took me some digging.
The problem here is the softlink ln -fs /opt/FakeDestination "$projDest"test.sh were it seams to check the permission for the destination with or without it existence or relevance to what it is about to do.
From tar files (reason why this fails) there are softlinks going to non existing or existing paths.
In the google-chrome example above for instance there is a couple of softlinks inside of data.tar.xz after unpacking and attempt to replace them permissions is checked for the non existing file /opt/google/chrome/google-chrome and permissions are denied. (i could be wrong but it seamed to me like a plausible explanation to why ^^)
Here is a script setting up and making the problem happen.
#!/bin/sh
export projRoot=$HOME/TestError/
export projDest=$HOME/TestError/dest/
mkdir -p $projRoot/
mkdir -p $projRoot/src/
mkdir -p $projRoot/dest/
cd $projRoot
touch test.sh
ln -fs /opt/FakeDestination "$projDest"test.sh # Fake destination
# Permissions
chmod +x test.sh
cd $projRoot/src/
ln -sf $projRoot/test.sh test.sh
install "$projRoot"test.sh "$projDest"test.sh
Thanks; i updated comment #0
i took this issue and tried to address it in the pull request #5851