You are not logged in.

#1 2017-03-11 04:30:40

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

[Solved] Can't Push PKGBUILD To AUR

I'm about to push my first PKGBUILD and I generated .SRCINFO in the top level directory of my package, yet when I go to push it, it complains that it doesn't exist!

[bran@desktop]: ~/aur/freenas-vm-tools>$ ls -la
total 20
drwxr-xr-x 3 bran users 4096 Mar 10 23:14 .
drwxr-xr-x 3 bran users 4096 Mar 10 23:09 ..
drwxr-xr-x 8 bran users 4096 Mar 10 23:16 .git
-rw-r--r-- 1 bran users  759 Mar 10 23:09 PKGBUILD
-rw-r--r-- 1 bran users  509 Mar 10 23:14 .SRCINFO

[bran@desktop]: ~/aur/freenas-vm-tools>$ git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.11 KiB | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: error: The following error occurred when parsing commit
remote: error: eb1bb4d2d67d11d2562754ddb5fac81b1fa39470:
remote: error: missing .SRCINFO
remote: error: hook declined to update refs/heads/master
To ssh://aur.archlinux.org/freenas-vm-tools.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur@aur.archlinux.org/freenas-vm-tools.git'
[bran@desktop]: ~/aur/freenas-vm-tools>$

Last edited by brando56894 (2017-03-14 22:24:30)

Offline

#2 2017-03-11 04:31:58

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [Solved] Can't Push PKGBUILD To AUR

Do ALL commits include it? Specifically the one included in the error? And did you include it when you committed?

Last edited by Scimmia (2017-03-11 04:32:28)

Offline

#3 2017-03-11 04:43:26

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

Actually, the first commit doesn't have it included. I know I need to rebase it but it pretty new to git so what's the exact command I need to use?  git rebase --root what?

[bran@desktop]: ~/aur/freenas-vm-tools>$ git rebase --root
Successfully rebased and updated refs/heads/master.

[bran@desktop]: ~/aur/freenas-vm-tools>$ git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.12 KiB | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: error: The following error occurred when parsing commit
remote: error: 0559d4093ef1715c332ea0173ba248b01e5d62ae:
remote: error: missing .SRCINFO
remote: error: hook declined to update refs/heads/master
To ssh://aur.archlinux.org/freenas-vm-tools.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur@aur.archlinux.org/freenas-vm-tools.git'

Last edited by brando56894 (2017-03-11 04:53:47)

Offline

#4 2017-03-13 00:42:14

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Can't Push PKGBUILD To AUR

`git rebase --root -i` and manually generating and adding the .SRCINFO for each commit would work... but so does `git filter-branch --tree-filter 'makepkg --printsrcinfo > .SRCINFO' HEAD` which is slightly more automatic.

In the future, I strongly urge you to use githooks to make sure your .SRCINFO is kept up to date automatically. e.g. see the link in my signature.


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

Offline

#5 2017-03-14 22:06:15

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

Thanks! That fixed that, now on to the next issue....

[bran@desktop]: ~/aur/freenas-vm-tools-git>$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

[bran@desktop]: ~/aur/freenas-vm-tools-git>$ git push --set-upstream origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 1022 bytes | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: error: invalid pkgbase: freenas-vm-tools-git, expected freenas-vm-tools
remote: error: hook declined to update refs/heads/master
To ssh://aur.archlinux.org/freenas-vm-tools.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur@aur.archlinux.org/freenas-vm-tools.git'
# Maintainer: Brandon Golway <brando56894 at gmail dot com>
_pkgname=freenas-vm-tools
pkgname="$_pkgname"-git
pkgver=1.0
pkgrel=1
pkgdesc="Bhyve VM tools for FreeNAS 10"
arch=(x86_64)
url="https://www.freenas.org"
license=('GPL')
depends=(poco)
makedepends=(git cmake binutils clang libmariadbclient libtool unixodbc)
provides=('freenas-vm-tools')
conflicts=('freenas-vm-tools')
source=("git+https://github.com/freenas/${_pkgname}.git")
md5sums=('SKIP')

build() {
        cd "$_pkgname"
        export CXX=clang++
        cmake .
        make
}

package() {
        cd "$_pkgname"
        make DESTDIR="$pkgdir/" install
        cd "$srcdir/freenas-vm-tools/systemd"
        mkdir -p $pkgdir/usr/lib/systemd/system
        install -m755 freenas-vm-tools.service  $pkgdir/usr/lib/systemd/system/freenas-vm-tools.service
}
pkgbase = freenas-vm-tools-git
        pkgdesc = Bhyve VM tools for FreeNAS 10
        pkgver = 1.0
        pkgrel = 1
        url = https://www.freenas.org
        arch = x86_64
        license = GPL
        makedepends = git
        makedepends = cmake
        makedepends = binutils
        makedepends = clang
        makedepends = libmariadbclient
        makedepends = libtool
        makedepends = unixodbc
        depends = poco
        provides = freenas-vm-tools
        conflicts = freenas-vm-tools
        source = git+https://github.com/freenas/freenas-vm-tools.git
        md5sums = SKIP

