Bug 1074245

Summary: error in the posttrans scriptlet of package ghostscript-fonts-std
Product: [openSUSE] openSUSE Tumbleweed Reporter: Giacomo Comes <comes>
Component: OtherAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: eich, jengelh, martin.wilck, tchvatal, werner
Version: Current   
Target Milestone: ---   
Hardware: PC   
OS: openSUSE Factory   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Giacomo Comes 2017-12-30 14:41:37 UTC
There is an error message about a command not found when the posttrans scriptlet of package ghostscript-fonts-std is executed.
Ther scriptlet look like this:

posttrans scriptlet (using /bin/sh):

  if [ -e /run/fontpackages/reconfigure-fonts ]; then 
    
  if test -x /usr/sbin/fonts-config ; then 
    LC_ALL=POSIX 
   /usr/sbin/fonts-config --quiet 
  fi 
   
    rm /run/fontpackages/reconfigure-fonts 
  fi 
  if [ -e /run/fontpackages/reconfigure-fonts-cjk ]; then 
    
  if test -x /usr/sbin/acroread-cidfont-config ; then 
     /usr/sbin/acroread-cidfont-config 
  fi 
  if test -x /usr/sbin/ghostscript-cjk-config ; then 
      /usr/sbin/ghostscript-cjk-config 
  fi 
   
    rm /run/fontpackages/reconfigure-fonts-cjk 
  fi 
   -n ghostscript-fonts-std
exit 0

And the line causing the error is the one before exit 0 at the end that should be removed.
Also a proper indentation would not hurt:

posttrans scriptlet (using /bin/sh):

  if [ -e /run/fontpackages/reconfigure-fonts ]; then 
    
    if test -x /usr/sbin/fonts-config ; then 
      LC_ALL=POSIX 
     /usr/sbin/fonts-config --quiet 
    fi 
   
    rm /run/fontpackages/reconfigure-fonts 
  fi 
  if [ -e /run/fontpackages/reconfigure-fonts-cjk ]; then 
    
    if test -x /usr/sbin/acroread-cidfont-config ; then 
      /usr/sbin/acroread-cidfont-config 
    fi 
    if test -x /usr/sbin/ghostscript-cjk-config ; then 
      /usr/sbin/ghostscript-cjk-config 
    fi 
   
    rm /run/fontpackages/reconfigure-fonts-cjk 
  fi 
exit 0
Comment 1 Egbert Eich 2018-01-05 12:58:01 UTC
Background:
In the %posttrans macro in the spec file of ghostscript-fonts-other there appears the '-n ghostscript-fonts-std' argument to the %reconfigure_fonts_postun macro:
 %if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150000
 %reconfigure_fonts_postun -n ghostscript-fonts-std
 %else
 [..]

This macro however doesn't have a -n argument (in fact, it has no arguments at all) - See https://build.opensuse.org/package/view_file/M17N:fonts/fontpackages/rpm-macros.fonts-config?expand=1 :
 %reconfigure_fonts_posttrans \
   if [ -e %{__fontsconfigrunflag} ]; then \
     %reconfigure_fonts \
 [..]
Thus, anything after the macro invocation is simply added after the macro.
Comment 2 Martin Wilck 2018-01-07 11:03:55 UTC
see also bug 1067213
Comment 3 Johannes Meixner 2019-11-28 14:27:17 UTC
see also bug 1074964

*** This bug has been marked as a duplicate of bug 1074964 ***