1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

Merge pull request #12519 from keszybz/man-on-demand

Build man pages on demand only
This commit is contained in:
Yu Watanabe 2019-05-21 08:25:26 +09:00 committed by GitHub
commit 3041250a9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 45 additions and 4 deletions

12
man/html.in Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo "Use: $0 page-name (with no section suffix)"
exit 1
fi
target="man/$1.html"
ninja -C "@BUILD_ROOT@" "$target"
set -x
exec xdg-open build/"$target"

15
man/man.in Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo "Use: $0 page-name (with no section suffix)"
exit 1
fi
target=$(ninja -C "@BUILD_ROOT@" -t query man/man | grep -E -m1 "man/$1\.[0-9]$" | awk '{print $2}')
if [ -z "$target" ]; then
echo "Cannot find page $1"
exit 1
fi
ninja -C "@BUILD_ROOT@" "$target"
exec man build/"$target"

View File

@ -204,3 +204,15 @@ if git.found()
'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
depend_files : custom_entities_ent)
endif
############################################################
configure_file(
input : 'man.in',
output : 'man',
configuration : substs)
configure_file(
input : 'html.in',
output : 'html',
configuration : substs)

View File

@ -283,6 +283,7 @@ substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-loc
substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no')
substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE'))
substs.set('BUILD_ROOT', meson.current_build_dir())
#####################################################################

View File

@ -126,6 +126,7 @@ option('hwdb', type : 'boolean',
option('rfkill', type : 'boolean',
description : 'support for the rfkill tools')
option('man', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'false',
description : 'build and install man pages')
option('html', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'false',

View File

@ -88,7 +88,7 @@ EOF
# disable autopkgtests which are not for upstream
sed -i '/# NOUPSTREAM/ q' debian/tests/control
# enable more unit tests
sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true /' debian/rules
sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true -Dman=true /' debian/rules
# no orig tarball
echo '1.0' > debian/source/format

View File

@ -44,7 +44,7 @@ for phase in "${PHASES[@]}"; do
if [[ "$phase" = "RUN_CLANG" ]]; then
ENV_VARS="-e CC=clang -e CXX=clang++"
fi
docker exec $ENV_VARS -it $CONT_NAME meson --werror -Dtests=unsafe -Dslow-tests=true -Dsplit-usr=true build
docker exec $ENV_VARS -it $CONT_NAME meson --werror -Dtests=unsafe -Dslow-tests=true -Dsplit-usr=true -Dman=true build
$DOCKER_EXEC ninja -v -C build
docker exec -e "TRAVIS=$TRAVIS" -it $CONT_NAME ninja -C build test
$DOCKER_EXEC tools/check-directives.sh

View File

@ -53,7 +53,7 @@ for phase in "${PHASES[@]}"; do
$DOCKER_EXEC tools/check-directives.sh
;;
RUN_CLANG)
docker exec -e CC=clang -e CXX=clang++ -it $CONT_NAME meson --werror -Dtests=unsafe -Dslow-tests=true build
docker exec -e CC=clang -e CXX=clang++ -it $CONT_NAME meson --werror -Dtests=unsafe -Dslow-tests=true -Dman=true build
$DOCKER_EXEC ninja -v -C build
$DOCKER_EXEC ninja -C build test
;;

View File

@ -13,7 +13,7 @@ cd ${REPO_ROOT:-$(pwd)}
sed -i 's/2\.30/2.27/' meson.build
meson --werror -Db_sanitize=address,undefined -Dsplit-usr=true build
meson --werror -Db_sanitize=address,undefined -Dsplit-usr=true -Dman=true build
ninja -v -C build
make -C test/TEST-01-BASIC clean setup run NSPAWN_TIMEOUT=600 TEST_NO_QEMU=yes NSPAWN_ARGUMENTS=--keep-unit RUN_IN_UNPRIVILEGED_CONTAINER=no