[pacman-dev] [PATCH] Introduce new PKGBUILD variable `changelog`

Allan McRae allan at archlinux.org
Sat Oct 10 19:20:24 EDT 2009


Cedric Staniewski wrote:
> Hi,
>
> This patch adds a new PKGBUILD variable, changelog, which replaces the old, hardcoded ChangeLog file. The old behavior is completely removed, which means that existing ChangeLog files will be ignored if there is no appropriate line in the PKGBUILD. For a more detailed description, please see the patch below.
>
> I hope I also caught all the necessary documentation updates.
>
> Cedric
>
>
> >From d8e1bb73705a665bc03f14f4eb3ec0d8b9e6d259 Mon Sep 17 00:00:00 2001
> From: Cedric Staniewski <cedric at gmx.ca>
> Date: Wed, 16 Sep 2009 14:38:18 +0200
> Subject: [PATCH] Introduce new PKGBUILD variable `changelog`
>
> Currently, a changelog is added to a package if a specific file with a
> hardcoded name exists in the PKGBUILD's directory. This approach is not
> pretty and also inconsistent with the handling of install files, but it
> works.
>
> With the introduction of split PKGBUILDs, however, a drawback in this
> old behavior has arisen: you only have the possibility to include one
> specific changelog file in either every package defined in the PKGBUILD
> or in none.
>
> The use of an additional variable, `changelog`, works around this issue
> and makes it possible to include a changelog in only some of the
> packages, and besides, each package of the PKGBUILD can have its own
> changelog file.
>
> Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
> ---
>  PKGBUILD-split.proto  |    2 ++
>  PKGBUILD.proto        |    1 +
>  contrib/PKGBUILD.vim  |    9 +++++++++
>  doc/PKGBUILD.5.txt    |    8 +++++++-
>  scripts/makepkg.sh.in |   23 ++++++++++++++++-------
>  5 files changed, 35 insertions(+), 8 deletions(-)
>
>   

Sorry, thought I had replied to this....

Looks good to me and a quick test shows it is working as it should.  I 
will pull to my working branch.

> <snip> 
> @@ -1059,9 +1059,13 @@ create_srcpackage() {
>  		fi
>  	fi
>  
> -	if [ -f ChangeLog ]; then
> -		msg2 "$(gettext "Adding %s...")" "ChangeLog"
> -		ln -s "${startdir}/ChangeLog" "${srclinks}/${pkgbase}"
> +	if [ -n "$changelog" ]; then
> +		if [ -f "$changelog" ]; then
> +			msg2 "$(gettext "Adding package changelog...")"
> +			ln -s "${startdir}/$changelog" "${srclinks}/${pkgbase}/"
> +		else
> +			error "$(gettext "Changelog file %s not found.")" "$changelog"
> +		fi
>  	fi
>  
> <snip>
>   

Looking at this bit highlighted an issue we already have with .install 
files.   Install files (and now changelogs) defined in a package 
function do not get included in the source tarball.  So, not specific to 
this patch, but we should figure it out later (somehow...).

Allan



More information about the pacman-dev mailing list