SPECS: pdksh.spec - more lua - kill R:sed

areq areq at pld-linux.org
Sun Sep 30 19:58:39 CEST 2007


Author: areq                         Date: Sun Sep 30 17:58:39 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- more lua - kill R:sed

---- Files affected:
SPECS:
   pdksh.spec (1.113 -> 1.114) 

---- Diffs:

================================================================
Index: SPECS/pdksh.spec
diff -u SPECS/pdksh.spec:1.113 SPECS/pdksh.spec:1.114
--- SPECS/pdksh.spec:1.113	Sat Sep 29 15:26:57 2007
+++ SPECS/pdksh.spec	Sun Sep 30 19:58:34 2007
@@ -14,7 +14,7 @@
 Summary(uk.UTF-8):	Вілбна реалізація командного процесора Korn shell (ksh)
 Name:		pdksh
 Version:	5.2.14
-Release:	47
+Release:	48
 License:	Mostly Public Domain with Free & GPL additions
 Group:		Applications/Shells
 Source0:	ftp://ftp.cs.mun.ca/pub/pdksh/%{name}-%{version}.tar.gz
@@ -37,7 +37,6 @@
 %{?with_static:BuildRequires:	glibc-static}
 # is needed for /etc directory existence
 Requires(pre):	FHS
-Requires(preun):	sed >= 4.1.5-1.2
 Requires:	setup >= 2.4.6-2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -94,7 +93,6 @@
 Summary:	Statically linked Public Domain Korn Shell
 Summary(pl.UTF-8):	Skonsolidowana statycznie powłoka Korna
 Group:		Applications/Shells
-Requires(preun):	sed >= 4.1.5-1.2
 # requires base for /etc/kshrc?
 Requires:	%{name} = %{version}-%{release}
 
@@ -168,13 +166,20 @@
    end
 end
 
-%preun
-if [ "$1" = "0" ]; then
-	%{__sed} -i -e '
-		/^\/bin\/ksh$/d
-		/^\/bin\/sh$/d
-	' /etc/shells
-fi
+%preun -p <lua>
+if arg[2] == "0" then
+   f = io.open("/etc/shells", "r")
+   if f then
+      s=""
+      for l in f:lines() do
+        if not string.match(l,"^/bin/k?sh$") then
+           s=s..l.."\n"
+        end
+      end
+      f:close()
+      io.open("/etc/shells", "w"):write(s)
+   end
+end
 
 %post static -p <lua>
 t = {}
@@ -187,12 +192,20 @@
    f = io.open("/etc/shells", "a"); f:write("/bin/ksh.static\n"); f:close()
 end
 
-%preun static
-if [ "$1" = "0" ]; then
-	%{__sed} -i -e '
-		/^\/bin\/ksh\.static$/d
-	' /etc/shells
-fi
+%preun static -p <lua>
+if arg[1] == "2" then
+   f = io.open("/etc/shells", "r")
+   if f then
+      s=""
+      for l in f:lines() do
+        if not string.match(l,"^/bin/ksh\.static$") then
+           s=s..l.."\n"
+        end
+      end
+      f:close()
+      io.open("/etc/shells", "w"):write(s)
+   end
+end
 
 %files
 %defattr(644,root,root,755)
@@ -215,6 +228,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.114  2007/09/30 17:58:34  areq
+- more lua - kill R:sed
+
 Revision 1.113  2007/09/29 13:26:57  areq
 - use lua in POSTIN
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/pdksh.spec?r1=1.113&r2=1.114&f=u



More information about the pld-cvs-commit mailing list