SPECS (AC-branch): glibc.spec - workaround to be able upgrade

Artur Frysiak wiget at pld-linux.org
Wed Dec 29 17:04:53 CET 2004


On Mon, Dec 20, 2004 at 10:28:41AM +0100, Andrzej Krzysztofowicz wrote:
> > 
> > looks like dead end, only way to solve it is dependancy of package
> > containing static binary. 
> 
> This is the reason the "base" packages (like glibc, FHS, setup, etc.) do not
> contain %pre/%post shell scripts.
> The only acceptable script may be a LUA script.
> Or just a static binary program call.

LUA script attached (only example not complet solution)

-- 
Artur Frysiak
http://www.pld-linux.org/
-------------- next part --------------
Index: glibc.spec
===================================================================
RCS file: /cvsroot/SPECS/glibc.spec,v
retrieving revision 1.523.2.13
diff -u -r1.523.2.13 glibc.spec
--- glibc.spec	29 Dec 2004 12:02:54 -0000	1.523.2.13
+++ glibc.spec	29 Dec 2004 15:01:36 -0000
@@ -1038,13 +1038,28 @@
 
 %ifnarch sparc64
 %ifarch amd64
-%post	-n %{name}64 -p /sbin/postshell
+%post	-n %{name}64 -p <lua>
 %else
-%post	-p /sbin/postshell
+%post	-p <lua>
 %endif
-/sbin/glibc-postinst /%{_lib}/%{_host_cpu}
-/sbin/ldconfig /%{_lib} %{_prefix}/%{_lib}
--/sbin/telinit u
+d = posix.stat("/%{_lib}/%{_host_cpu}")
+if d ~= nil and d.type == 'directory' then 
+	os.rename("/%{_lib}/%{_host_cpu}","/%{_lib}/%{_host_cpu}.rpmsave")
+end
+f = posix.fork()
+if f == 0 then
+	posix.exec("/sbin/ldconfig", "/%{_lib}", "%{_prefix}/%{_lib}")
+end
+if f ~= -1 then
+	posix.wait(f)
+end
+f = posix.fork()
+if f == 0 then
+	posix.exec("/sbin/telinit","u")
+end
+if f ~= -1 then
+	posix.wait(f)
+end
 
 %ifarch amd64
 %postun	-n %{name}64 -p /sbin/postshell


More information about the pld-devel-en mailing list