From: Geoffroy Van Cutsem Date: Thu, 8 Aug 2013 10:04:45 +0000 (+0200) Subject: Enhance %post script to handle upgrade vs. first installation gracefully (TIVI-1530) X-Git-Tag: submit/tizen/20130815.013229~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F7848%2F3;p=platform%2Fcore%2Fsystem%2Fsys-assert.git Enhance %post script to handle upgrade vs. first installation gracefully (TIVI-1530) Replace hard-coded path by macros in a %post and %files sections Change-Id: I3b5c00abf3b29cfef13a95aef1a8a4762100fbfc Signed-off-by: Geoffroy Van Cutsem --- diff --git a/packaging/sys-assert.spec b/packaging/sys-assert.spec index a32e246..0737acc 100644 --- a/packaging/sys-assert.spec +++ b/packaging/sys-assert.spec @@ -32,10 +32,12 @@ mkdir -p %{buildroot}/opt/share/crash/info %post -p --Do not run this script inside the build environemt, it will cause issues. if posix.stat("/.build") == nil then - local f = assert(io.open("/etc/ld.so.preload", "a")) - local t = f:write("%{_libdir}/libsys-assert.so") - f:close() - posix.chmod("/etc/ld.so.preload", 644) + if arg[2] == 1 then + local f = assert(io.open("%{_sysconfdir}/ld.so.preload", "a")) + local t = f:write("%{_libdir}/libsys-assert.so") + f:close() + posix.chmod("%{_sysconfdir}/ld.so.preload", 644) + end end @@ -51,6 +53,6 @@ end %license LICENSE.APLv2 %{_bindir}/coredumpctrl.sh /opt/etc/.debugmode -/usr/lib/sysctl.d/sys-assert.conf +%{_libdir}/sysctl.d/sys-assert.conf %{_libdir}/libsys-assert.so