kopia lustrzana https://github.com/weetmuts/wmbusmeters
Adjust install script to create dirs before realpath.
rodzic
c1be4b6c34
commit
876b5ce0af
|
@ -1 +1 @@
|
|||
3.0 (quilt)
|
||||
1.0
|
||||
|
|
|
@ -62,4 +62,4 @@ ROOT=$ROOT /bin/sh ./scripts/install_systemd_service.sh || exit $?
|
|||
ROOT=$ROOT /bin/sh ./scripts/add_myself_to_dialout.sh || exit $?
|
||||
|
||||
echo
|
||||
echo "wmbusmetters sucessfully installed."
|
||||
echo "wmbusmeters sucessfully installed."
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
# Copyright (C) 2021-2023 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
wmbusmeters_dir="$ROOT"/usr/bin
|
||||
wmbusmeters_path="$wmbusmeters_dir"/wmbusmeters
|
||||
wmbusmetersd_dir="$ROOT"/usr/sbin
|
||||
wmbusmetersd_path="$wmbusmetersd_dir"/wmbusmetersd
|
||||
wmbusmetersd_target=$(realpath -s --relative-to="$wmbusmetersd_dir" "$wmbusmeters_path")
|
||||
# Command binary /usr/bin/wmbusmeters
|
||||
wmbusmeters_dir="${ROOT}/usr/bin"
|
||||
wmbusmeters_path="${wmbusmeters_dir}/wmbusmeters"
|
||||
|
||||
rm -f "$wmbusmeters_path" "$wmbusmetersd_path" || exit $?⏎
|
||||
# Daemon /usr/sbin/wmbusmetersd which is a symlink to the command binary.
|
||||
wmbusmetersd_dir="${ROOT}/usr/sbin"
|
||||
wmbusmetersd_path="${wmbusmetersd_dir}/wmbusmetersd"
|
||||
|
||||
install -D -m 755 "$SRC" "$wmbusmeters_path" || exit $?⏎
|
||||
# Remove any existing installed components.
|
||||
rm -f "$wmbusmeters_path" "$wmbusmetersd_path" || exit $?
|
||||
|
||||
# Install the command binary and create the bin directory if necessary.
|
||||
install -D -m 755 "$SRC" "$wmbusmeters_path" || exit $?
|
||||
|
||||
# Create the sbin directory if necessary.
|
||||
mkdir -p "$wmbusmetersd_dir" || exit $?
|
||||
|
||||
# Calculate the relative symlink from sbin to bin.
|
||||
wmbusmetersd_target="$(realpath -s --relative-to="${wmbusmetersd_dir}" "${wmbusmeters_path}")"
|
||||
|
||||
# Create the actual link.
|
||||
ln -s "$wmbusmetersd_target" "$wmbusmetersd_path" || exit $?
|
||||
|
||||
echo "binaries: installed '$wmbusmeters_path' '$wmbusmetersd_path'"
|
||||
echo "binaries: installed ${wmbusmeters_path} ${wmbusmetersd_path}"
|
||||
|
|
Ładowanie…
Reference in New Issue