pkgname = freenas-vm-tools-git

Last edited by brando56894 (2017-03-14 22:09:07)

Offline

#6 2017-03-14 22:14:02

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [Solved] Can't Push PKGBUILD To AUR

Well yeah, you're trying to push a "freenas-vm-tools-git" to a freenas-vm-tools" repo.

Last edited by Scimmia (2017-03-14 22:14:15)

Offline

#7 2017-03-14 22:22:18

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

Yea I figured it was FUBAR so I just deleted the local repo, cloned an empty one called freenas-vm-tools-git, committed PKGBUILD and .SRCINFO and pushed it, and it went through.

Here it is! https://aur.archlinux.org/packages/free … tools-git/

Thanks for the help guys! big_smile

Offline

#8 2017-03-14 23:49:34

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

Re: [Solved] Can't Push PKGBUILD To AUR

Some comments: the script as it stands installs to /usr/local, this is a packaging no-no. Pass -DCMAKE_INSTALL_PREFIX=/usr to cmake to override the default /usr/local prefix.

Unfortunately the project has hardcoded sbin paths in its cmake config, so you will need to move the /usr/sbin directory to /usr/bin during the packaging stage.

You should also enclose any instances of $srcdir or $pkgdir in doublequotes, as these variables may contain spaces.

During the packaging stage, you change directory to "$srcdir/freenas-vm-tools/systemd", but you are already in "$srcdir/freenas-vm-tools/" at the time. "cd systemd" will work fine.

Don't install the systemd service file with 755 permissions, it doesn't need to be executable. 644 permissions is the standard for service files.

You need a pkgver function to set the pkgver at build time, static pkgvers do not work for VCS packages. See
https://wiki.archlinux.org/index.php/VC … 9_function

Last edited by WorMzy (2017-03-14 23:50:39)


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.

Offline

#9 2017-03-15 16:48:48

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

Thanks for the info! I'll update the package ASAP smile

Offline

#10 2017-03-15 17:39:02

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

WorMzy wrote:

Unfortunately the project has hardcoded sbin paths in its cmake config, so you will need to move the /usr/sbin directory to /usr/bin during the packaging stage.

I'm kinda stuck on how to do this correctly...

WorMzy wrote:

You need a pkgver function to set the pkgver at build time, static pkgvers do not work for VCS packages. See
https://wiki.archlinux.org/index.php/VC … 9_function

I'm using the prebuilt pkgver() functions on the wiki but they break my PKGBUILD. I've tried 3 of them and they all fail. The freenas-vm-tools git repo has no releases/tags/versions so I have no idea what to do. All I know is that it works if I don't include the pkgver() function but fails if I do.

Last edited by brando56894 (2017-03-15 17:39:28)

Offline

#11 2017-03-15 18:53:52

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

Re: [Solved] Can't Push PKGBUILD To AUR

I'm kinda stuck on how to do this correctly...

mv "$pkgdir/usr/sbin" "$pkgdir/usr/bin"

I'm using the prebuilt pkgver() functions on the wiki but they break my PKGBUILD. I've tried 3 of them and they all fail. The freenas-vm-tools git repo has no releases/tags/versions so I have no idea what to do. All I know is that it works if I don't include the pkgver() function but fails if I do.

How do they fail? Are you remembering to cd to the correct directory ($_pkgname in your PKGBUILD) before running the git commands? The number of revisions pkgver function should work on any git repository, even if it doesn't have tags.

Note that you don't have to make every change you make into a commit. See if the change works before you commit and push it.


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.

Offline

#12 2017-03-15 19:43:29

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: [Solved] Can't Push PKGBUILD To AUR

WorMzy wrote:

I'm kinda stuck on how to do this correctly...

mv "$pkgdir/usr/sbin" "$pkgdir/usr/bin"

Haha I figured it was something simple like that but didn't know if I should put it before or after "make install" I assumed that it should go after and now it installs without conflict smile

WorMzy wrote:

I'm using the prebuilt pkgver() functions on the wiki but they break my PKGBUILD. I've tried 3 of them and they all fail. The freenas-vm-tools git repo has no releases/tags/versions so I have no idea what to do. All I know is that it works if I don't include the pkgver() function but fails if I do.

How do they fail? Are you remembering to cd to the correct directory ($_pkgname in your PKGBUILD) before running the git commands? The number of revisions pkgver function should work on any git repository, even if it doesn't have tags.

Note that you don't have to make every change you make into a commit. See if the change works before you commit and push it.

Turns out my issue was that I was using $pkgname instead of $_pkgname when I was changing directories in the first line of the function, now it works as expected. I'm trying to get into the habit of only making small changes per commit so it's easier to cherrypick in the event I need to do so, although I didn't need to commit my attempts at fixing pkgver() that was just force of habit lol

Thanks for all the help. It works as expected once again, and now conforms to the packaging standards. Also just in time for the release of FreeNAS Corral (their new name for 10, I think it's dumb lol)

Offline

Board footer

Powered by FluxBB