You are not logged in.

#1 2014-04-02 12:36:58

Zygote
Member
Registered: 2013-01-15
Posts: 77

[SOLVED] fatal: repository '' does not exist

Ive written a nice little Python library for ADB and Fastboot and figured I would use the opportunity to create my first AUR package, however, Im having some (hopefully) minor issues.

pkgname=python2-pyand-git
pkgver=0.9.1.2
pkgrel=3
pkgdesc="A python wrapper library for ADB and Fastboot"
arch=('any')
url="https://github.com/archpoint/pyand"
license=('MIT')
depends=('python2' 'python-setuptools')
makedepends=('git')
source=('git+https://github.com/archpoint/pyand.git')
md5sums=('SKIP')
package() {
  msg "Connecting to github server...."
    if [[ -d $_gitname ]] ; then
      ( cd "$_gitname" && git pull origin )
      msg "The local files are updated."
    else
      git clone "$_gitroot" --depth=1
    fi
  msg "GIT checkout done or server timeout"

  cd "$_gitname/../../"
  sudo easy_install-2.7 pyand

  mkdir -p "$pkgdir/usr/share/licenses/$pkgname/"
  cd "src/$_gitname/"
  cp LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

With this, I get the following error when installing..

==> Building and installing package
==> Making package: python2-pyand-git 0.9.1.2-3 (Wed Apr  2 14:34:27 CEST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning pyand git repo...
Cloning into bare repository '/tmp/yaourt-tmp-myuser/aur-python2-pyand-git/pyand'...
remote: Reusing existing pack: 96, done.
remote: Counting objects: 46, done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 142 (delta 22), reused 0 (delta 0)
Receiving objects: 100% (142/142), 28.61 KiB | 0 bytes/s, done.
Resolving deltas: 100% (65/65), done.
Checking connectivity... done.
==> Validating source files with md5sums...
    pyand ... Skipped
==> Extracting sources...
  -> Creating working copy of pyand git repo...
Cloning into 'pyand'...
done.
==> Entering fakeroot environment...
==> Starting package()...
==> Connecting to github server....
fatal: repository '' does not exist
==> ERROR: A failure occurred in package().
    Aborting...
==> ERROR: Makepkg was unable to build python2-pyand-git.

Any ideas? And of course, any other feedback, suggestions, etc, is most welcome.

Last edited by Zygote (2016-08-19 09:37:43)

Offline

#2 2014-04-02 12:47:35

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

Don't use a mixture of ancient and current PKGBUILD templates. The manual cloning of the git repository in the package function is completely unnecessary if you have the repo in the sources -- makepkg handles this for you, including creating a clean copy.

(Re)read https://wiki.archlinux.org/index.php/VC … Guidelines

In case you're curious, you're getting the "repository '' does not exist" error because you don't have a variable called _gitname

sudo easy_install-2.7 pyand

??? Why are you using sudo in a PKGBUILD?

EDIT: use easy_install's --prefix option to install it to $pkgdir

Last edited by WorMzy (2014-04-02 12:49:33)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2014-04-02 12:52:01

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

WorMzy wrote:

Don't use a mixture of ancient and current PKGBUILD templates. The manual cloning of the git repository in the package function is completely unnecessary if you have the repo in the sources -- makepkg handles this for you, including creating a clean copy.

(Re)read https://wiki.archlinux.org/index.php/VC … Guidelines

In case you're curious, you're getting the "repository '' does not exist" error because you don't have a variable called _gitname

sudo easy_install-2.7 pyand

??? Why are you using sudo in a PKGBUILD?

EDIT: use easy_install's --prefix option to install it to $pkgdir

Thanks for the input. Will convert it to comply with the new template (I realize I was basing my package on an old template and then cherry picking bits from newer ones >_<). Also, was unaware of the --prefix option, and easy_install blew up in my face if you didnt run it as sudo, hence the sudo.

Again, thanks for the feedback. Will post a revised pkgbuild when its ready.

Offline

#4 2014-04-02 13:01:33

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

You just need to remember that makepkg + PKGBUILD = installable package. If you check the package you created with that PKGBUILD, you'll see that it only contains the LICENSE file and the directories leading up to it. Once you realise why, you'll understand why you shouldn't use sudo (or su, or pkexec, etc).

Package build is done in a fakeroot environment (where possible), you should never need privilege escalation.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#5 2014-04-02 13:04:32

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

With the following PKGBUILD its still failing

pkgname=python2-pyand-git
pkgver=0.9.1.2
pkgrel=4
pkgdesc="A Python wrapper library for ADB and Fastboot"
arch=('i686' 'x86_64')
url="https://github.com/archpoint/pyand"
license=('MIT')
depends=('pacman' 'python2' 'python-setuptools')
makedepends=('git')
# The git repo is detected by the 'git:' or 'git+' beginning. The branch
# '$pkgname' is then checked out upon cloning, expediating versioning:
#source=('git+https://github.com/falconindy/expac.git'
source=('git+https://github.com/archpoint/pyand.git')
# Because the sources are not static, skip Git checksum:
md5sums=('SKIP')
pkgver() {
  cd "$srcdir/$pkgname"
  # Use the tag of the last commit
  git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
}

package() {
  cd "$srcdir/$pkgname"
  easy_install-2.7 pyand --prefix $pkgdir
}
/tmp/yaourt-tmp-user/aur-python2-pyand-git/./PKGBUILD: line 19: cd: /tmp/yaourt-tmp-user/aur-python2-pyand-git/src/python2-pyand-git: No such file or directory

Shouldnt that directory be created when the sources are checked out?

Last edited by Zygote (2016-08-19 09:38:07)

Offline

#6 2014-04-02 13:18:01

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

No, it creates a clean copy of the repo in $srcdir/$_reponame, the $pkgname is something you've made up, git doesn't know about it.

btw, $_reponame isn't a standard variable, I just made it up to help explain. Take a look in /tmp/yaourt-tmp-user/aur-python2-pyand-git/src and you'll see what I mean.

I would declare a new variable in the PKGBUILD to hold the name of the directory that is actually created. You could use $_reponame, or the $_gitroot you were trying to use before (just remember to declare it).

You can make git aware of $pkgname if you prefer that instead. Just prepend the source declaration with $pkgname::

e.g.

source=($pkgname::git+'https://github.com/Zyg0te/pyand.git')

Then $srcdir/$pkgname will exist after the initial source checkout (be aware that you will have to download the whole repository again, unless you rename the folder git created last time.)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#7 2014-04-02 13:22:53

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

WorMzy wrote:

No, it creates a clean copy of the repo in $srcdir/$_reponame, the $pkgname is something you've made up, git doesn't know about it.

btw, $_reponame isn't a standard variable, I just made it up to help explain. Take a look in /tmp/yaourt-tmp-user/aur-python2-pyand-git/src and you'll see what I mean.

I would declare a new variable in the PKGBUILD to hold the name of the directory that is actually created. You could use $_reponame, or the $_gitroot you were trying to use before (just remember to declare it).

You can make git aware of $pkgname if you prefer that instead. Just prepend the source declaration with $pkgname::

e.g.

source=($pkgname::git+'https://github.com/archpoint/pyand.git')

Then $srcdir/$pkgname will exist after the initial source checkout (be aware that you will have to download the whole repository again, unless you rename the folder git created last time.)

Awesome, thank you so much for your help, it seemingly almost works now, but again, easy_install is complaining about write permissions of the install directory.

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-9856.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/lib/python2.7/site-packages/

Last edited by Zygote (2016-08-19 09:38:22)

Offline

#8 2014-04-02 13:37:14

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

It's still trying to install to the root filesystem, not the package directory.  I think the problem is that you need to specify the --prefix before the target. e.g.

easy_install-2.7 --prefix "$pkgdir" pyand

You might also need to specify the --install-dir it mentions. I'm afraid that I'm not familiar with the tool.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#9 2014-04-02 13:42:53

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

Ah, that's probably it. Not familiar with easy_install either to be honest >_<

EST FAILED: /tmp/yaourt-tmp-user/aur-python2-pyand-git/pkg/python2-pyand-git/lib/python2.7/site-packages does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /tmp/yaourt-tmp-user/aur-python2-pyand-git/pkg/python2-pyand-git/lib/python2.7/site-packages

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.

Tried to find some other packages on AUR using easy_install but they seem to be few and far between. In retrospect, I probably should use pip or something, but Im kinda hell bent on making it work with easy_install now. Ill look into the suggestions above though to see if I can get anywhere.

Thanks again and apologies for submitting a faulty PKGBUILD.

Offline

#10 2014-04-02 14:14:36

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

You could try setting PYTHONPATH in the PKGBUILD to "$pkgdir/usr/lib/python2.7/site-packages", and see if that will appease it. Once the package is installed, it will be in the system PYTHONPATH. This seems like a hacky workaround to me, and it's probably indicative that we're not using the tool correctly, or we're using the wrong tool entirely.

I just noticed that it's installing to /lib, and not /usr/lib too, so you should probably use --prefix "$pkgdir/usr" if you're sticking with easy_install.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#11 2014-04-02 14:39:23

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/tmp/yaourt-tmp-user/aur-python2-pyand-git/pkg/python2-pyand-git/usr/lib/python2.7/site-packages/test-easy-install-12218.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /tmp/yaourt-tmp-user/aur-python2-pyand-git/pkg/python2-pyand-git/usr/lib/python2.7/site-packages

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).

So the PYTHONPATH trick seemed to work, although a bit of a hack, yes. However, there's still something wrong with the directory structure here it seems hmm

Offline

#12 2014-04-02 14:50:29

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

A solution to that would be to just create $pkgdir/usr before you run easy_install, either using mkdir or install, whichever you prefer.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#13 2014-04-02 15:27:46

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

Almost there, but now I think its something easy_install specific going wrong. It does not happen if I do the install with easy_install directly though..

Creating /tmp/yaourt-tmp-user/aur-python2-pyand-git/pkg/python2-pyand-git/usr/lib/python2.7/site-packages/site.py
Searching for pyand
Reading https://pypi.python.org/simple/pyand/
Couldn't find index page for 'pyand' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for pyand
error: Could not find suitable distribution for Requirement.parse('pyand')

No idea why its trying to look up the package on pypi.python.org at all. It should just detect the setup.py script and install. In fact, if I change the directory to cd into in the PKGBUILD, easy_install complains about not finding a setup script.. yea idk whats going on here...

Offline

#14 2014-04-02 15:34:54

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

Resolved it, just had to realize that easy_install reads the package name from the directory name, not the setup.py file.

package() {
  export PYTHONPATH="$pkgdir/usr/lib/python2.7/site-packages"
  cd $srcdir/$pkgname/../
  mkdir -p $pkgdir/usr/lib/python2.7/site-packages
  easy_install-2.7 --prefix "$pkgdir/usr" python2-pyand-git
}

Thanks WorMzy for all your help smile

Offline

#15 2014-04-02 16:49:34

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] fatal: repository '' does not exist

