You are not logged in.

#1 2019-11-19 11:00:32

Hi-Angel
Member
Registered: 2016-07-16
Posts: 43

[SOLVED] makepkg error `this operation must be run in a work tree`

`makepkg` errors out for me with the error. Putting `set -o xtrace` inside PKGBUILD shows that it's caused by makepkg calling `git checkout`.

Here're steps to reproduce along with the output I get. The PKGBUILD is a modified version of this one. I removed functions like prepare(), biuld(), to have a minimal testcase.

$ cat PKGBUILD
pkgname=libonion-git
pkgver=0.5.r253.g169fabc
pkgrel=1
pkgdesc='lightweight C library that facilitate to create simple HTTP servers'
arch=(i686 x86_64)
url='https://github.com/davidmoreno/onion/'
license=(LGPL)
makedepends=(git)
source=(git://github.com/davidmoreno/onion)
sha1sums=('SKIP')
$ makepkg
==> Making package: libonion-git 0.5.r253.g169fabc-1 (Вт 19 ноя 2019 13:51:56)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning onion git repo...
Cloning into bare repository '/home/constantine/Projects/builds/libonion-git/onion'...
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 10567 (delta 35), reused 26 (delta 11), pack-reused 10501
Receiving objects: 100% (10567/10567), 3.59 MiB | 5.75 MiB/s, done.
Resolving deltas: 100% (6465/6465), done.
==> Validating source files with sha1sums...
    onion ... Skipped
==> Extracting sources...
  -> Creating working copy of onion git repo...
fatal: this operation must be run in a work tree
==> ERROR: Failure while creating working copy of onion git repo
    Aborting...

pacman/makepkg version is 5.2.1-1

Last edited by Hi-Angel (2019-11-19 11:51:45)

Offline

#2 2019-11-19 11:28:33

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

Re: [SOLVED] makepkg error `this operation must be run in a work tree`

Works ok for me.
Does  your user have writing permissions for the folder you run makepkg from ?


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

#3 2019-11-19 11:29:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,428

Re: [SOLVED] makepkg error `this operation must be run in a work tree`

Moving to AUR issues, please use the Report function under a post to request a move in the future.

Offline

#4 2019-11-19 11:35:42

Hi-Angel
Member
Registered: 2016-07-16
Posts: 43

Re: [SOLVED] makepkg error `this operation must be run in a work tree`

Lone_Wolf wrote:

Works ok for me.
Does  your user have writing permissions for the folder you run makepkg from ?

Hmm… This is interesting: if I do it inside `/tmp/foo` directory, then it works fine. Thank you for the reply! I'll try to figure out what's the difference.

Offline

#5 2019-11-19 11:50:55

Hi-Angel
Member
Registered: 2016-07-16
Posts: 43

Re: [SOLVED] makepkg error `this operation must be run in a work tree`

Thanks everyone! I figured, the problem was on my side. Basically, what fixed it was removing everything excluding PKGBUILD. The problem was that initially I modified this PKGBUILD and made a mistake which made makepkg to download an html page instead of cloning the repo. I removed it back then. But apparently it also somehow screwed up `src` dir that makepkg creates. I am not sure about details because I removed the dir before looking at the content. But basically, that's it.

Making as solved.

Offline

Board footer

Powered by FluxBB