summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorCedric Staniewski <cedric@gmx.ca>2009-10-08 16:10:05 +0200
committerDan McGee <dan@archlinux.org>2009-10-12 05:35:20 +0200
commit2cabe336eb33e443819a1d9d46b0c5bcceaa7e87 (patch)
tree710754a2eb38318e7e4be004ea53194d795c64a2 /scripts
parente3ac8062626877b8cf87df5ce94f61394bf10c0f (diff)
downloadpacman-2cabe336eb33e443819a1d9d46b0c5bcceaa7e87.tar.gz
pacman-2cabe336eb33e443819a1d9d46b0c5bcceaa7e87.tar.xz
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> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in25
1 files changed, 17 insertions, 8 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2941a5d3..24fddf69 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
@@ -1055,13 +1055,17 @@ create_srcpackage() {
msg2 "$(gettext "Adding install script...")"
ln -s "${startdir}/$install" "${srclinks}/${pkgbase}/"
else
- error "$(gettext "Install script %s not found.")" "$install"
+ error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
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) does not exist.")" "$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}