Bug 740611 - Simplified lua postinstall scriplet for spec file
Summary: Simplified lua postinstall scriplet for spec file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Roman Rakus
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-22 16:21 UTC by Sergey Romanov
Modified: 2014-01-13 00:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-10 14:31:52 UTC


Attachments (Terms of Use)
simplified postinstall scriplet for spec file (1.34 KB, patch)
2011-09-22 16:21 UTC, Sergey Romanov
no flags Details | Diff

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


Note You need to log in before you can comment on or make changes to this bug.