[OE-core] [PATCH] tzdata_2011n: provide pkg_postinst and timezone defaults

Andrea Adami andrea.adami at gmail.com
Sun Jan 15 11:17:45 UTC 2012


On Sat, Jan 14, 2012 at 4:10 PM, Koen Kooi <koen at dominion.thruhere.net> wrote:
>
> Op 14 jan. 2012, om 14:07 heeft Andrea Adami het volgende geschreven:
>
>> * Take the extra bits in do_install from meta-openembedded
>> * and add pkg_postinst script (adapted from Gentoo).
>> * Default to 'Universal' timezone, present in the base package
>> * and allow override using DEFAULT_TIMEZONE variable.
>> * /etc/localtime and /etc/timezone are purposedly not packaged.
>> * Bump PR
>>
>> Signed-off-by: Andrea Adami <andrea.adami at gmail.com>
>> ---
>> meta/recipes-extended/tzdata/tzdata_2011n.bb |   55 +++++++++++++++++++++++++-
>> 1 files changed, 53 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-extended/tzdata/tzdata_2011n.bb b/meta/recipes-extended/tzdata/tzdata_2011n.bb
>> index de9281a..862a196 100644
>> --- a/meta/recipes-extended/tzdata/tzdata_2011n.bb
>> +++ b/meta/recipes-extended/tzdata/tzdata_2011n.bb
>> @@ -5,7 +5,7 @@ LICENSE = "PD"
>> LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234"
>> DEPENDS = "tzcode-native"
>>
>> -PR = "r0"
>> +PR = "r1"
>>
>> RCONFLICTS= "timezones timezone-africa timezone-america timezone-antarctica \
>>              timezone-arctic timezone-asia timezone-atlantic \
>> @@ -19,6 +19,8 @@ SRC_URI[tzdata.sha256sum] = "a343e542486b2b8ebdeca474eed79f1c04f69420ca943c2b9bd
>>
>> S = "${WORKDIR}"
>>
>> +DEFAULT_TIMEZONE ?= "Universal"
>> +
>> TZONES= "africa antarctica asia australasia europe northamerica southamerica  \
>>          factory solar87 solar88 solar89 etcetera backward systemv \
>>         "
>> @@ -41,7 +43,56 @@ do_install () {
>>         # libc is removing zoneinfo files from package
>>         cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
>>         cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
>> -     chown -R root:root ${D}
>> +
>> +        # Install defaults
>> +        install -d ${D}${sysconfdir}
>> +        echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
>> +        cp -pP ${S}/${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
>
> Shouldn't that be an 'ln -sf' instead of a 'cp'?
>
No, I don't think so.First reason is /usr may not be mounted, maybe
living on another device..
See first Google link about this:
http://www.redhat.com/archives/rhl-devel-list/2006-April/msg00017.html
Then, as you see, the postinst takes care of both cases.

Thanks for reviewing

Regards

Andrea


P.S. I have indeed a doubt, about  " # libc is removing zoneinfo files
from package ". This will be a second patch maybe.


>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core




More information about the Openembedded-core mailing list