[oe-commits] Angus Ainslie : frameworkd : otimed patch
GIT User account
git at amethyst.openembedded.net
Thu Apr 16 23:11:49 UTC 2009
Module: openembedded.git
Branch: fso/milestone5.5
Commit: e4f800531b524dc4d40f0c07aa8e111acdc157f7
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e4f800531b524dc4d40f0c07aa8e111acdc157f7
Author: Angus Ainslie <nytowl at openmoko.org>
Date: Thu Apr 16 17:08:08 2009 -0600
frameworkd : otimed patch
---
.../frameworkd/om-gta01/otimed.patch | 45 ++++++++++++++++++++
.../frameworkd/om-gta02/otimed.patch | 45 ++++++++++++++++++++
2 files changed, 90 insertions(+), 0 deletions(-)
diff --git a/recipes/freesmartphone/frameworkd/om-gta01/otimed.patch b/recipes/freesmartphone/frameworkd/om-gta01/otimed.patch
new file mode 100644
index 0000000..03979c3
--- /dev/null
+++ b/recipes/freesmartphone/frameworkd/om-gta01/otimed.patch
@@ -0,0 +1,45 @@
+--- git/build/lib/framework/subsystems/otimed/otimed.py.orig 2009-04-16 14:05:32.000000000 -0600
++++ git/build/lib/framework/subsystems/otimed/otimed.py 2009-04-16 14:07:49.000000000 -0600
+@@ -149,12 +149,42 @@
+ None,
+ None
+ )
++ self.bus.add_signal_receiver(
++ self._handleTimeZoneReport,
++ "TimeZoneReport",
++ "org.freesmartphone.GSM.Network",
++ None,
++ None
++ )
+ proxy = bus.get_object( "org.freesmartphone.ogsmd",
+ "/org/freesmartphone/GSM/Server",
+ follow_name_owner_changes=True,
+ introspect=False )
+ self.gsmdata = dbus.Interface( proxy, "org.freesmartphone.GSM.Data", )
+
++ def _handleTimeZoneReport( self, report ):
++ # this can be improved - AA
++ # if we know the country, the offset and if this zone supports daylight savings
++ # the proper timezone can be derived.
++ # so opreferencesd needs to have a <this zone uses daylight savings> flag
++ # and we need a /usr/share/zoneinfo parser
++
++ # CTZV is offset * 4
++ offset = report / 4
++ # offset need to be inverted to get the correct TZ
++ zone = "Etc/GMT"
++ if offset <= 0 :
++ zone += "+" + str( offset * -1 )
++ else :
++ zone += "-" + str( offset )
++ logger.debug( "TimeZoneReport :" + str( report ) + " offset " + str( offset ) + " zone " + zone )
++ if zone != self.zone :
++ try:
++ shutil.copyfile( "/usr/share/zoneinfo/"+zone, "/etc/localtime" )
++ self.zone = zone
++ except:
++ logger.warning( "failed to install time zone file " + zone + " to /etc/localtime" )
++
+ def _handleNetworkStatusChanged( self, status ):
+ if "code" in status:
+ code = str( status["code"] )
diff --git a/recipes/freesmartphone/frameworkd/om-gta02/otimed.patch b/recipes/freesmartphone/frameworkd/om-gta02/otimed.patch
new file mode 100644
index 0000000..6897d59
--- /dev/null
+++ b/recipes/freesmartphone/frameworkd/om-gta02/otimed.patch
@@ -0,0 +1,45 @@
+--- git/framework/subsystems/otimed/otimed.py.orig 2009-04-16 14:05:32.000000000 -0600
++++ git/framework/subsystems/otimed/otimed.py 2009-04-16 14:07:49.000000000 -0600
+@@ -149,12 +149,42 @@
+ None,
+ None
+ )
++ self.bus.add_signal_receiver(
++ self._handleTimeZoneReport,
++ "TimeZoneReport",
++ "org.freesmartphone.GSM.Network",
++ None,
++ None
++ )
+ proxy = bus.get_object( "org.freesmartphone.ogsmd",
+ "/org/freesmartphone/GSM/Server",
+ follow_name_owner_changes=True,
+ introspect=False )
+ self.gsmdata = dbus.Interface( proxy, "org.freesmartphone.GSM.Data", )
+
++ def _handleTimeZoneReport( self, report ):
++ # this can be improved - AA
++ # if we know the country, the offset and if this zone supports daylight savings
++ # the proper timezone can be derived.
++ # so opreferencesd needs to have a <this zone uses daylight savings> flag
++ # and we need a /usr/share/zoneinfo parser
++
++ # CTZV is offset * 4
++ offset = report / 4
++ # offset need to be inverted to get the correct TZ
++ zone = "Etc/GMT"
++ if offset <= 0 :
++ zone += "+" + str( offset * -1 )
++ else :
++ zone += "-" + str( offset )
++ logger.debug( "TimeZoneReport :" + str( report ) + " offset " + str( offset ) + " zone " + zone )
++ if zone != self.zone :
++ try:
++ shutil.copyfile( "/usr/share/zoneinfo/"+zone, "/etc/localtime" )
++ self.zone = zone
++ except:
++ logger.warning( "failed to install time zone file " + zone + " to /etc/localtime" )
++
+ def _handleNetworkStatusChanged( self, status ):
+ if "code" in status:
+ code = str( status["code"] )
diff --git a/recipes/freesmartphone/frameworkd/otimed.patch b/recipes/freesmartphone/frameworkd/otimed.patch
new file mode 100644
index 0000000..e69de29
More information about the Openembedded-commits
mailing list