Further improvements can still be made. For example, you should still double quote all instances of $pkgdir and $srcdir.

cd $srcdir/$pkgname/../

Is completely redundant -- you always start in $srcdir, and that is a really odd way of getting to it even if you didn't.

You should write a pkgver function to automatically update the pkgver value each time you run makepkg (explanation is in the wiki link I posted a few posts ago)

I'll see if your packages 'builds' fine in a clean chroot when I get home. In the meantime, you could check your package+PKGBUILD with namcap to see if there are any other improvements you can make.

----
The first thing I found was your pkgver doesn't work

==> Starting pkgver()...
fatal: No names found, cannot describe anything.

The repository doesn't have any tags, so git describe isn't very useful here. You would be better off using the final git example on the wiki page.

The next problem I found, is that you haven't included the package that provides easy_install-2.7 in the makedepends array. You have, instead, declared the wrong package in the depends array. Note that packages with "python-" at the start of their name are actually python3 packages, whereas your package needs python2.

The next thing I noticed is that you've included pacman as a dependency. You don't need to do that, you can assume that anyone installing the package has pacman installed, this is the Arch User Repository, after all.

Finally, the completed package doesn't have any binary files in it, so nothing is compiled for a specific architecture. In this case, you can drop 'i686' and 'x86_64' from the arch array, and replace them with 'any'.

