Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation impossible of different version of python (or ruby) ports #582

Closed
ghost opened this issue Sep 1, 2013 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented Sep 1, 2013

It's not possible to install python modules in 2 different version. For instance, with multiple repositories, I have a repository with all python 2.7 modules and all python 3.3 modules.

Then:

pkg info | grep -i django

Try to install both:

pkg search django
...
py33-django-1.5.1
py27-django-1.5.1
...

pkg install py33-django py27-django
Updating repository catalogue
The following 2 packages will be installed:

    Installing py27-django: 1.5.1 [python27]
    Installing py27-django: 1.4.5 [python27]

The installation will require 63 MB more space

3 MB to be downloaded

Proceed with installing packages [y/N]: 

So I try to install one first:

pkg install py33-django
Updating repository catalogue
The following 1 packages will be installed:

    Installing py33-django: 1.5.1 [python33]

The installation will require 22 MB more space

0 B to be downloaded

Proceed with installing packages [y/N]: y
Checking integrity... done
[1/1] Installing py33-django-1.5.1... done

And then the 2.7 version:

pkg install py27-django-1.5.1
Updating repository catalogue
The following 1 packages will be installed:

    Reinstalling py27-django-1.5.1 [python27] (direct dependency changed)

The installation will require 9 MB more space

0 B to be downloaded

Proceed with installing packages [y/N]: 

If you want to try my repositories for this use:

http://packages.malikania.fr/FreeBSD/9.1/amd64/python2.7
http://packages.malikania.fr/FreeBSD/9.1/amd64/python3.3

@bapt
Copy link
Member

bapt commented Oct 15, 2013

This is due to the ports tree being a crap, and pkgng having to workaround that, this will be fix soon

@ghost
Copy link
Author

ghost commented Oct 16, 2013

Nice, I'm happy that you take this seriously :-). I think the main problem is that pkgng install packages from their origin instead of pkgname right?

@marcusva
Copy link
Member

Nearly correct. pkg queries its database using the PKGORIGIN as search criteria and thus will not behave as wanted.

You cannot use PKGNAME, though, since it (at the moment) pulls in the version number, which would cause foo-1.2 and foo-1.3 to be recognized as different ports. Splitting PKGNAME is not an option either as it will complicate things all over the place.
There are a couple of handy things in the ports tree, which can be utilised, though:

  • UNIQUENAME --> effectively a combination PKGNAMEPREFIX + PORTNAME (or LATEST_LINK)
  • PKGNAMEPREFIX + PORTNAME + PKGNAMESUFFIX

The latter may open another can of worms with the suffix mess, we have right now. foo-nox11 and foo may install conflicting files, so the foo port would need a CONFLICTS entry for its OPTIONized variation, yay! Noone really wants this.

I would however prefer the latter, given that the policy for ports is changed likewise:

PKGNAMEPREFIX and PKGNAMESUFFIX are ways to indicate that a variation of a port is installed, which does not cause conflicts with other variations using the same PKGORIGIN.

The prefix or suffix (or both) must be also used for the DATADIR, EXAMPLESDIR, ... so that variations of a port do not installed shared data into the same place. This also will require some cleanup operations for maintainers, but is inevitable, if you want to have that feature.

@ghost
Copy link
Author

ghost commented Jun 17, 2014

Hello guys,

Any news on that issue ?

@marcusva
Copy link
Member

The python ports infrastructure now supports 'tagging' ports as being able to be installed concurrently to create conflict-free packages for different python versions:
http://lists.freebsd.org/pipermail/freebsd-python/2014-June/007077.html

pkg still uses the ORIGIN, though.

@marcusva
Copy link
Member

marcusva commented Aug 8, 2014

For my pkg 1.3.5.1 installation, antoine provided the following patch to Mk/bsd.pkgng.mk, which works fine for me:

Index: Mk/bsd.pkgng.mk
===================================================================
--- Mk/bsd.pkgng.mk (revision 364348)
+++ Mk/bsd.pkgng.mk (working copy)
@@ -254,18 +254,18 @@
 .if !target(check-already-installed)
 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
 check-already-installed:
-       @${ECHO_MSG} "===>  Checking if ${PKGORIGIN} already installed"; \
-       pkgname=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
+       @${ECHO_MSG} "===>  Checking if ${PKGBASE} already installed"; \
+       pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
        if [ -n "$${pkgname}" ]; then \
            v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
            if [ "$${v}" = "<" ]; then \
-               ${ECHO_CMD} "===>   An older version of ${PKGORIGIN} is already installed ($${pkgname})"; \
+               ${ECHO_CMD} "===>   An older version of ${PKGBASE} is already installed ($${pkgname})"; \
            else \
                ${ECHO_CMD} "===>   ${PKGNAME} is already installed"; \
            fi; \
            ${ECHO_MSG} "      You may wish to \`\`make deinstall'' and install this port again"; \
            ${ECHO_MSG} "      by \`\`make reinstall'' to upgrade it properly."; \
-           ${ECHO_MSG} "      If you really wish to overwrite the old port of ${PKGORIGIN}"; \
+           ${ECHO_MSG} "      If you really wish to overwrite the old port of ${PKGBASE}"; \
            ${ECHO_MSG} "      without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
            ${ECHO_MSG} "      in your environment or the \"make install\" command line."; \
            exit 1; \
@@ -282,11 +282,11 @@
        ${SU_CMD} "${MAKE} ${.TARGET}"
    @${ECHO_MSG} "===>  Returning to user credentials"
 .else
-   @${ECHO_MSG} "===>  Deinstalling for ${PKGORIGIN}"
-   @if ${PKG_INFO} -e ${PKGORIGIN}; then \
-       p=`${PKG_INFO} -q ${PKGORIGIN}`; \
+   @${ECHO_MSG} "===>  Deinstalling for ${PKGBASE}"
+   @if ${PKG_INFO} -e ${PKGBASE}; then \
+       p=`${PKG_INFO} -q -O ${PKGBASE}`; \
        ${ECHO_MSG} "===>   Deinstalling $${p}"; \
-       ${PKG_DELETE} -f ${PKGORIGIN} ; \
+       ${PKG_DELETE} -f ${PKGBASE} ; \
    else \
        ${ECHO_MSG} "===>   ${PKGBASE} not installed, skipping"; \

@bapt
Copy link
Member

bapt commented Dec 30, 2014

it is now possible

@bapt bapt closed this as completed Dec 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants