Bug 740611

Summary: Simplified lua postinstall scriplet for spec file
Product: [Fedora] Fedora Reporter: Sergey Romanov <bugzilla.sero>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: maxamillion, rrakus, tsmetana, valdis.kletnieks
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-10 14:31:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
simplified postinstall scriplet for spec file none

Description Sergey Romanov 2011-09-22 16:21:30 UTC
Created attachment 524450 [details]
simplified postinstall scriplet for spec file

I somewhat simplified the %post scriplet for bash package. Would you please consider to apply the attached patch?

It makes no provisions for /etc/shells not ending with newline character, but neither does the scriplet presently in spec file, nor do %post scriplets from other shell packages.

The stance such scriplets usually use is something like
shell=/path/to/shell
shells=/etc/shells
grep -qs ^$shell$ $shells||echo $shell>>$shells

Anyway, the check for the newline at last line of file is trivial to add in lua. Tell if you need that and I'll update the patch.

Comment 1 Roman Rakus 2011-11-07 16:24:27 UTC
Thanks for the patch. I've applied it in bash-4.2.10-6.fc17

Comment 2 Valdis Kletnieks 2011-11-09 21:36:57 UTC
After upgrading to the latest bash rpm in rawhide yesterday, my /etc/shells ended up with just this in it, looks like the RPM script is eating it:

/sbin/nologin
/bin/tcsh
/bin/csh

Seems to be a problem with both F16 and Rawhide bash RPMs.

# cat /etc/shells
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/bash
# rpm -Uvh --force ./bash-4.2.10-4.fc16.x86_64.rpm 
warning: ./bash-4.2.10-4.fc16.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID a82ba4b7: NOKEY
Preparing...                ########################################### [100%]
   1:bash                   ########################################### [100%]
# cat /etc/shells
/sbin/nologin
/bin/tcsh
/bin/csh
# echo /bin/bash >> /etc/shells
# rpm -Uvh bash-4.2.10-6.fc17.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:bash                   ########################################### [100%]
# cat /etc/shells
/sbin/nologin
/bin/tcsh
/bin/csh
# echo /bin/bash >> /etc/shells

Comment 3 Roman Rakus 2011-11-10 12:54:47 UTC
Valdis thanks for the quick info. It's a problem Sergey mentioned - new line at last line.
/me has to learn lua a bit more.

Comment 4 Roman Rakus 2011-11-10 14:22:36 UTC
ok, the problem is elsewhere. rpm calls post script first and then postun

Comment 5 Roman Rakus 2011-11-10 14:28:52 UTC
I will create new bug for this issue.

Comment 6 Roman Rakus 2011-11-10 14:31:52 UTC
See bug #752827