This avoids confusing "No such file or directory" errors as demonstrated
by the following test case:
$ ln -s /foo/bar /tmp/sudo-1.8.29rc1.tar.gz
$ wget http://distfiles.gentoo.org/distfiles/sudo-1.8.29rc1.tar.gz -O /tmp/sudo-1.8.29rc1.tar.gz
/tmp/sudo-1.8.29rc1.tar.gz: No such file or directory
Bug: https://bugs.gentoo.org/697734
Bug: https://bugs.gentoo.org/698046
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Zac Medico <zmedico@gentoo.org>
python_prepare_all() {
distutils-r1_python_prepare_all
- # Apply 0299aedef74e47c0a68acf7905d8714c9578f125 for bug 698046.
+ # Apply 0299aedef74e47c0a68acf7905d8714c9578f125 and
+ # 1ca5b822133171b131cef3dc15dc43583893ad6b for bug 698046.
sed -e 's|rsync -avP|rsync -LtvP|' -i lib/portage/tests/util/test_getconfig.py || die
+ sed -e 's|if os.stat(download_path).st_size == 0:|mystat = os.lstat(download_path)\n\t\t\t\t\t\tif mystat.st_size == 0 or (stat.S_ISLNK(mystat.st_mode) and not os.path.exists(download_path)):|' \
+ -i lib/portage/package/ebuild/fetch.py || die
# Apply 26fd7ffdd5b74af3aeedf0e6a87ac6b3d1243848 for bug 698474.
sed -e 's|if "local" in custommirrors:|if try_mirrors and "local" in custommirrors:|' -i lib/portage/package/ebuild/fetch.py || die