[Bug 207912] New: Avoid running SuSEconfig.fonts twice in the package upgrade case
https://bugzilla.novell.com/show_bug.cgi?id=207912 Summary: Avoid running SuSEconfig.fonts twice in the package upgrade case Product: openSUSE 10.2 Version: Alpha 4 plus Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: P5 - None Component: X11 Applications AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: andreas.hanke@gmx-topmail.de QAContact: sndirsch@novell.com Font-related packages are running SuSEconfig.fonts in both the %post and %postun scriptlets. During initial installation of a package, the workflow is: - Execute %pre of new package - Unpack files from the new package - Execute %post of new package (=SuSEconfig.fonts) => SuSEconfig.fonts is executed once. During final removal of a package, the workflow is: - Execute %preun of old package - Remove files from the old package - Execute %postun of old package (=SuSEconfig.fonts) => SuSEconfig.fonts is executed once. But in the upgrade case, the workflow is: - Execute %pre of new package - Unpack files from the new package - Execute %post of new package (=SuSEconfig.fonts) - Execute %preun of old package - Remove files from the old package - Execute %postun of old package (=SuSEconfig.fonts) => SuSEconfig.fonts is executed twice, but only the second run is necessary. The first run can be optimized away by enclosing it into a condition: %post # This condition is fulfilled during initial installation, # but not during an upgrade if [ "$1" -eq "1" ] ; then %run_suseconfig_fonts fi And %postun remains unmodified: %postun %run_suseconfig_fonts Of course the condition can just as well be embedded into the definition of the %run_suseconfig_fonts macro in order to avoid editing all .spec files. Btw. the %run_suseconfig_fonts macro definition still references SuSEconfig.pango, but this does not exist any more (minor issue, doesn't cause any problems). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=207912 ------- Comment #1 from andreas.hanke@gmx-topmail.de 2006-09-24 17:49 MST ------- Forgot to mention that [ "$1" -eq "1" ] cannot be used within the %run_suseconfig_fonts definition because it would break %postun. But the following should always work for both %post and %postun: if [ ! "$1" -eq "2" ] ; then # ...code... fi Alternative approach, works for both %post and %postun as well: if [ "$1" -eq "1" -o "$1" -eq "0" ] ; then # ...code... fi -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=207912 meissner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |mfabian@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=207912 mfabian@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=207912 ------- Comment #2 from andreas.hanke@gmx-topmail.de 2006-09-25 13:07 MST ------- The idea isn't as great as I thought: This approach would run the script from the old package and omit the one from the new package during an upgrade. They are not necessarily identical => Problem, because every change in the script becomes effective during the second upgrade only. The script from the old package is being run after the one from the new package in any case, but with this approach, the new one would not be run at all. Maybe someone has a better idea, feel free to close this report otherwise. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=207912 mfabian@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |coolo@novell.com Status|ASSIGNED |RESOLVED Resolution| |WONTFIX ------- Comment #3 from mfabian@novell.com 2007-01-18 10:09 MST ------- I don't have a better idea either. Closing as WONTFIX. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com