pmb/build/_package.py: create .git symlink (!1831)

Make /home/pmos/build/.git point to the .git dir from pmaports.git, with
a symlink so abuild does not fail.

abuild expects the current working directory to be a subdirectory of a
cloned git repository (e.g. main/openrc from aports.git). If git is
installed, it will try to get the last git commit from that repository,
and place it in the resulting apk (.PKGINFO) as well as use the date
from that commit as SOURCE_DATE_EPOCH (for reproducible builds).

With that symlink, we actually make it use the last git commit from
pmaports.git for SOURCE_DATE_EPOCH and have that in the resulting apk's
.PKGINFO.

Fixes: #1841
This commit is contained in:
Oliver Smith 2019-11-10 11:20:00 +01:00
parent 46a65e1bb9
commit 16166874a5
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 51 additions and 4 deletions

View file

@ -385,8 +385,9 @@ def test_build_local_source_high_level(args, tmpdir):
shutil.copy(pmb.config.pmb_src + "/test/testdata/build_local_src/APKBUILD",
aport)
# aports: Add pmaports.cfg
# aports: Add pmaports.cfg, .git
shutil.copy(args.aports + "/pmaports.cfg", aports)
shutil.copytree(args.aports + "/.git", aports + "/.git")
# src: Copy hello-world source files
src = tmpdir + "/src"