Author Topic: Package Conflicts  (Read 1151 times)

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Package Conflicts
« on: January 15, 2006, 05:08:06 am »
I installed findutils onto external storage and was surprised to see that find and xargs still refer to busybox:

Code: [Select]
# ls -al /usr/bin/find /usr/bin/xargs
lrwxrwxrwx    1 root     root           17 Jan  1  1970 /usr/bin/find -> ../../bin/busybox
lrwxrwxrwx    1 root     root           17 Jan  1  1970 /usr/bin/xargs -> ../../bin/busybox

Digging into /usr/bin/ipkg-link I see that that is the intended behaviour, that is if the linkname already exists then it will be ignored:
Code: [Select]
add () {
        echo "*** Adding $PACKAGE"
        echo "$files" |
        while read line; do
                if [ ! -e "/$line" ]; then
                        # Only if it doesn't already exist.
                        if [ -d "$PREFIX/$line" ]; then
                                # It's a directory.
                                `mkdir "/$line"`
                        else
                                # It's a file.
                                 target=`echo ${PREFIX}/${line} | sed -e 's/\/\//\//g'`
                                `ln -s "$target" "/$line"`
                        fi
                fi
        done
}

So to use packages like findutils, where the commands it provides replaces the existing ones that are already part of the base system, you need to install to internal storage (/) -- or fiddle around with the links yourself after installation. That's the easy fix. But if for some reason you decide to uninstall findutils, you will find (pun intended) that the original find and xargs will be gone.

What's the solution? A minimal solution would be to increase the level of information given by the ipkg utils so that, for example in the above case, the installation does not "fail" silently.

A more comprehensive solution might require some file tracking mechanism whereby files that are overwritten are archived somewhere and restored when the package is uninstalled. But that could become a nightnare when more than one package wants to overwrite the same file.

A halfway solution would be to target only busybox symlinks, if a package replaces a busybox equivalent then use the apprpriate preinst, postinst, prerm, postrm scripts to remove and restore links.

I would like to hear what others think of this

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Package Conflicts
« Reply #1 on: January 15, 2006, 05:56:16 pm »
Many other systems/package managers would simply overwrite the files. Some might warn you first. Normally in these instances you would find yourself having to reinstall package1 after removing package2 (which overwrote package1 files). I think some sort of warning/info to tell what is happening would be sufficient.
SL6000-L, RC12