summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-20 20:04:40 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-20 20:04:58 +0100
commitc1b2813ddf113cf84516fb1be818ea3fdffc8e94 (patch)
treeec207cf46d8a2a698f6db5d7b4b36936508ef25b /Ports
parent54f6ac1854f33053565ba3eb246f08e4d54fcd13 (diff)
downloadserenity-c1b2813ddf113cf84516fb1be818ea3fdffc8e94.zip
Ports: Only do build check for configure, build, and install steps
This was breaking ports linting, which runs the script with the 'showproperty' option. This check is not needed for some other options as well, so let's do it conditionally.
Diffstat (limited to 'Ports')
-rwxr-xr-xPorts/.port_include.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh
index dea3f333d1..267bd069b8 100755
--- a/Ports/.port_include.sh
+++ b/Ports/.port_include.sh
@@ -50,15 +50,6 @@ host_env() {
enable_ccache
}
-# Sanity check.
-if [ ! -f "${DESTDIR}/usr/lib/libc.so" ]; then
- echo "libc.so could not be found. This likely means that SerenityOS:"
- echo "- has not been built and/or installed yet"
- echo "- has been installed in an unexpected location"
- echo "The currently configured build directory is ${SERENITY_BUILD_DIR}. Resolve this issue and try again."
- exit 1
-fi
-
packagesdb="${DESTDIR}/usr/Ports/packages.db"
. "$@"
@@ -83,13 +74,27 @@ run_nocd() {
echo "+ $@ (nocd)"
("$@")
}
+
run() {
echo "+ $@"
(cd "$workdir" && "$@")
}
+
run_replace_in_file() {
run perl -p -i -e "$1" $2
}
+
+ensure_build() {
+ # Sanity check.
+ if [ ! -f "${DESTDIR}/usr/lib/libc.so" ]; then
+ echo "libc.so could not be found. This likely means that SerenityOS:"
+ echo "- has not been built and/or installed yet"
+ echo "- has been installed in an unexpected location"
+ echo "The currently configured build directory is ${SERENITY_BUILD_DIR}. Resolve this issue and try again."
+ exit 1
+ fi
+}
+
install_launcher() {
if [ -z "$launcher_name" ] || [ -z "${launcher_category}" ] || [ -z "${launcher_command}" ]; then
return
@@ -374,6 +379,7 @@ do_patch() {
patch_internal
}
do_configure() {
+ ensure_build
if [ "$useconfigure" = "true" ]; then
echo "Configuring $port!"
pre_configure
@@ -384,10 +390,12 @@ do_configure() {
fi
}
do_build() {
+ ensure_build
echo "Building $port!"
build
}
do_install() {
+ ensure_build
echo "Installing $port!"
install
post_install