Accepting request 543847 from Base:System

- Introduce new %_fillupdir macro for fillup-templates location
- Set %_fillupdir macro to /usr/share/fillup-templates
- Change fillup macros to support new %_fillupdir in addition
  to old /var/adm/fillup-templates location

- Make %post compatibility symlink creation more resiliant

OBS-URL: https://build.opensuse.org/request/show/543847
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=252
This commit is contained in:
Dominique Leuenberger 2017-11-22 10:20:57 +00:00 committed by Git OBS Bridge
commit c8410f6c26
3 changed files with 37 additions and 11 deletions

View File

@ -7,6 +7,7 @@
%_sysconfdir /etc %_sysconfdir /etc
%_localstatedir /var %_localstatedir /var
%_defaultdocdir %{_usr}/share/doc/packages %_defaultdocdir %{_usr}/share/doc/packages
%_fillupdir %{_usr}/share/fillup-templates
# package build macros # package build macros
%make_install make install DESTDIR=%{?buildroot} %make_install make install DESTDIR=%{?buildroot}
@ -65,7 +66,7 @@
# macro: fillup_and_insserv # macro: fillup_and_insserv
# do the fillup and insserv calls for postinstall # do the fillup and insserv calls for postinstall
# options: # options:
# -n (use first argument as name for fillup template filenames # -n (use first argument as name for fillup template filenames
# instead of package name) # instead of package name)
# -f (skip fillup parts) # -f (skip fillup parts)
@ -82,7 +83,7 @@
# name of (old) START variable (unless -s is given) # name of (old) START variable (unless -s is given)
# #
# template for variables into /etc/sysconfig/package: # template for variables into /etc/sysconfig/package:
# /var/adm/fillup-templates/sysconfig.package # /usr/share/fillup-templates/sysconfig.package
%fillup_and_insserv(finpsyY) \ %fillup_and_insserv(finpsyY) \
%{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \ %{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \
%{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \ %{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \
@ -110,8 +111,12 @@
# this part really calls fillup for the appropriate files # this part really calls fillup for the appropriate files
# #
%do_real_fillup() \ %do_real_fillup() \
TEMPLATE_DIR=/var/adm/fillup-templates \ SYSC_TEMPLATE=%{_fillupdir}/sysconfig.$PNAME \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \ # If template not in new %{_fillupdir}, fallback to old TEMPLATE_DIR \
if [ ! -f $SYSC_TEMPLATE ] ; then \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \
fi \
SD_NAME="" \ SD_NAME="" \
%{sysc_fillup} %{sysc_fillup}
@ -128,7 +133,7 @@
elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \ elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \
/sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \ /sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \
fi \ fi \
done done
# macro: insserv_cleanup # macro: insserv_cleanup
%insserv_cleanup() \ %insserv_cleanup() \
@ -150,8 +155,12 @@
%fillup_only(dans) \ %fillup_only(dans) \
%{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \ %{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \
%{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \ %{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \
TEMPLATE_DIR=/var/adm/fillup-templates \ SYSC_TEMPLATE=%{_fillupdir}/sysconfig.$PNAME$SUBPNAME \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \ # If template not in new %{_fillupdir}, fallback to old TEMPLATE_DIR \
if [ ! -f $SYSC_TEMPLATE ] ; then \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \
fi \
SD_NAME="" \ SD_NAME="" \
%{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \ %{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \
%{sysc_fillup} \ %{sysc_fillup} \
@ -189,7 +198,11 @@
%remove_and_set(n:y) \ %remove_and_set(n:y) \
%{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \ %{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \
DEF_VAL=%{-y:"yes"}%{!-y:"no"} \ DEF_VAL=%{-y:"yes"}%{!-y:"no"} \
DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \ DEL_TEMPL=%{_fillupdir}/$PNAME.del \
# If template not in new location, fallback to old location \
if [ ! -f $DEL_TEMPL ] ; then \
DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \
fi \
rm -f $DEL_TEMPL \ rm -f $DEL_TEMPL \
for var in %{?*} ; do \ for var in %{?*} ; do \
echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \ echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \
@ -218,7 +231,7 @@
if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \ if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
/sbin/install-info "${ALL_ARGS[@]}" \ /sbin/install-info "${ALL_ARGS[@]}" \
fi \ fi \
fi ; fi ;
# for %preun # for %preun
%install_info_delete(:-:) \ %install_info_delete(:-:) \
@ -227,7 +240,7 @@
if [ "$FIRST_ARG" = 0 ]; then \ if [ "$FIRST_ARG" = 0 ]; then \
/sbin/install-info --quiet --delete %{**} \ /sbin/install-info --quiet --delete %{**} \
fi ; \ fi ; \
fi ; fi ;
# find-supplements.ksyms parses this macro directly out of the spec file: # find-supplements.ksyms parses this macro directly out of the spec file:
%supplements_kernel_module() \ %supplements_kernel_module() \

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Nov 7 14:27:32 UTC 2017 - rbrown@suse.com
- Introduce new %_fillupdir macro for fillup-templates location
- Set %_fillupdir macro to /usr/share/fillup-templates
- Change fillup macros to support new %_fillupdir in addition
to old /var/adm/fillup-templates location
-------------------------------------------------------------------
Mon Nov 6 13:53:45 UTC 2017 - mls@suse.de
- Make %post compatibility symlink creation more resiliant
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 6 10:05:10 UTC 2017 - rbrown@suse.com Mon Nov 6 10:05:10 UTC 2017 - rbrown@suse.com

View File

@ -385,7 +385,7 @@ echo -n "%{_target_cpu}-suse-linux-gnueabi" > %{buildroot}/etc/rpm/platform
%{fillup_only -an services} %{fillup_only -an services}
# var/lib/rpm migration: set forwards compatible symlink for /usr/lib/sysimage/rpm so scriptlets in same transaction will still work # var/lib/rpm migration: set forwards compatible symlink for /usr/lib/sysimage/rpm so scriptlets in same transaction will still work
if (test ! -L var/lib/rpm) && (test -f var/lib/rpm/Packages) ; then if test ! -L var/lib/rpm -a -f var/lib/rpm/Packages -a ! -f usr/lib/sysimage/rpm/Packages ; then
rmdir usr/lib/sysimage/rpm rmdir usr/lib/sysimage/rpm
ln -s ../../../var/lib/rpm usr/lib/sysimage/rpm ln -s ../../../var/lib/rpm usr/lib/sysimage/rpm
fi fi