Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 389647 - app-portage/gentoolkit: revdep-rebuild does not understand symlinks
Summary: app-portage/gentoolkit: revdep-rebuild does not understand symlinks
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-05 17:06 UTC by Ed Tomlinson
Modified: 2017-04-27 19:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Tomlinson 2011-11-05 17:06:52 UTC
I have my root on flash and have the following symlink.

ls -l /var
lrwxrwxrwx 1 root root 13 Mar  5  2011 /var -> /mnt/sdb3/var

Runing revdep-rebuild gives:

* Configuring search environment for revdep-rebuild
* Working directory expected to be /var/cache/revdep-rebuild, but it is /mnt/sdb3/var/cache/revdep-rebuild

Can this verification please be done in a way that works with symlinks?

Thanks


Reproducible: Always

Steps to Reproduce:
1. move var to a new location (eg /mnt/sdb3/var )
2. ln -s <new path> /var
3. run revdep-rebuild
Actual Results:  
revdep-rebuild
 * Configuring search environment for revdep-rebuild
 * Working directory expected to be /var/cache/revdep-rebuild, but it is /mnt/sdb3/var/cache/revdep-rebuild

Expected Results:  
command should run and realize that the locations are the same...  or the way it tests the location needs to be changed.

I use portage 2.2 (and have for years) so repdep-rebuild is not run often.  @preserved-rebuild is usually enough.
Comment 1 Mike Gilbert gentoo-dev 2011-11-08 02:59:59 UTC
As a workaround, you could bind mount /mnt/sdb3/var to /var rather than using a symlink.
Comment 2 Ed Tomlinson 2011-11-12 18:02:07 UTC
This is just to confirm that using bind mounts works around the problem.
Comment 3 . 2015-08-08 22:37:12 UTC
quick patch

@@ -512,7 +512,7 @@
 # Dies when it can't change directories
 cd() {
        if builtin cd -P "$@"; then
-        if [[ $1 != $PWD ]]; then
+        if [[ $(readlink "$1") != $(readlink "$PWD") ]]; then
             # Some symlink malfeasance is going on
                        die 1 "Working directory expected to be $1, but it is $PWD"
                fi
Comment 4 Andrey Korolyov 2017-04-27 19:55:20 UTC
Different issue under same description, may appear with crossdev-produced packages, i.e. in regular setups:

ls -l /usr/lib
lrwxrwxrwx 1 root root 5 Oct  6  2016 /usr/lib -> lib64

Result of a revdep-rebuild run:

 !!! Broken orphaned files: No installed package was found for the following:
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libstdc++.so.6.0.20
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libitm.so.1.0.0
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libgomp.so.1.0.0
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libubsan.so.0.0.0
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libasan.so.1.0.0
        * /usr/lib64/gcc/armv7a-hardfloat-linux-gnueabi/4.9.4/libatomic.so.1.1.0

Package database refers to /usr/lib, while revdep-rebuild refers only to fully resolved path.