[OE-core] [PATCH V3 3/3] bash: add pkg_postrm to remove the entry in /etc/shells

Mark Hatle mark.hatle at windriver.com
Fri Oct 18 15:12:20 UTC 2013


On 10/18/13 9:59 AM, Phil Blundell wrote:
> On Fri, 2013-10-18 at 19:11 +0800, Ming Liu wrote:
>>   pkg_postinst_${PN} () {
>> -	touch $D${sysconfdir}/shells
>> -	grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> $D${sysconfdir}/shells
>> -	grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells
>> +	if [ ! -f $D${sysconfdir}/shells ]; then

One note with the above check.  Whichever package is responsible for providing 
the 'shells' file needs to be installed -first-.  So anything that manipulates 
the 'shells' file will need an RDEPENDS on that package.

--Mark

>> +		touch $D${sysconfdir}/shells
>> +	fi
>> +
>> +	grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
>> +}
>
> This patch contains significant changes to the postinst script which
> aren't described in the commit message.
>
> p.
>
>> +
>> +pkg_postrm_${PN} () {
>> +	if [ -f $D${sysconfdir}/shells ]; then
>> +		printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
>> +
>> +		if [ ! -s $D${sysconfdir}/shells ]; then
>> +			rm $D${sysconfdir}/shells
>> +		fi
>> +	fi
>>   }
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>




More information about the Openembedded-core mailing list