[pacman-dev] [PATCH] srcinfo.sh: remove trailing newline

Allan McRae allan at archlinux.org
Thu Jun 4 02:42:29 UTC 2020


On 4/6/20 9:26 am, Denton Liu wrote:
> When the .SRCINFO file is generated via `makepkg --printsrcinfo`, each
> section is concluded with an empty line. This means that at the end of
> the file, an empty line remains. When running `git diff --check`, Git
> will complain about this as a whitespace error, saying "new blank line
> at EOF."
> 
> Remove the empty line after sections. Replace the empty echo with a
> placeholder `true` call in case in the future, we do want to close the
> section with something.
> ---
>  scripts/libmakepkg/srcinfo.sh.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/libmakepkg/srcinfo.sh.in b/scripts/libmakepkg/srcinfo.sh.in
> index 6e783279..e7b5c4be 100644
> --- a/scripts/libmakepkg/srcinfo.sh.in
> +++ b/scripts/libmakepkg/srcinfo.sh.in
> @@ -31,7 +31,7 @@ srcinfo_open_section() {
>  }
>  
>  srcinfo_close_section() {
> -	echo
> +	true # nothing to be done
>  }

This is a very strange approach to implementing your idea.  Now the
function is useless and should have been removed completely.  And now
there is zero separate between sections - not just the last line was
removed.

Anyway, the justification for this patch is missing.  Why does makepkg
care about a minor warning from "git diff --check"?

>  
>  srcinfo_write_attr() {
> 


More information about the pacman-dev mailing list