Menu

Multiple package versions in single repository

wpkg
MH
2015-09-24
2015-09-25
  • MH

    MH - 2015-09-24

    Hello everyone

    As you may have noticed I've been making a few patches for wpkg. In addition I have a couple of local, build-related patches (e.g. disabling msvc-runtime). To separate different builds I added a suffix to DEBIAN_PACKAGES_VERSION_STRING and quickly discovered that wpkg appears to have issues when a repository contains multiple versions of the same package.

    [package:/…/dist/packages/./wpkg-dev_1.0.0+patch9000_linux-amd64.deb] files "/…/dist/packages/./wpkg_1.0.0_linux-amd64.deb" and "/…/dist/packages/./wpkg-dev_1.0.0+patch9000_linux-amd64.deb" define the same package (their Package field match) but are distinct files. (validate-installation)

    Both files are listed in the index:

    $ tar tf …/dist/packages/index.tar.gz | grep ^wpkg_ | sort
    wpkg_1.0.0_linux-amd64.ctrl
    wpkg_1.0.0+patch9000_linux-amd64.ctrl
    

    In this case the error occurs when building wpkg in a tree with pre-existing packages (build 1.0.0, then 1.0.0+patch9000). Note that I'm only using the wpkg package for demonstration. The same issue applies to other packages, too.

    In some situations it's possible to work around this limitation by using a version-specific package name (e.g. libfoo0 and libfoo1), though that has its own drawbacks.

    The Debian documentation on its repository format says that “[a package] index may contain multiple versions of one binary package, for the same architecture and/or multiple architectures”. Apt has a priority assigned to each distribution/repository and uses that to select a package if no version was specified.

    Long story short, is this a bug in wpkg?

     
  • Mathieu SCHROETER

    Hi,

    I have multiple versions of several packages in my repositories but I never seen this error.. ?!?

    Note that my wpkg version is still mostly based on 0.9.10.

     

    Last edit: Mathieu SCHROETER 2015-09-24
    • R. Douglas Barbieri

      Yes, I've had this exact same problem. For now, I just remove the old
      version from the repository, but this does need to be fixed. Has anyone
      tried building the unit tests? I redid them so they use Catch C++
      instead of cppunit. I thought I had the package issue resolved with
      multiple packages, but not so.

      As a side note, when upgrading, I have experienced that not everything
      upgrades properly as well. And experiment I did showed that while I had
      two different packages that needed upgrading, only one did and I had to
      run the upgrade again to get the second packages to upgrade. This exact
      same situation just fails in pkg-explorer's upgrade feature.

      So yes, lots of work to do on this...patches are always welcome. :)

       
      • MH

        MH - 2015-09-25

        Has anyone tried building the unit tests?

        I've just tried. With GCC 4.9.2 it fails first at “‘class Catch::MethodTestCase<C>’ only defines a private destructor and has no friends”. Can't investigate further right now, but will soon. Considering that this is in Catch code I'm hopeful that a newer version of Catch and Clara will help me get this out of the way.

        Regarding patches being welcome (number 1 != letter l):

        --- a/wpkg/tests/unittests/CMakeLists.txt
        +++ b/wpkg/tests/unittests/CMakeLists.txt
        @@ -43,7 +43,7 @@ if( NOT CMAKE_MODULE_PATH )
             set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
         endif()
        
        -# The version of Catch that these tests are keyed to is from git: 1e2fld1
        +# The version of Catch that these tests are keyed to is from git: 1e2f1d16
         # Find it at https://github.com/philsquared/Catch.git
         # For Ubuntu Linux, just use the catch package version 1.0+m10git1e2f1d16-1
         #
        
         
  • MH

    MH - 2015-09-24

    I truly wish I could report otherwise. Haven't tested with 0.9.10, though.

    Repository index after first build (no version suffix):

    634  …  wpkg-dev_1.0.0_linux-amd64.ctrl
    582  …  wpkg-doc_1.0.0_all.ctrl
    612  …  wpkg-hdrs-dev_1.0.0_all.ctrl
    585  …  wpkg_1.0.0_linux-amd64.ctrl
    

    Add the version suffix and build again:

    674  …  wpkg-dev_1.0.0+patch9000_linux-amd64.ctrl
    634  …  wpkg-dev_1.0.0_linux-amd64.ctrl
    602  …  wpkg-doc_1.0.0+patch9000_all.ctrl
    582  …  wpkg-doc_1.0.0_all.ctrl
    632  …  wpkg-hdrs-dev_1.0.0+patch9000_all.ctrl
    612  …  wpkg-hdrs-dev_1.0.0_all.ctrl
    605  …  wpkg_1.0.0+patch9000_linux-amd64.ctrl
    585  …  wpkg_1.0.0_linux-amd64.ctrl
    

    Now even installing a single package fails:

    $ …/wpkg-Release/tools/wpkg_static --verbose --root /…/dist --force-reinstall --install wpkg-dev
    One or more packages you specified for installation are already installed. See the '--force-reinstall' option. (configure-package)
    validate directories (validate-installation)
    validate package name (validate-installation)
    validate installation type (source/binary) (validate-installation)
    validate installed packages (validate-installation)
    validate architecture (validate-installation)
    validate pre-dependencies (validate-installation)
    validate dependencies (validate-installation)
    validate distribution name (validate-installation)
    validate packager version (validate-installation)
    validate fields (validate-installation)
    validate size and overwrites (validate-installation)
    somehow more than two packages named "wpkg-dev" were marked for upgrade. (tool)
    

    When dependencies are involved (wpkg-dev depends on wpkg):

    $ …/wpkg-Release/tools/wpkg_static --verbose --root /…/dist --force-reinstall --dry-run --install wpkg wpkg-dev
    One or more packages you specified for installation are already installed. See the '--force-reinstall' option. (configure-package)
    validate directories (validate-installation)
    validate package name (validate-installation)
    validate installation type (source/binary) (validate-installation)
    validate installed packages (validate-installation)
    validate architecture (validate-installation)
    validate pre-dependencies (validate-installation)
    validate dependencies (validate-installation)
    [package:/…/dist/packages/./wpkg-dev_1.0.0+patch9000_linux-amd64.deb] files "/…/dist/packages/./wpkg_1.0.0_linux-amd64.deb" and "/…/dist/packages/./wpkg-dev_1.0.0+patch9000_linux-amd64.deb" define the same package (their Package field match) but are distinct files. (validate-installation)
    [package:/…/dist/packages/./wpkg-dev_1.0.0_linux-amd64.deb] files "/…/dist/packages/./wpkg_1.0.0_linux-amd64.deb" and "/…/dist/packages/./wpkg-dev_1.0.0_linux-amd64.deb" define the same package (their Package field match) but are distinct files. (validate-installation)
    validate distribution name (validate-installation)
    validate packager version (validate-installation)
    validate fields (validate-installation)
    

    Let's upgrade everything:

    $ …/wpkg-Release/tools/wpkg_static --verbose --root /…/dist --force-reinstall --upgrade
    

    Strangely, this doesn't upgrade everything:

    $ …/wpkg-Release/tools/wpkg_static --verbose --root /…/dist --force-reinstall --list | grep ^i | sed -e 's/Multi.*//'
    ii  wpkg                                  1.0.0+patch9000                  
    ii  wpkg-dev                              1.0.0+patch9000                  
    ii  wpkg-doc                              1.0.0                            
    ii  wpkg-hdrs-dev                         1.0.0+patch9000
    

    Re-running the command upgrades wpkg-doc, too. Even before that any attempt at (re)installing another package fails:

    $ …/wpkg-Release/tools/wpkg_static --verbose --root /…/dist --force-reinstall --install wpkg-dev
    Cannot install package 'wpkg-dev' since it is invalid! (configure-package)
    

    There's a seemingly separate issue whereby the index file generated during the build process is considered invalid by “--list-index-packages”. Will start a separate topic for that.

     

Log in to post a comment.