Change message about config.h on first run from error to warning

This commit is contained in:
Sebastian J. Bronner
2019-10-31 01:56:15 +01:00
parent 07a231717f
commit eb4d0d26b0
2 changed files with 20 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
pkgbase = st pkgbase = st
pkgdesc = A simple virtual terminal emulator for X. pkgdesc = A simple virtual terminal emulator for X.
pkgver = 0.8.2 pkgver = 0.8.2
pkgrel = 8 pkgrel = 9
url = https://st.suckless.org url = https://st.suckless.org
arch = i686 arch = i686
arch = x86_64 arch = x86_64

View File

@@ -5,7 +5,7 @@
pkgname=st pkgname=st
pkgver=0.8.2 pkgver=0.8.2
pkgrel=8 pkgrel=9
pkgdesc='A simple virtual terminal emulator for X.' pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64' 'armv7h') arch=('i686' 'x86_64' 'armv7h')
license=('MIT') license=('MIT')
@@ -28,35 +28,32 @@ prepare() {
# configuration states are determined by the presence of two files in # configuration states are determined by the presence of two files in
# $BUILDDIR: # $BUILDDIR:
# #
# * config.h: The user has supplied his or her configuration. The file will # config.h config.def.h state
# be copied to $srcdir and used during build. # ======== ============ =====
# * config.def.h only: The user was previously made aware of the # absent absent Initial state. The user receives a message on how
# configuration options and has opted not to make any configuration # to configure this package.
# changes. The package is built using default values. # absent present The user was previously made aware of the
# * neither file: Initial state. The user receives a message on how to # configuration options and has not made any
# configure this package. The build process is aborted after the copy # configuration changes. The package is built using
# operation below. # default values.
# present The user has supplied his or her configuration. The
# file will be copied to $srcdir and used during
# build.
# #
# After this test, config.def.h is copied from $srcdir to provide an up to # After this test, config.def.h is copied from $srcdir to $BUILDDIR to
# date template for the user. If neither file was present initially, further # provide an up to date template for the user.
# build steps are aborted at this point. Even if no config.h is provided,
# future runs will proceed with default values due to the presence of
# config.def.h.
abort=
if [ -e "$BUILDDIR/config.h" ] if [ -e "$BUILDDIR/config.h" ]
then then
cp "$BUILDDIR/config.h" "$_sourcedir" cp "$BUILDDIR/config.h" "$_sourcedir"
elif [ ! -e "$BUILDDIR/config.def.h" ] elif [ ! -e "$BUILDDIR/config.def.h" ]
then then
abort=1 msg='This package can be configured in config.h. Copy the config.def.h '
msg='This package can be configured in config.h. Copy config.def.h just ' msg+='that was just placed into the package directory to config.h and '
msg+='placed into the package directory to config.h and modify it to ' msg+='modify it to change the configuration. Or just leave it alone to '
msg+='change the configuration. Or just leave it alone to use default ' msg+='continue to use default values.'
msg+='values. Then restart the build process.' warning "$msg"
error "$msg"
fi fi
cp "$_sourcedir/config.def.h" "$BUILDDIR" cp "$_sourcedir/config.def.h" "$BUILDDIR"
test -z "$abort"
} }
build() { build() {