A further point of interest, is that, what I assume to be the main python file, ADB.py, has a shebang calling /usr/bin/python. This may not be a problem if it isn't meant to be called directly, but will cause problems if it is, and expects to get python 2.x. On ARch, /usr/bin/python is a symbolic link to /usr/bin/python3. Ideally, this shebang should be replaced with '#!/usr/bin/python2', or even better '#!/usr/bin/env python2'. This should be done upstream, but can be done in the PKGBUILD, in a prepare function, using sed.

If the script can be called with either python2 or python3, then the shebang doesn't need to change, and actually complies with PEP394.

Last edited by WorMzy (2014-04-02 20:25:27)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#16 2014-04-03 06:34:30

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

Thanks for all your input. I will look into all the extremely valuable input you've provided and improve the package! You're awesome!

Offline

#17 2014-04-03 06:43:17

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

This looks better I hope..

pkgname=python2-pyand-git
pkgrel=5
pkgver=0.9.1
pkgdesc="A Python wrapper library for ADB and Fastboot"
arch=('any')
url="https://github.com/archpoint/pyand"
license=('MIT')
depends=('python2')
makedepends=('git' 'python2-setuptools')
# The git repo is detected by the 'git:' or 'git+' beginning. The branch
# '$pkgname' is then checked out upon cloning, expediating versioning:
source=($pkgname::git+'https://github.com/archpoint/pyand.git')
# Because the sources are not static, skip Git checksum:
md5sums=('SKIP')
pkgver() {
  cd "$srcdir/$pkgname"
  # Use the tag of the last commit
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  export PYTHONPATH="$pkgdir/usr/lib/python2.7/site-packages"
  cd "$srcdir/"
  mkdir -p "$pkgdir/usr/lib/python2.7/site-packages"
  easy_install-2.7 --prefix "$pkgdir/usr" python2-pyand-git
}

Last edited by Zygote (2016-08-19 09:38:49)

Offline

#18 2014-04-03 11:05:22

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] fatal: repository '' does not exist

$ namcap python2-pyand-git-r42.a471d94-1-any.pkg.tar.xz 
python2-pyand-git E: Missing custom license directory (usr/share/licenses/python2-pyand-git)
python2-pyand-git W: Dependency included and not needed ('python2')
$ 

--------------------------------
Missing custom license directory (usr/share/licenses/python2-pyand-git)

this is due to the MIT license you use, from Arch_Packaging_Standards#Licenses :

The MIT, BSD, zlib/libpng and Python licenses are special cases and cannot be included in the 'common' licenses pkg. For the sake of the license variable, it is treated like a common license (license=('BSD'), license=('MIT'), license=('ZLIB') or license=('Python')) but for the sake of the filesystem, it is a custom license, because each one has its own copyright line. Each MIT, BSD, zlib/libpng or Python licensed package should have its unique license stored in /usr/share/licenses/$pkgname/.

adding something like this will take care of that.

install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m755 "${srcdir}/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/"

------------------------------------
Dependency included and not needed ('python2')

you can ignore this, namcap just doesn't know (yet) how to deal correctly with python packages.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#19 2014-04-03 15:58:12

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: [SOLVED] fatal: repository '' does not exist

Thanks for that. I ran it through namcap too and figured that the python2 dependency issue could be ignored, but had no idea what to do with the licensing, so thanks for clearing that up!

Cheers!

Offline

Board footer

Powered by FluxBB