Patchwork [v3,1/2] tzdata: We shouldn't override the localtime if it is valid

login
register
mail settings
Submitter Otavio Salvador
Date Feb. 8, 2013, 2:52 p.m.
Message ID <1360335140-8690-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/44341/
State New
Headers show

Comments

Otavio Salvador - Feb. 8, 2013, 2:52 p.m.
The code where mistakenly replacing the localtime file setting so we
end with a copy of file instead of a symbolic link. This fixes it so
now, we'll only do that in case the link is pointing to invalid data.

Change-Id: I16dfa5ea4f293c48bb396f4e23a2ea53e6c9e745
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-extended/tzdata/tzdata_2012d.bb |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
Andrea Adami - Feb. 8, 2013, 10:55 p.m.
On Fri, Feb 8, 2013 at 3:52 PM, Otavio Salvador <otavio@ossystems.com.br> wrote:
> The code where mistakenly replacing the localtime file setting so we
> end with a copy of file instead of a symbolic link. This fixes it so
> now, we'll only do that in case the link is pointing to invalid data.
>

Hi,

there was the same discussion when I first proposed the Gentoo script:
it wasn't a mistake. it's the old issue /usr not mounted at boot.

See thread: http://lists.linuxtogo.org/pipermail/openembedded-core/2012-January/016237.html

Cheers

Andrea


> Change-Id: I16dfa5ea4f293c48bb396f4e23a2ea53e6c9e745
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/recipes-extended/tzdata/tzdata_2012d.bb |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/meta/recipes-extended/tzdata/tzdata_2012d.bb b/meta/recipes-extended/tzdata/tzdata_2012d.bb
> index 9741101..9ec6715 100644
> --- a/meta/recipes-extended/tzdata/tzdata_2012d.bb
> +++ b/meta/recipes-extended/tzdata/tzdata_2012d.bb
> @@ -5,7 +5,7 @@ LICENSE = "PD"
>  LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234"
>  DEPENDS = "tzcode-native"
>
> -PR = "r2"
> +PR = "r3"
>
>  inherit allarch
>
> @@ -93,12 +93,12 @@ pkg_postinst_${PN} () {
>                 echo "You have an invalid TIMEZONE setting in ${src}"
>                 echo "Your ${etc_lt} has been reset to Universal; enjoy!"
>                 tz="Universal"
> +               echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
> +               if [ -L ${etc_lt} ] ; then
> +                       rm -f "${etc_lt}"
> +               fi
> +               cp -f "$D${datadir}/zoneinfo/${tz}" "${etc_lt}"
>         fi
> -       echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
> -       if [ -L ${etc_lt} ] ; then
> -               rm -f "${etc_lt}"
> -       fi
> -       cp -f "$D${datadir}/zoneinfo/${tz}" "${etc_lt}"
>  }
>
>  # Packages primarily organized by directory with a major city
> --
> 1.7.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Otavio Salvador - Feb. 9, 2013, 2:19 a.m.
On Fri, Feb 8, 2013 at 8:55 PM, Andrea Adami <andrea.adami@gmail.com> wrote:
> On Fri, Feb 8, 2013 at 3:52 PM, Otavio Salvador <otavio@ossystems.com.br> wrote:
>> The code where mistakenly replacing the localtime file setting so we
>> end with a copy of file instead of a symbolic link. This fixes it so
>> now, we'll only do that in case the link is pointing to invalid data.
>>
>
> Hi,
>
> there was the same discussion when I first proposed the Gentoo script:
> it wasn't a mistake. it's the old issue /usr not mounted at boot.
>
> See thread: http://lists.linuxtogo.org/pipermail/openembedded-core/2012-January/016237.html

As far as I know we stopped to worry about /usr not mounted at boot.
In either case the symbolic link is how it is managed in most
distributions and expected by many softwares available so I think we
ought to follow the standard here.

Patch

diff --git a/meta/recipes-extended/tzdata/tzdata_2012d.bb b/meta/recipes-extended/tzdata/tzdata_2012d.bb
index 9741101..9ec6715 100644
--- a/meta/recipes-extended/tzdata/tzdata_2012d.bb
+++ b/meta/recipes-extended/tzdata/tzdata_2012d.bb
@@ -5,7 +5,7 @@  LICENSE = "PD"
 LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234"
 DEPENDS = "tzcode-native"
 
-PR = "r2"
+PR = "r3"
 
 inherit allarch
 
@@ -93,12 +93,12 @@  pkg_postinst_${PN} () {
 		echo "You have an invalid TIMEZONE setting in ${src}"
 		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
 		tz="Universal"
+		echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
+		if [ -L ${etc_lt} ] ; then
+			rm -f "${etc_lt}"
+		fi
+		cp -f "$D${datadir}/zoneinfo/${tz}" "${etc_lt}"
 	fi
-	echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
-	if [ -L ${etc_lt} ] ; then
-		rm -f "${etc_lt}"
-	fi
-	cp -f "$D${datadir}/zoneinfo/${tz}" "${etc_lt}"
 }
 
 # Packages primarily organized by directory with a major city