[pacman-dev] [PATCH] set .SRCINFO time stamp to PKGBUILD modification

Dave Reisner d at falconindy.com
Thu Feb 18 19:29:15 UTC 2016


On Thu, Feb 18, 2016 at 07:56:55PM +0100, Dominik Fischer wrote:
> As the .SRCINFO is mandatory for a git push to AUR, it is tempting to
> automate its generation, for example in a git hook. This also saves the
> developer from accidentally uploading a change to the PKGBUILD without
> it being properly reflected in the .SRCINFO.
> 
> But when only files other than the PKGBUILD were changed, or a change to
> the PKGBUILD did not affect the contents of the .SRCINFO, the time stamp
> still changes on each run of mksrcinfo, introducing an unnecessary and
> possibly misleading change to the otherwise unaltered .SRCINFO file.
> This especially impairs the use of commands examining the history, like
> "git log .SRCINFO".
> 
> Using the last modification time of the PKGBUILD in place of the date
> the .SRCINFO was generated alleviates at least part of this problem.

As you point out, this method has its downfalls (and would stress the
downfalls you point out, because they're lousy). I ended up adding this
to mksrcinfo in a different way:

https://github.com/falconindy/pkgbuild-introspection/commit/f7f812bdea339a1

> ---
> 
> More than a ready proposal for a change, this patch is an inquiry about
> the reason for the time stamp. As noted above, I find it quite
> impractical while maintaining packages in the AUR. Above that, the
> information seems redundant, as all package repositories are versioned
> with git, where each commit already carries a date, usually only a few
> seconds behind the time stamp.
> 
> I originally posted this issue to the pkgbuild-introspection project
> [1], but as pacman sets the standard for the .SRCINFO format, this
> mailing list is the more appropriate place for it.
> 
> I am aware that git attributes and filters could be used to modify or
> delete the timestamp, but am reluctant to deviate from the norm be it
> only for a mere comment, as long a I do not know its purpose. Why is the
> time stamp there? Would it be sensible to switch it out for the PKGBUILD
> modification date? Could it even be removed?
> 
> [1]: https://github.com/falconindy/pkgbuild-introspection/issues/32
> 
> 
>  scripts/makepkg.sh.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 80b95f4..00e532b 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1084,7 +1084,7 @@ write_srcinfo() {
>  	local pkg
>  	printf "# Generated by makepkg %s\n" "$makepkg_version"
> -	printf "# %s\n" "$(LC_ALL=C date -u)"
> +	printf "# %s\n" "$(LC_ALL=C date -ud @$(stat -c %Y "$BUILDFILE"))"
>  	srcinfo_write_global
> -- 
> 2.7.1


More information about the pacman-dev mailing list