From e4ed23ee4eb2adfb09e79c16c9bb705dbf7052299aa67123c91034cc736ed40b Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 14 Mar 2017 14:17:09 +0000 Subject: [PATCH] Accepting request 478957 from home:fbui:branches:Base:System - Kill preset macros OBS-URL: https://build.opensuse.org/request/show/478957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=17 --- macros.systemd | 124 ------------------------------------- systemd-rpm-macros.changes | 16 +++++ 2 files changed, 16 insertions(+), 124 deletions(-) diff --git a/macros.systemd b/macros.systemd index 0405554..6a6ad36 100644 --- a/macros.systemd +++ b/macros.systemd @@ -19,17 +19,6 @@ # %postun # %service_del_postun demo.service # -### -# -# When a package install systemd preset files, it should use the following macros: -# -# %pre -p /bin/bash -# %systemd_preset_pre -# -# %posttrans -p /bin/bash -# %systemd_preset_posttrans -# -### # This is for systemctl %systemd_requires \ @@ -282,116 +271,3 @@ fi \ [ -x /usr/lib/systemd/systemd-binfmt ] && \ /usr/lib/systemd/systemd-binfmt %{?*} || : \ %{nil} - -%systemd_preset_pre() \ -if ! test -f /usr/lib/systemd/system-preset/99-default-disable.preset ; then \ - mkdir -p /usr/lib/systemd/system-preset; \ - touch /usr/lib/systemd/system-preset/systemd_preset-skip.rpm-tmp; \ -else \ - cd /usr/lib/systemd/system-preset; \ - declare -a PRESET_FILES; \ - declare -A PRESETS; \ - PRESET_FILES=(*.preset); \ - if ! test -f systemd_preset-old.rpm-tmp ; then \ - for ((i=${#PRESET_FILES[@]}-1 ; i>= 0 ; i-- )) ; do \ - FILE=${PRESET_FILES[i]}; \ - exec 3<"$FILE"; \ - while read -u3 ENABLE SERVICE PAD ; do \ - if test -z "$SERVICE" ; then \ - continue; \ - fi; \ - case "$ENABLE" in \ - enable|disable) \ - PRESETS[$SERVICE]=$ENABLE;; \ - esac; \ - done; \ - exec 3<&-; \ - done; \ - exec 3>systemd_preset-old.rpm-tmp; \ - for PRESET in "${!PRESETS[@]}" ; do \ - echo >&3 "${PRESETS[$PRESET]} $PRESET"; \ - done; \ - exec 3>&-; \ - fi; \ -fi; \ -%{nil} - -%systemd_preset_posttrans() \ -if test -f /usr/lib/systemd/system-preset/systemd_preset-skip.rpm-tmp ; then \ - rm -f /usr/lib/systemd/system-preset/systemd_preset-{old,skip}.rpm-tmp; \ -fi; \ -cd /usr/lib/systemd/system-preset; \ -if test -f systemd_preset-old.rpm-tmp ; then \ - declare -a PRESET_FILES; \ - declare -A PRESETS_OLD; \ - declare -A PRESETS_OLD_WILDCARD; \ - declare -A PRESETS; \ - declare -A PRESETS_WILDCARD; \ - exec 3= 0 ; i-- )) ; do \ - FILE=${PRESET_FILES[i]}; \ - exec 3<"$FILE"; \ - while read -u3 ENABLE SERVICE PAD ; do \ - if test -z "$SERVICE" ; then \ - continue; \ - fi; \ - case "$ENABLE" in \ - enable|disable) \ - case $SERVICE in \ - *"*"*|*"?"*) PRESETS_WILDCARD[$SERVICE]=$ENABLE;; \ - *) PRESETS[$SERVICE]=$ENABLE;; \ - esac;; \ - esac; \ - done; \ - exec 3<&-; \ - done; \ - if test -x /usr/bin/systemctl ; then \ - /usr/bin/systemctl --type=service,socket list-unit-files; \ - fi >systemd_preset-states.rpm-tmp; \ - exec 3