summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Broda <robin@broda.me>2018-05-03 09:27:03 +0200
committerAllan McRae <allan@archlinux.org>2018-05-12 21:25:51 +1000
commit5698d7b66daa2a0bc99cab7a989cef1c806c3bf6 (patch)
tree31d65dfccf92dcacbc436cdf21532653f27ba01d
parentf173f6d0da3793952691416d80441b46af12fc94 (diff)
downloadpacman-5698d7b66daa2a0bc99cab7a989cef1c806c3bf6.tar.xz
Append architecture information to 'installed' elements in .BUILDINFO
Adding the architecture to the 'installed' elements of the .BUILDINFO file makes it easier to retrieve the packages needed to reconstruct the build environment. Signed-off-by: Robin Broda <robin@broda.me> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--doc/BUILDINFO.5.txt2
-rw-r--r--scripts/makepkg.sh.in11
2 files changed, 10 insertions, 3 deletions
diff --git a/doc/BUILDINFO.5.txt b/doc/BUILDINFO.5.txt
index 597d11f6..a7e6b2e4 100644
--- a/doc/BUILDINFO.5.txt
+++ b/doc/BUILDINFO.5.txt
@@ -61,7 +61,7 @@ BUILDINFO file format.
*installed (array)*::
The installed packages at build time including the version information of
- the package. Formatted as "$pkgname-$pkgver-$pkgrel".
+ the package. Formatted as "$pkgname-$pkgver-$pkgrel-$pkgarch".
See Also
--------
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 238d4259..14dd3eac 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -699,8 +699,15 @@ write_buildinfo() {
write_kv_pair "buildenv" "${BUILDENV[@]}"
write_kv_pair "options" "${OPTIONS[@]}"
- local pkglist=($(run_pacman -Q | sed "s# #-#"))
- write_kv_pair "installed" "${pkglist[@]}"
+ local pkglist=($(run_pacman -Qq))
+ local pkginfos="$(LC_ALL=C run_pacman -Qi ${pkglist[@]})"
+ local pkginfos_parsed=($(awk -F': ' '\
+ /^Name .*/ {printf $2} \
+ /^Version .*/ {printf "-"$2} \
+ /^Architecture .*/ {print "-"$2} \
+ ' <<< "${pkginfos}"))
+
+ write_kv_pair "installed" "${pkginfos_parsed[@]}"
}
# build a sorted NUL-separated list of the full contents of the current