From: Karol Lewandowski Date: Thu, 7 Sep 2023 12:15:43 +0000 (+0200) Subject: generator: Fix .service/.mount service installation X-Git-Tag: accepted/tizen/unified/20230908.185301~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F85%2F298485%2F2;p=platform%2Fcore%2Fsystem%2Fisu.git generator: Fix .service/.mount service installation This commit fixes cases where service provided .mount but not .service unit. Previously .mount unit would not be installed due to isu_prepare() terminating early. Additionally, this commit silents the warning when .mount unit is not provided as it's rarely used feature. Change-Id: I40da3ec35deed3023ad15664379f2c07237665b8 --- diff --git a/packaging/isu.spec b/packaging/isu.spec index a2c0c53..84353ad 100644 --- a/packaging/isu.spec +++ b/packaging/isu.spec @@ -1,6 +1,6 @@ Summary: Individual Service Upgrade support Name: isu -Version: 8.0.7 +Version: 8.0.8 Release: 1 Source0: %{name}-%{version}.tar.gz License: MIT diff --git a/src/systemd_generator/isu-generator b/src/systemd_generator/isu-generator index 5c16f6e..e8607e7 100755 --- a/src/systemd_generator/isu-generator +++ b/src/systemd_generator/isu-generator @@ -158,12 +158,7 @@ isu_prepare() return 1 fi - if ! compgen -G "${isu_pkg_dir}/${ISU_SERVICES_DIR}/*.service"; then - echo "There are no $INSTANCE services in $isu_pkg_dir" - return 0 - fi - - for srv_path in "${isu_pkg_dir}/${ISU_SERVICES_DIR}"/*.service; do + for srv_path in $(compgen -G "${isu_pkg_dir}/${ISU_SERVICES_DIR}"/*.service); do if ! test -r "$srv_path"; then echo "Service file $srv_path not readable. Skipping" @@ -173,8 +168,9 @@ isu_prepare() install_units "$srv_path" "$isu_pkg_name" done - for unit_path in "${isu_pkg_dir}/${ISU_SERVICES_DIR}"/*.mount; do - if ! test -r "$unit_path"; then + for unit_path in $(compgen -G "${isu_pkg_dir}/${ISU_SERVICES_DIR}"/*.mount); do + + if ! test -r "$unit_path"; then echo "Unit file $unit_path not readable. Skipping" continue fi