[pacman-dev,4/5] makepkg: add more information to .BUILDINFO

Message ID 20170512104123.13144-4-anthraxx@archlinux.org
State Accepted, archived
Headers show
Series [pacman-dev,1/5] makepkg: remove build date from .PKGINFO header | expand

Commit Message

Levente Polyak May 12, 2017, 10:41 a.m. UTC
The .BUILDINFO file should retain all the information needed to reproducibly
build a package.  Add some extra information to the file and also provide a
version number to keep track of future changes.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
---
 scripts/makepkg.sh.in | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 7bdf72b9..bd92c526 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -688,13 +688,17 @@  write_pkginfo() {
 write_buildinfo() {
 	msg2 "$(gettext "Generating %s file...")" ".BUILDINFO"
 
-	write_kv_pair "builddir"  "${BUILDDIR}"
+	write_kv_pair "format" "1"
+	write_kv_pkgname
+	write_kv_pkgver
 
 	local sum="$(sha256sum "${BUILDFILE}")"
 	sum=${sum%% *}
-
 	write_kv_pair "pkgbuild_sha256sum" $sum
 
+	write_kv_pair "packager" "$(get_packager)"
+	write_kv_pair "builddate" "${SOURCE_DATE_EPOCH}"
+	write_kv_pair "builddir"  "${BUILDDIR}"
 	write_kv_pair "buildenv" "${BUILDENV[@]}"
 	write_kv_pair "options" "${OPTIONS[@]}"