[pacman-dev] [PATCH] Introduce new PKGBUILD variable `changelog`
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@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@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(-) diff --git a/PKGBUILD-split.proto b/PKGBUILD-split.proto index 08f98d6..11ceff2 100644 --- a/PKGBUILD-split.proto +++ b/PKGBUILD-split.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgbase-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' @@ -44,6 +45,7 @@ package_pkg1() { backup=() options=() install= + changelog= cd "$srcdir/$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install-pkg1 diff --git a/PKGBUILD.proto b/PKGBUILD.proto index eddcf75..93da0fc 100644 --- a/PKGBUILD.proto +++ b/PKGBUILD.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgname-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index 994eacc..af0f981 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -115,6 +115,12 @@ syn match pbValidInstall /\([[:alnum:]]\|\$\|+\|-\|_\)*\.install/ contained syn match pbIllegalInstall /[^=]/ contained contains=pbValidInstall syn match pbInstallGroup /^install=.*/ contains=pb_k_install,pbValidInstall,pbIllegalInstall,shDeref,shDoubleQuote,shSingleQuote +" changelog +syn keyword pb_k_changelog changelog contained +syn match pbValidChangelog /\([[:alnum:]]\|\$\|+\|-\|_\)*/ contained +syn match pbIllegalChangelog /[^=]/ contained contains=pbValidChangelog +syn match pbChangelogGroup /^changelog=.*/ contains=pb_k_changelog,pbValidChangelog,pbIllegalChangelog,shDeref,shDoubleQuote,shSingleQuote + " source: " XXX remove source from shStatement, fix strange bug syn clear shStatement @@ -212,6 +218,9 @@ hi def link pb_k_provides pbKeywords hi def link pbIllegalInstall Error hi def link pb_k_install pbKeywords +hi def link pbIllegalChangelog Error +hi def link pb_k_changelog pbKeywords + hi def link pb_k_source pbKeywords hi def link pbIllegalSource Error diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index e6f6edf..435a148 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -79,6 +79,12 @@ similar to `$_basekernver`. be copied into the package by makepkg. It does not need to be included in the source array (e.g. `install=pkgname.install`). +*changelog*:: + Specifies a changelog file which is supposed to be included in the package. + It is required that this file is placed into the same directory as the + PKGBUILD, and makepkg will copy it into the package. The file must not be + included in the source array (e.g. `changelog=$pkgname.changelog`). + *source (array)*:: An array of source files required to build the package. Source files must either reside in the same directory as the PKGBUILD file, or be a @@ -271,7 +277,7 @@ All options and directives for the split packages default to the global values g within the PKGBUILD. However, some of these can be overridden within each split package's packaging function. The following variables can be overridden: `pkgdesc`, `license`, `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, -`backup`, `options` and `install`. +`backup`, `options`, `install` and `changelog`. An optional global directive is available when building a split package: diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2941a5d..88487da 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -47,7 +47,7 @@ pkgdir="$startdir/pkg" packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgdesc' 'license' 'groups' 'depends' 'optdepends' 'provides' \ - 'conflicts' 'replaces' 'backup' 'options' 'install') + 'conflicts' 'replaces' 'backup' 'options' 'install' 'changelog') readonly -a packaging_options other_options splitpkg_overrides # Options @@ -991,9 +991,9 @@ create_package() { fi # do we have a changelog? - if [ -f "$startdir/ChangeLog" ]; then + if [ -n "$changelog" ]; then msg2 "$(gettext "Adding package changelog...")" - cp "$startdir/ChangeLog" .CHANGELOG + cp "$startdir/$changelog" .CHANGELOG comp_files="$comp_files .CHANGELOG" fi @@ -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 local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi + if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog" + return 1 + fi + local valid_options=1 local opt known kopt for opt in ${options[@]}; do @@ -1646,7 +1655,7 @@ if [ "$ASROOT" -eq 0 \ fi unset pkgname pkgbase pkgver pkgrel pkgdesc url license groups provides -unset md5sums replaces depends conflicts backup source install build +unset md5sums replaces depends conflicts backup source install changelog build unset makedepends optdepends options noextract BUILDFILE=${BUILDFILE:-$BUILDSCRIPT} -- 1.6.4.4
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> 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@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@gmx.ca>
I don't have a problem with this. The changelog stuff was originally added by Aaron in early 2007, so any comments from him? Commit 0635e03869a9af0b40ba2858a88de0d2e6dd8fe7. Xavier and Allan. always looking for your input as well. :) -Dan
--- 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(-)
diff --git a/PKGBUILD-split.proto b/PKGBUILD-split.proto index 08f98d6..11ceff2 100644 --- a/PKGBUILD-split.proto +++ b/PKGBUILD-split.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgbase-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' @@ -44,6 +45,7 @@ package_pkg1() { backup=() options=() install= + changelog=
cd "$srcdir/$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install-pkg1 diff --git a/PKGBUILD.proto b/PKGBUILD.proto index eddcf75..93da0fc 100644 --- a/PKGBUILD.proto +++ b/PKGBUILD.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgname-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index 994eacc..af0f981 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -115,6 +115,12 @@ syn match pbValidInstall /\([[:alnum:]]\|\$\|+\|-\|_\)*\.install/ contained syn match pbIllegalInstall /[^=]/ contained contains=pbValidInstall syn match pbInstallGroup /^install=.*/ contains=pb_k_install,pbValidInstall,pbIllegalInstall,shDeref,shDoubleQuote,shSingleQuote
+" changelog +syn keyword pb_k_changelog changelog contained +syn match pbValidChangelog /\([[:alnum:]]\|\$\|+\|-\|_\)*/ contained +syn match pbIllegalChangelog /[^=]/ contained contains=pbValidChangelog +syn match pbChangelogGroup /^changelog=.*/ contains=pb_k_changelog,pbValidChangelog,pbIllegalChangelog,shDeref,shDoubleQuote,shSingleQuote + " source: " XXX remove source from shStatement, fix strange bug syn clear shStatement @@ -212,6 +218,9 @@ hi def link pb_k_provides pbKeywords hi def link pbIllegalInstall Error hi def link pb_k_install pbKeywords
+hi def link pbIllegalChangelog Error +hi def link pb_k_changelog pbKeywords + hi def link pb_k_source pbKeywords hi def link pbIllegalSource Error
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index e6f6edf..435a148 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -79,6 +79,12 @@ similar to `$_basekernver`. be copied into the package by makepkg. It does not need to be included in the source array (e.g. `install=pkgname.install`).
+*changelog*:: + Specifies a changelog file which is supposed to be included in the package. + It is required that this file is placed into the same directory as the + PKGBUILD, and makepkg will copy it into the package. The file must not be + included in the source array (e.g. `changelog=$pkgname.changelog`). + *source (array)*:: An array of source files required to build the package. Source files must either reside in the same directory as the PKGBUILD file, or be a @@ -271,7 +277,7 @@ All options and directives for the split packages default to the global values g within the PKGBUILD. However, some of these can be overridden within each split package's packaging function. The following variables can be overridden: `pkgdesc`, `license`, `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, -`backup`, `options` and `install`. +`backup`, `options`, `install` and `changelog`.
An optional global directive is available when building a split package:
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2941a5d..88487da 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -47,7 +47,7 @@ pkgdir="$startdir/pkg" packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgdesc' 'license' 'groups' 'depends' 'optdepends' 'provides' \ - 'conflicts' 'replaces' 'backup' 'options' 'install') + 'conflicts' 'replaces' 'backup' 'options' 'install' 'changelog') readonly -a packaging_options other_options splitpkg_overrides
# Options @@ -991,9 +991,9 @@ create_package() { fi
# do we have a changelog? - if [ -f "$startdir/ChangeLog" ]; then + if [ -n "$changelog" ]; then msg2 "$(gettext "Adding package changelog...")" - cp "$startdir/ChangeLog" .CHANGELOG + cp "$startdir/$changelog" .CHANGELOG comp_files="$comp_files .CHANGELOG" fi
@@ -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
local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi
+ if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog" + return 1 + fi + local valid_options=1 local opt known kopt for opt in ${options[@]}; do @@ -1646,7 +1655,7 @@ if [ "$ASROOT" -eq 0 \ fi
unset pkgname pkgbase pkgver pkgrel pkgdesc url license groups provides -unset md5sums replaces depends conflicts backup source install build +unset md5sums replaces depends conflicts backup source install changelog build unset makedepends optdepends options noextract
BUILDFILE=${BUILDFILE:-$BUILDSCRIPT} -- 1.6.4.4
On Sat, Oct 10, 2009 at 4:34 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> 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@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@gmx.ca>
I don't have a problem with this. The changelog stuff was originally added by Aaron in early 2007, so any comments from him? Commit 0635e03869a9af0b40ba2858a88de0d2e6dd8fe7.
Xavier and Allan. always looking for your input as well. :)
This looked good to me.
On Sat, Oct 10, 2009 at 4:37 PM, Xavier <shiningxc@gmail.com> wrote:
This looked good to me.
Sorry for the double mail. I just had one question : Will every package maintainer figure out easily that his ChangeLog is no longer included ? Or do we need a transition period deprecating the old way and including the new one ?
On Sat 10 Oct 2009 16:40 +0200, Xavier wrote:
On Sat, Oct 10, 2009 at 4:37 PM, Xavier <shiningxc@gmail.com> wrote:
This looked good to me.
Sorry for the double mail.
I just had one question : Will every package maintainer figure out easily that his ChangeLog is no longer included ? Or do we need a transition period deprecating the old way and including the new one ?
I'd say just jump to the new behaviour. It doesn't seem like ChangeLog is used often or for anything too important yet.
Loui Chang wrote:
On Sat 10 Oct 2009 16:40 +0200, Xavier wrote:
On Sat, Oct 10, 2009 at 4:37 PM, Xavier <shiningxc@gmail.com> wrote:
This looked good to me.
Sorry for the double mail.
I just had one question : Will every package maintainer figure out easily that his ChangeLog is no longer included ? Or do we need a transition period deprecating the old way and including the new one ?
I'd say just jump to the new behaviour. It doesn't seem like ChangeLog is used often or for anything too important yet.
I second this, it's not worth the effort. By the way, was makepkg's changelog functionality documented somewhere? If not (couldn't find anything), I would expect that a maintainer, who used a changelog before, is kind enough to figure out the new behavior by reading the man pages.
On Thu, 08 Oct 2009 16:10:05 +0200 Cedric Staniewski <cedric@gmx.ca> 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
For Icadyptes I store all of my buildscripts in Git and make comments and log revisions from there. I think that it would be a much easier and more thorough solution, although it does have some weaknesses on edge cases, possibly. <http://gitweb.icadyptes.org> Just wanted to suggest that. I know it's not integrated, but I think it's a better long-term solution, personally. Thanks, Teran -- --Teran McKinney (sega01) Blog, website, consulting: http://go-beyond.org/ Icadyptes (Arch Linux fork): http://icadyptes.org/ HLB Studios (art and the best duct tape wallets ever): http://hlbstudios.com/ Note that this email is PGP/MIME signed, as per the signature.asc attachment. If you do not know what this is, please don't worry about the attached signature.asc file. If you do know what this is and my signature is invalid, it may be due to malicious activity, a bug, or a mystery of email forwarding and what not. If you are concerned about whether or not this email is altered, please let me know. Of course, if it's altered enough, this text could be removed as well, so if this text isn't here it is probably of higher concern. Thanks! --
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@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@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
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> wrote:
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@gmx.ca> --- Before we pull this, can you (or Allan) make some changes? It isn't quite ready for primetime yet.
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(-)
diff --git a/PKGBUILD-split.proto b/PKGBUILD-split.proto index 08f98d6..11ceff2 100644 --- a/PKGBUILD-split.proto +++ b/PKGBUILD-split.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgbase-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' @@ -44,6 +45,7 @@ package_pkg1() { backup=() options=() install= + changelog=
cd "$srcdir/$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install-pkg1 diff --git a/PKGBUILD.proto b/PKGBUILD.proto index eddcf75..93da0fc 100644 --- a/PKGBUILD.proto +++ b/PKGBUILD.proto @@ -21,6 +21,7 @@ replaces=() backup=() options=() install= +changelog= source=($pkgname-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index 994eacc..af0f981 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -115,6 +115,12 @@ syn match pbValidInstall /\([[:alnum:]]\|\$\|+\|-\|_\)*\.install/ contained syn match pbIllegalInstall /[^=]/ contained contains=pbValidInstall syn match pbInstallGroup /^install=.*/ contains=pb_k_install,pbValidInstall,pbIllegalInstall,shDeref,shDoubleQuote,shSingleQuote
+" changelog +syn keyword pb_k_changelog changelog contained +syn match pbValidChangelog /\([[:alnum:]]\|\$\|+\|-\|_\)*/ contained +syn match pbIllegalChangelog /[^=]/ contained contains=pbValidChangelog +syn match pbChangelogGroup /^changelog=.*/ contains=pb_k_changelog,pbValidChangelog,pbIllegalChangelog,shDeref,shDoubleQuote,shSingleQuote + " source: " XXX remove source from shStatement, fix strange bug syn clear shStatement @@ -212,6 +218,9 @@ hi def link pb_k_provides pbKeywords hi def link pbIllegalInstall Error hi def link pb_k_install pbKeywords
+hi def link pbIllegalChangelog Error +hi def link pb_k_changelog pbKeywords + hi def link pb_k_source pbKeywords hi def link pbIllegalSource Error
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index e6f6edf..435a148 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -79,6 +79,12 @@ similar to `$_basekernver`. be copied into the package by makepkg. It does not need to be included in the source array (e.g. `install=pkgname.install`).
+*changelog*:: + Specifies a changelog file which is supposed to be included in the package. "supposed"? Since we fail hard if it is missing, just keep the language more direct. "Specifies a changelog file which is to be included in the package." In reality, we should keep the language for this and the install file as similar as possible, as I believe they are under the same set of rules.
+ It is required that this file is placed into the same directory as the + PKGBUILD, and makepkg will copy it into the package. The file must not be + included in the source array (e.g. `changelog=$pkgname.changelog`). + *source (array)*:: An array of source files required to build the package. Source files must either reside in the same directory as the PKGBUILD file, or be a @@ -271,7 +277,7 @@ All options and directives for the split packages default to the global values g within the PKGBUILD. However, some of these can be overridden within each split package's packaging function. The following variables can be overridden: `pkgdesc`, `license`, `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, -`backup`, `options` and `install`. +`backup`, `options`, `install` and `changelog`.
An optional global directive is available when building a split package:
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2941a5d..88487da 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -47,7 +47,7 @@ pkgdir="$startdir/pkg" packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgdesc' 'license' 'groups' 'depends' 'optdepends' 'provides' \ - 'conflicts' 'replaces' 'backup' 'options' 'install') + 'conflicts' 'replaces' 'backup' 'options' 'install' 'changelog') readonly -a packaging_options other_options splitpkg_overrides
# Options @@ -991,9 +991,9 @@ create_package() { fi
# do we have a changelog? - if [ -f "$startdir/ChangeLog" ]; then + if [ -n "$changelog" ]; then msg2 "$(gettext "Adding package changelog...")" - cp "$startdir/ChangeLog" .CHANGELOG + cp "$startdir/$changelog" .CHANGELOG comp_files="$comp_files .CHANGELOG" fi
@@ -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
local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi
+ if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog" Not cool for translators to have two messages that say the same thing, but are not the same. Please choose one (that hopefully resembles the install script missing message). However, why do we do this check in two places? Is it due to split packages? And we fail in one, but not in the other.
+ return 1 + fi + local valid_options=1 local opt known kopt for opt in ${options[@]}; do @@ -1646,7 +1655,7 @@ if [ "$ASROOT" -eq 0 \ fi
unset pkgname pkgbase pkgver pkgrel pkgdesc url license groups provides -unset md5sums replaces depends conflicts backup source install build +unset md5sums replaces depends conflicts backup source install changelog build unset makedepends optdepends options noextract
BUILDFILE=${BUILDFILE:-$BUILDSCRIPT} --
Thanks for doing a very good sweep with this patch and making all the necessary doc and other script updates, it is appreciated. -Dan
Dan McGee wrote:
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> wrote:
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@gmx.ca> ---
Before we pull this, can you (or Allan) make some changes? It isn't quite ready for primetime yet.
<snip> +*changelog*:: + Specifies a changelog file which is supposed to be included in the package.
"supposed"? Since we fail hard if it is missing, just keep the language more direct. "Specifies a changelog file which is to be included in the package." In reality, we should keep the language for this and the install file as similar as possible, as I believe they are under the same set of rules.
Fixed.
@@ -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
local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi
+ if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog"
Not cool for translators to have two messages that say the same thing, but are not the same. Please choose one (that hopefully resembles the install script missing message). However, why do we do this check in two places? Is it due to split packages? And we fail in one, but not in the other.
These exactly the same as the two messages for install files. I can make the two messages the same and just pull in a similar change for the install file. And the second check is because the check_sanity script misses variables in package() functions (http://bugs.archlinux.org/task/16004). The lack of fail in the second one is a bit weird, but that chack is done at the end of the packaging rather than at the start where we do fail. Allan
On Sun, Oct 11, 2009 at 5:12 PM, Allan McRae <allan@archlinux.org> wrote:
Dan McGee wrote:
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> wrote:
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@gmx.ca> ---
Before we pull this, can you (or Allan) make some changes? It isn't quite ready for primetime yet.
<snip> +*changelog*:: + Specifies a changelog file which is supposed to be included in the package.
"supposed"? Since we fail hard if it is missing, just keep the language more direct. "Specifies a changelog file which is to be included in the package." In reality, we should keep the language for this and the install file as similar as possible, as I believe they are under the same set of rules.
Fixed.
@@ -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
local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi
+ if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog"
Not cool for translators to have two messages that say the same thing, but are not the same. Please choose one (that hopefully resembles the install script missing message). However, why do we do this check in two places? Is it due to split packages? And we fail in one, but not in the other.
These exactly the same as the two messages for install files. I can make the two messages the same and just pull in a similar change for the install file.
And the second check is because the check_sanity script misses variables in package() functions (http://bugs.archlinux.org/task/16004). The lack of fail in the second one is a bit weird, but that chack is done at the end of the packaging rather than at the start where we do fail.
Thanks for addressing the issues! And yeah, that is what I expected, although that is a shame. -Dan
Dan McGee wrote:
On Sun, Oct 11, 2009 at 5:12 PM, Allan McRae <allan@archlinux.org> wrote:
Dan McGee wrote:
On Thu, Oct 8, 2009 at 9:10 AM, Cedric Staniewski <cedric@gmx.ca> wrote:
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@gmx.ca> ---
Before we pull this, can you (or Allan) make some changes? It isn't quite ready for primetime yet.
<snip> +*changelog*:: + Specifies a changelog file which is supposed to be included in the package.
"supposed"? Since we fail hard if it is missing, just keep the language more direct. "Specifies a changelog file which is to be included in the package." In reality, we should keep the language for this and the install file as similar as possible, as I believe they are under the same set of rules.
Fixed.
@@ -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
local netfile @@ -1193,6 +1197,11 @@ check_sanity() { return 1 fi
+ if [ -n "$changelog" -a ! -f "$changelog" ]; then + error "$(gettext "Changelog file (%s) does not exist.")" "$changelog"
Not cool for translators to have two messages that say the same thing, but are not the same. Please choose one (that hopefully resembles the install script missing message). However, why do we do this check in two places? Is it due to split packages? And we fail in one, but not in the other.
These exactly the same as the two messages for install files. I can make the two messages the same and just pull in a similar change for the install file.
And the second check is because the check_sanity script misses variables in package() functions (http://bugs.archlinux.org/task/16004). The lack of fail in the second one is a bit weird, but that chack is done at the end of the packaging rather than at the start where we do fail.
Thanks for addressing the issues! And yeah, that is what I expected, although that is a shame.
-Dan
Thanks for resolving the existing issues, Allan. So, can I assume none is left for this patch?
participants (6)
-
Allan McRae
-
Cedric Staniewski
-
Dan McGee
-
Loui Chang
-
Teran McKinney
-
Xavier