You are not logged in.

#1 2019-02-05 18:24:27

xia0er
Member
Registered: 2008-03-24
Posts: 9

Merge two packages into a split package

I am maintaining python2-numpy-openblas (https://aur.archlinux.org/packages/pyth … -openblas/) and python-numpy-openblas (https://aur.archlinux.org/packages/pyth … -openblas/). Both were created when split packages were not supported by AUR. I finally got around to merge them into a split package, but I am getting the error below when git push the new split package. I don't want to delete package python2-numpy-openblas, but update it to the split package. I suppose I need help from the AUR administrator for this?

[xia0er@host python-numpy-openblas]$ git push
X11 forwarding request failed on channel 0
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 24 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.66 KiB | 1.66 MiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: error: cannot overwrite package: python2-numpy-openblas
remote: error: hook declined to update refs/heads/master
To ssh://aur4.archlinux.org/python-numpy-openblas.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur@aur4.archlinux.org/python-numpy-openblas.git'

Offline

#2 2019-02-06 08:05:56

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 437
Website

Re: Merge two packages into a split package

Did you update the .SRCINFO as well in the commit? I do recall that there were issues pushing a commit to AUR without an updated .SRCINFO.

Offline

#3 2019-02-06 08:46:55

jamespharvey20
Member
Registered: 2015-06-09
Posts: 129

Re: Merge two packages into a split package

A split package has its package base, which is the first element in "pkgname", and the base has multiple packages, all elements in "pkgname".

It sounds like the PKGBUILD you're trying to push has "pkgname=(python-numpy-openblas python2-numpy-openblas)" in it, and it's failing because the AUR sees "python2-numpy-openblas" exists as its own package.

You'll need to file an AUR request to delete "python2-numpy-openblas", or a request to merge it into "python-numpy-opnblas" which basically deletes it but moves the votes over.  (I'm still unclear if it replaces the votes of what it's merged into, or adds to them, as different sources have said differently.)

Once that's done, you can push the new PKGBUILD.  Once that's done, both of them will be listed as searchable packages on the AUR, they'll just both have the "Package Base" link, and point to the same PKGBUILD.

Offline

#4 2019-02-06 23:16:12

xia0er
Member
Registered: 2008-03-24
Posts: 9

Re: Merge two packages into a split package

@schard I did update .SRCINFO with `mksrinfo`. 
@jamespharvey20 You're right about the pkgname and pkgbase (I included my PKGBUILD below). I was hoping to avoid deleting python2-numpy-openblas, so the votes & comments are preserved, but I guess that's impossible?

pkgbase=python-numpy-openblas
pkgname=("python-numpy-openblas" "python2-numpy-openblas")
pkgver=1.16.1
pkgrel=2
pkgdesc="Scientific tools for Python - built with openblas"
arch=("i686" "x86_64")
license=("custom")
url="http://numpy.scipy.org/"
makedepends=('cblas' 'lapack' 'python' 'python2' 'python-setuptools' 'python2-setuptools'
             'gcc-fortran' 'python-nose' 'python2-nose' 'cython' 'cython2')
checkdepends=('python-pytest' 'python2-pytest')
options=('staticlibs')
source=("python-numpy-$pkgver.tar.gz::https://github.com/numpy/numpy/archive/v$pkgver.tar.gz")
sha256sums=('59485e2d172c4c3e27307969ef2c1220b98efcf59cbf373bec41da19f7b69b92')

prepare() {
  cp -a numpy-$pkgver{,-py2}
  cd numpy-$pkgver-py2

  sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
      -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
      -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
      -i $(find . -name '*.py')
}

build() {
  cd "$srcdir"/numpy-$pkgver
  python setup.py build

  cd "$srcdir"/numpy-$pkgver-py2
  python2 setup.py build
}

check() {
  # TODO: Fix fortran tests here (it works fine after installation)

  cd "$srcdir"/numpy-$pkgver
  python setup.py config_fc --fcompiler=gnu95 install --root="$PWD/tmp_install" --optimize=1
  cd "$PWD/tmp_install"
  PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/usr/lib/python3.7/site-packages:$PYTHONPATH" python -c 'import numpy; numpy.test()'

  cd "$srcdir"/numpy-$pkgver-py2
  python2 setup.py config_fc --fcompiler=gnu95 install --root="$PWD/tmp_install" --optimize=1
  cd "$PWD/tmp_install"
  PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/usr/lib/python2.7/site-packages:$PYTHONPATH" python2 -c 'import numpy; numpy.test()'
}

package_python2-numpy-openblas() {
  depends=("python2" "cython2" "openblas-lapack")
  optdepends=("python2-nose: testsuite")
  provides=("python2-numpy=${pkgver}")
  conflicts=("python2-numpy")

  _pyver=2.7

  export Atlas=None
  export LDFLAGS="$LDFLAGS -shared"
  echo "Building Python2"
  cd "${srcdir}"/numpy-"$pkgver"-py2

  python2 setup.py config_fc --fcompiler=gnu95 build

  python2 setup.py config_fc --fcompiler=gnu95 install \
    --prefix=/usr --root="${pkgdir}" --optimize=1

  install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy"
  install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/"

  install -m755 -d "${pkgdir}/usr/include/python${_pyver}"
  ln -sf /usr/lib/python${_pyver}/site-packages/numpy/core/include/numpy "${pkgdir}/usr/include/python${_pyver}/numpy"

  mv "$pkgdir"/usr/bin/f2py{,2}
}

package_python-numpy-openblas() {
  depends=("python" "cython" "openblas-lapack")
  optdepends=("python-nose: testsuite")
  provides=("python3-numpy=${pkgver}" "python-numpy=${pkgver}")
  conflicts=("python3-numpy" "python-numpy")

  _pyver=3.7
  _pyinc=3.7m

  export Atlas=None
  export LDFLAGS="$LDFLAGS -shared"

  echo "Building Python3"
  cd "$srcdir/numpy-$pkgver"

  python setup.py config_fc --fcompiler=gnu95 build

  python setup.py config_fc --fcompiler=gnu95 install \
    --prefix=/usr --root="${pkgdir}" --optimize=1

  install -m755 -d "${pkgdir}/usr/share/licenses/python-numpy"
  install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python-numpy/"

  install -m755 -d "${pkgdir}/usr/include/python${_pyinc}"
  ln -sf /usr/lib/python${_pyver}/site-packages/numpy/core/include/numpy "${pkgdir}/usr/include/python${_pyinc}/numpy"

}

Offline

#5 2019-02-06 23:51:11

jamespharvey20
Member
Registered: 2015-06-09
Posts: 129

Re: Merge two packages into a split package

xia0er wrote:

@jamespharvey20 You're right about the pkgname and pkgbase (I included my PKGBUILD below). I was hoping to avoid deleting python2-numpy-openblas, so the votes & comments are preserved, but I guess that's impossible?

My original post should not have said "... or a request to merge it... which basically deletes it but moves the votes over" but instead "... deletes it but moves the votes and comments over".

Sounds like a merge request is what you need.

If there is a legitimate reason to keep the "python2-numph-openblas" package (other than votes and comments, since the merge request handles that) you could technically rename the second pkgname to "python2-numpy-openblas-split".  But, I'd strongly caution against doing that without a legitimate and documented technical reason without viable alternatives, because it's against AUR policy to have duplicate packages under multiple names, unless there's a darn good reason for it.

Offline

#6 2019-02-06 23:58:08

xia0er
Member
Registered: 2008-03-24
Posts: 9

Re: Merge two packages into a split package

jamespharvey20 wrote:

If there is a legitimate reason to keep the "python2-numph-openblas" package (other than votes and comments, since the merge request handles that)

None other than preserving the votes & comments. I have submitted a merge request. Thanks!

Offline

#7 2019-02-07 10:34:52

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,135

Re: Merge two packages into a split package

xia0er wrote:

I did update .SRCINFO with `mksrinfo`.

You are aware mksrcinfo has been integrated in makepkg a few years ago ?
see https://wiki.archlinux.org/index.php/.SRCINFO for details


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#8 2019-02-07 23:45:28

xia0er
Member
Registered: 2008-03-24
Posts: 9

Re: Merge two packages into a split package

Lone_Wolf wrote:

You are aware mksrcinfo has been integrated in makepkg a few years ago ?
see https://wiki.archlinux.org/index.php/.SRCINFO for details

Actually, I didn't. Thanks for the info!
I just looked at the /usr/bin/mksrinfo, and, according to the #TODO comment therein, it is supposed to switch to use `makepkg --printsrcinfo` but apparently hasn't yet.

Last edited by xia0er (2019-02-07 23:46:12)

Offline

#9 2019-02-08 03:42:04

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,853

Re: Merge two packages into a split package

xia0er wrote:
Lone_Wolf wrote:

You are aware mksrcinfo has been integrated in makepkg a few years ago ?
see https://wiki.archlinux.org/index.php/.SRCINFO for details

Actually, I didn't. Thanks for the info!
I just looked at the /usr/bin/mksrinfo, and, according to the #TODO comment therein, it is supposed to switch to use `makepkg --printsrcinfo` but apparently hasn't yet.

That's because it was simply dropped from the repos without ever being updated, because, well, why not actually use makepkg --printsrcinfo rather than a wrapper script which executes it for you?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB