You are not logged in.

#1 2010-04-15 21:59:51

arnaudsj
Member
Registered: 2010-04-15
Posts: 3

Weird PKGBUILD error with git build...

Trying to get my first git PKGBUILD going and I am running in to a very weird error:

[arnaudsj@atlarch ArchLinuxPKG]$ makepkg
==> Making package: mobile_cc_unet_nodejs-git 0.2-1 x86_64 (Thu Apr 15 16:34:17 CDT 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
==> Starting build()...
==> Connecting to GIT server....
Initialized empty Git repository in /home/arnaudsj/ArchLinuxPKG/src/mobile_cc_unet_nodejs/.git/
Could not create directory '/root/.ssh'.
Failed to add the host to the list of known hosts (/root/.ssh/known_hosts).
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
==> GIT checkout done or server timeout
==> Starting make...
Initialized empty Git repository in /home/arnaudsj/ArchLinuxPKG/src/mobile_cc_unet_nodejs-build/.git/
fatal: '/home/arnaudsj/ArchLinuxPKG/src/mobile_cc_unet_nodejs' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
/home/arnaudsj/ArchLinuxPKG/PKGBUILD: line 42: cd: /home/arnaudsj/ArchLinuxPKG/src/mobile_cc_unet_nodejs-build: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git

Fatal error: Couldn't find any fabfiles!

Aborting.
==> ERROR: Build Failed.
    Aborting...

somehow it is trying to connect to git as the root user instead my non-priviledged user???

Here is the PKGBUILD file:

pkgname=mobile_cc_unet_nodejs-git
pkgver=0.2
pkgrel=1
pkgdesc=""
arch=('x86_64')
url=""
license=('unknown')
groups=()
depends=()
makedepends=('git' 'python' 'setuptools') #easy_install virtualenv fabric
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=()
noextract=()
md5sums=() #generate with 'makepkg -g'

_gitroot="git@github.com:arnaudsj/mobile_cc_unet_nodejs.git"
_gitname="mobile_cc_unet_nodejs"

build() {
    cd "$srcdir"
    msg "Connecting to GIT server...."

    if [ -d $_gitname ] ; then
      cd $_gitname && git pull origin
      msg "The local files are updated."
    else
      git clone $_gitroot $_gitname
    fi

    msg "GIT checkout done or server timeout"
    msg "Starting make..."

    rm -rf "$srcdir/$_gitname-build"
    git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
    cd "$srcdir/$_gitname-build"
    
    git submodule init
    git submodule update

    #
    # BUILD HERE
    #
    fab local build
}

Thank you in advance for any pointers!

Sébastien

Offline

#2 2010-04-16 00:51:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Weird PKGBUILD error with git build...

that's not a valid _gitroot for a PKGBUILD. It's trying to connect as root because you're in a fakeroot environment.

I'd say use "git://github.com/arnaudsj/mobile_cc_unet_nodejs.git" as _gitroot but I'm not seeing it on your GH page. Is this a private repo?

Offline

#3 2010-04-16 02:52:10

arnaudsj
Member
Registered: 2010-04-15
Posts: 3

Re: Weird PKGBUILD error with git build...

Yes, this is a private repo, which is why I need to make sure the private key is in place for the user running the git clone command (otherwise it will be denied).

Offline

#4 2010-04-16 14:52:39

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Weird PKGBUILD error with git build...

arnaudsj wrote:

Yes, this is a private repo, which is why I need to make sure the private key is in place for the user running the git clone command (otherwise it will be denied).

I'm not sure makepkg is flexible enough in its current state to handle this properly (someone please correct me if I'm wrong). I know there's been a need for the whole -{git,svn,hg,bzr} section to be touched up, but it seems to be of somewhat low importance given other things on the plate.

Edit: You could bandaid this by having the PKGBUILD call an external script to do the private Git transaction. If you need an example of what I'm talking about, look at extra/chromium or extra/vim. They don't involve Git, but it might get you started.

Last edited by falconindy (2010-04-16 14:54:13)

Offline

#5 2010-04-17 02:01:54

arnaudsj
Member
Registered: 2010-04-15
Posts: 3

Re: Weird PKGBUILD error with git build...

Thank you - I had the feeling there was not much to be done with makepkg after looking at the code for fakeroot.

I will have a look at the scripts you mention. I also think I can get it working by creating a public git repo that I push to when I want the build to automatically start. It actually might work best anyway workflow wise (which is to host the git repos on the archlinux package build box, and reference it locally through file://mypath/mygitrepo.git

Will let you know how it goes! Thanks again for your help!

Offline

Board footer

Powered by FluxBB