This avoids introducing unnecessary changes to the time stamp into
package repositories that regularly use --printsrcinfo to update the
.SRCINFO file.
---

I did not know that despite git-based AUR 4 source packages are still in active use. There, time stamps make some sense indeed.

The mksrcinfo solution is quite similar to the workaround I implemented for my package repositories: When only the time stamp changed, keep the old .SRCINFO without modification.

But omitting the comments in .SRCINFOs not intended for source packages gets us rid of this consideration altogether and thus seems like the most KISS solution to me, so I implemented a patch.


 scripts/makepkg.sh.in | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 80b95f4..a587af3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1080,11 +1080,13 @@ srcinfo_write_package() {
        srcinfo_close_section
 }
 -write_srcinfo() {
-       local pkg
-
+write_srcinfo_header() {
        printf "# Generated by makepkg %s\n" "$makepkg_version"
        printf "# %s\n" "$(LC_ALL=C date -u)"
+}
+
+write_srcinfo_content() {
+       local pkg
        srcinfo_write_global
 @@ -1093,6 +1095,11 @@ write_srcinfo() {
        done
 }
 +write_srcinfo() {
+       write_srcinfo_header
+       write_srcinfo_content
+}
+
 write_pkginfo() {
        local builddate=$(date -u "+%s")
        if [[ -n $PACKAGER ]]; then
@@ -2089,7 +2096,7 @@ if (( PACKAGELIST )); then
 fi
  if (( PRINTSRCINFO )); then
-       write_srcinfo
+       write_srcinfo_content
        exit 0
 fi
 -- 2.7.1

Reply via email to