- Replace post code with lua to be able to not have external deps
This commit is contained in:
parent
51fac843dc
commit
955ac27fbb
60
bash.spec
60
bash.spec
@ -3,7 +3,7 @@
|
|||||||
Version: 4.0
|
Version: 4.0
|
||||||
Name: bash
|
Name: bash
|
||||||
Summary: The GNU Bourne Again shell version %{version}
|
Summary: The GNU Bourne Again shell version %{version}
|
||||||
Release: 0.1.%{?beta_tag}%{?dist}
|
Release: 0.2.%{?beta_tag}%{?dist}
|
||||||
Group: System Environment/Shells
|
Group: System Environment/Shells
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Url: http://www.gnu.org/software/bash
|
Url: http://www.gnu.org/software/bash
|
||||||
@ -179,29 +179,42 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
# ***** bash doesn't use install-info. It's always listed in %{_infodir}/dir
|
# ***** bash doesn't use install-info. It's always listed in %{_infodir}/dir
|
||||||
# to prevent prereq loops
|
# to prevent prereq loops
|
||||||
|
|
||||||
%post
|
# post is in lua so that we can run it without any external deps. Helps
|
||||||
|
# for bootstrapping a new install.
|
||||||
|
# Jesse Keating 2009-01-29 (code from Ignacio Vazquez-Abrams)
|
||||||
|
%post -p lua
|
||||||
|
bashfound = false;
|
||||||
|
shfound = false;
|
||||||
|
|
||||||
HASBASH=""
|
f = io.open("/etc/shells", "r");
|
||||||
HASSH=""
|
if f == nil
|
||||||
|
then
|
||||||
|
f = io.open("/etc/shells", "w");
|
||||||
|
else
|
||||||
|
repeat
|
||||||
|
t = f:read();
|
||||||
|
if t == "/bin/bash"
|
||||||
|
then
|
||||||
|
bashfound = true;
|
||||||
|
end
|
||||||
|
if t == "/bin/sh"
|
||||||
|
then
|
||||||
|
shfound = true;
|
||||||
|
end
|
||||||
|
until t == nil;
|
||||||
|
end
|
||||||
|
f:close()
|
||||||
|
|
||||||
if [ ! -f /etc/shells ]; then
|
f = io.open("/etc/shells", "a");
|
||||||
> /etc/shells
|
if not bashfound
|
||||||
fi
|
then
|
||||||
|
f:write("/bin/bash\n")
|
||||||
(while read line ; do
|
end
|
||||||
if [ "$line" = "/bin/bash" ]; then
|
if not shfound
|
||||||
HASBASH=1
|
then
|
||||||
elif [ "$line" = "/bin/sh" ]; then
|
f:write("/bin/sh\n")
|
||||||
HASSH=1
|
end
|
||||||
fi
|
f:close()
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$HASBASH" ]; then
|
|
||||||
echo "/bin/bash" >> /etc/shells
|
|
||||||
fi
|
|
||||||
if [ -z "$HASSH" ]; then
|
|
||||||
echo "/bin/sh" >> /etc/shells
|
|
||||||
fi) < /etc/shells
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ "$1" = 0 ]; then
|
if [ "$1" = 0 ]; then
|
||||||
@ -229,6 +242,9 @@ fi
|
|||||||
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
|
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 28 2009 Jesse Keating <jkeating@redhat.com> - 4.0-0.2.rc1
|
||||||
|
- Replace post code with lua to be able to not have external deps
|
||||||
|
|
||||||
* Mon Jan 26 2009 Roman Rakus <rrakus@redhat.com> - 4.0-0.1.rc1
|
* Mon Jan 26 2009 Roman Rakus <rrakus@redhat.com> - 4.0-0.1.rc1
|
||||||
- Fixed release tag
|
- Fixed release tag
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user