erase /bin/bash and /bin/sh in postun only if we are uninstalling (#752827)
Signed-off-by: Roman Rakus <rrakus@redhat.com>
This commit is contained in:
parent
1efb46ce7e
commit
41cf2beca6
23
bash.spec
23
bash.spec
@ -6,7 +6,7 @@
|
|||||||
Version: %{baseversion}%{patchleveltag}
|
Version: %{baseversion}%{patchleveltag}
|
||||||
Name: bash
|
Name: bash
|
||||||
Summary: The GNU Bourne Again shell
|
Summary: The GNU Bourne Again shell
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
Group: System Environment/Shells
|
Group: System Environment/Shells
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Url: http://www.gnu.org/software/bash
|
Url: http://www.gnu.org/software/bash
|
||||||
@ -262,19 +262,23 @@ if f then
|
|||||||
end
|
end
|
||||||
|
|
||||||
%postun -p <lua>
|
%postun -p <lua>
|
||||||
t={}
|
-- Run it only if we are uninstalling
|
||||||
for line in io.lines("/etc/shells")
|
if arg[2] == "0"
|
||||||
do
|
then
|
||||||
|
t={}
|
||||||
|
for line in io.lines("/etc/shells")
|
||||||
|
do
|
||||||
if line ~= "/bin/bash" and line ~= "/bin/sh"
|
if line ~= "/bin/bash" and line ~= "/bin/sh"
|
||||||
then
|
then
|
||||||
table.insert(t,line)
|
table.insert(t,line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
f = io.open("/etc/shells", "w+")
|
f = io.open("/etc/shells", "w+")
|
||||||
for n,line in pairs(t)
|
for n,line in pairs(t)
|
||||||
do
|
do
|
||||||
f:write(line.."\n")
|
f:write(line.."\n")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
@ -296,6 +300,9 @@ end
|
|||||||
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
|
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Nov 10 2011 Roman Rakus <rrakus@redhat.com> - 4.2.10-7
|
||||||
|
- erase /bin/bash and /bin/sh in postun only if we are uninstalling (#752827)
|
||||||
|
|
||||||
* Mon Nov 07 2011 Roman Rakus <rrakus@redhat.com> - 4.2.10-6
|
* Mon Nov 07 2011 Roman Rakus <rrakus@redhat.com> - 4.2.10-6
|
||||||
- Simplified lua post script (#740611)
|
- Simplified lua post script (#740611)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user