--- gdesklets-0.35.2.orig/debian/control +++ gdesklets-0.35.2/debian/control @@ -0,0 +1,24 @@ +Source: gdesklets +Section: gnome +Priority: optional +Maintainer: Clément Stenac +Uploaders: Debian GNOME Maintainers , Akira TAGOH , Andreas Rottmann , Andrew Lau , Carlos Perelló Marín , Clément Stenac , Ed Boraas , Edd Dumbill , Emil Soleyman-Zomalan , Guilherme de S. Pastore , Gustavo Noronha Silva , J.H.M. Dassen (Ray) , Joe Drew , Johannes Rohr , Jordi Mallach , Jose Carlos Garcia Sogo , Josselin Mouette , Loic Minier , Marc 'HE' Brockschmidt , Ondřej Surý , Rob Bradford , Robert McQueen , Ross Burton , Sebastien Bacher , Sjoerd Simons , Takuo KITAME +Build-Depends: cdbs, debhelper (>> 4.1.65), python-dev, python-gnome2-dev, python-gtk2-dev, python-pyorbit-dev, libglib2.0-dev (>= 2.4.1-2), pkg-config, swig, libgtk2.0-dev (>= 2.4.1-3), libgnomevfs2-dev (>= 2.8.4), libgtop2-dev (>= 2.6.0-4), gnome-pkg-tools, libgnomeui-dev (>= 2.6.1.1-2), libxml-parser-perl, librsvg2-dev +Standards-Version: 3.6.2.0 + +Package: gdesklets +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-gnome2 (>= 2.0), python-gtk2 (>= 2.0), python-numeric (>= 23.0-7), python, python-xml +Recommends: gdesklets-data +Replaces: gdesklets-data (<< 0.21) +Conflicts: gdesklets-data (<< 0.21) +Description: Architecture for desktop applets + gDesklets is an architecture for "desklets", which are tiny applets + sitting on your desktop in a symbiotic relationship of eye candy and + usefulness. + . + You can populate your desktop with status meters, icon bars, + weather sensors, news tickers... whatever you can imagine... + Virtually anything is possible and may even be available some day. + . + This package only provides the gdesklets base, no applets. --- gdesklets-0.35.2.orig/debian/dirs +++ gdesklets-0.35.2/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/gdesklets --- gdesklets-0.35.2.orig/debian/compat +++ gdesklets-0.35.2/debian/compat @@ -0,0 +1 @@ +4 --- gdesklets-0.35.2.orig/debian/postinst +++ gdesklets-0.35.2/debian/postinst @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +SCHEMAS_FILES="gdesklets-display-thumbnail.schemas" + +case "$1" in + configure) + for FILES in $SCHEMAS_FILES; do + if [ -e /etc/gconf/schemas/$FILES ]; then + HOME=/root GCONF_CONFIG_SOURCE=xml::/etc/gconf/gconf.xml.defaults \ + gconftool-2 \ + --makefile-install-rule /etc/gconf/schemas/$FILES > /dev/null + fi + done + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + --- gdesklets-0.35.2.orig/debian/menu +++ gdesklets-0.35.2/debian/menu @@ -0,0 +1,4 @@ +?package(gdesklets): title="gdesklets" \ + section="Apps/Tools" needs="x11" \ + icon="/usr/share/pixmaps/gdesklets.png" \ + command="/usr/bin/gdesklets" --- gdesklets-0.35.2.orig/debian/migration-tool +++ gdesklets-0.35.2/debian/migration-tool @@ -0,0 +1,152 @@ +#!/usr/bin/env python + +import gtk, gconf +import os, re, sys + +from utils.HIGDialog import HIGDialog + +class MigrationTool: + + # Displays the main window... + def __init__(self): + + m = "This tool will safely migrate your settings from old versions of " + m += "gDesklets (0.26.x series), so that they will work with versions " + m += "0.30 onwards." + + dialog = HIGDialog(gtk.STOCK_DIALOG_INFO, + "gDesklets Config Migration Tool", m, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, + gtk.STOCK_OK, gtk.RESPONSE_OK)) + self.__config_path = "/apps/gdesklets" + self.__gdesklets_path = os.path.join(os.getenv("HOME"), ".gdesklets") + + dialog.connect("response", self.__response) + + # check if ~/.gdesklets exists + if (not os.path.exists(self.__gdesklets_path)): + print ("You don't have a working version of gDesklets!\nExiting!") + sys.exit(1) + + dialog.show() + + + def __response(self, dialog, response): + + if (response == gtk.RESPONSE_OK): + dialog.hide() + self.__show_warning(dialog) + elif (response == gtk.RESPONSE_YES): + dialog.hide() + self.__migrate(dialog) + else: gtk.main_quit() + + + def __show_warning(self, widget): + + m = "This will overwrite any existing 0.30 settings!\n" + m += "Do you wish to continue?" + + dialog = HIGDialog(gtk.STOCK_DIALOG_QUESTION, "Warning!", m, + (gtk.STOCK_NO, gtk.RESPONSE_NO, + gtk.STOCK_YES, gtk.RESPONSE_YES)) + dialog.connect("response", self.__response) + dialog.show() + + + def __show_finished(self, dialog): + + dialog = HIGDialog(gtk.STOCK_DIALOG_INFO, "Migration successful!", + "Settings have been migrated succesfully", + (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) + dialog.connect("response", self.__response) + dialog.show() + + + def __show_noconfig(self, dialog): + + m = "I could find no settings to migrate in the default profile!\n\n" + m += "You probably have never configured or run gdesklets 0.26.x and " + m += "so don't need to run this tool at all." + + dialog = HIGDialog(gtk.STOCK_ERROR, "Nothing To Do!", m, + (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) + dialog.connect("response", self.__response) + dialog.show() + + + def __migrate(self, dialog): + + # we assume they have a config to start with + noconfig = False; + + # set up gconf client + self.__client = gconf.client_get_default() + self.__client.add_dir(self.__config_path, gconf.CLIENT_PRELOAD_RECURSIVE) + + # open the new output files + d_cfile = open(self.__gdesklets_path + "/displays", "w") + p_cfile = open(self.__gdesklets_path + "/positions", "w") + + # get the current default profile + p = self.__client.get(self.__config_path + "/profile") + if (p): + d_cfile.write(p.get_string() +"\n") + + # for each profile in /apps/gdesklets/profiles/, write display info to + # the "displays" file + # also for each id encountered, write real-x and real-y to the + # "positions" file + profiles = self.__client.all_dirs(self.__config_path + "/profiles") + + for p in profiles: + + profile_name = p[len(self.__config_path + "/profiles/"):] + + display_list = (self.__client.get(p + "/main/displays")).get_string() + displays = display_list.split(",") + + for d in displays: + + d_info = d.split("::") + + if (d_info[0] != ""): + x_pos = (self.__client.get(p + "/" + d_info[0] + + "_default_/real-x")).get_string() + y_pos = (self.__client.get(p + "/" + d_info[0] + + "_default_/real-y")).get_string() + + # write the data that was in gconf to the new config files + d_cfile.write("id" + d_info[0] + " " + d_info[1] + " " + + profile_name +"\n") + p_cfile.write("id" + d_info[0] + " " + x_pos + " " + + y_pos +"\n") + + # check if settings exist for this display -- if so, they + # have to be moved in gconf + plist = " ".join(self.__client.all_dirs(p)) + pattern = re.compile(d_info[0]+'[A-Za-z]+') + + for match in (pattern.findall(plist)): + # copy all the entries to new location + entries = self.__client.all_entries(p + "/" + match) + for entry in entries: + key = entry.get_key() + nkey = self.__config_path + "/id" + match + "/" + \ + key[len(p +"/" + match) + 1:] + self.__client.set(nkey, entry.get_value()) + else: + if (profile_name == "default"): noconfig = True + + # we are done... + if (noconfig == False): + self.__show_finished(dialog) + else: + self.__show_noconfig(dialog) + + + +if __name__ == "__main__": + + MigrationTool() + gtk.main() --- gdesklets-0.35.2.orig/debian/control.in +++ gdesklets-0.35.2/debian/control.in @@ -0,0 +1,24 @@ +Source: gdesklets +Section: gnome +Priority: optional +Maintainer: Clément Stenac +Uploaders: @GNOME_TEAM@ +Build-Depends: cdbs, debhelper (>> 4.1.65), python-dev, python-gnome2-dev, python-gtk2-dev, python-pyorbit-dev, libglib2.0-dev (>= 2.4.1-2), pkg-config, swig, libgtk2.0-dev (>= 2.4.1-3), libgnomevfs2-dev (>= 2.8.4), libgtop2-dev (>= 2.6.0-4), gnome-pkg-tools, libgnomeui-dev (>= 2.6.1.1-2), libxml-parser-perl, librsvg2-dev +Standards-Version: 3.6.2.0 + +Package: gdesklets +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-gnome2 (>= 2.0), python-gtk2 (>= 2.0), python-numeric (>= 23.0-7), python, python-xml +Recommends: gdesklets-data +Replaces: gdesklets-data (<< 0.21) +Conflicts: gdesklets-data (<< 0.21) +Description: Architecture for desktop applets + gDesklets is an architecture for "desklets", which are tiny applets + sitting on your desktop in a symbiotic relationship of eye candy and + usefulness. + . + You can populate your desktop with status meters, icon bars, + weather sensors, news tickers... whatever you can imagine... + Virtually anything is possible and may even be available some day. + . + This package only provides the gdesklets base, no applets. --- gdesklets-0.35.2.orig/debian/watch +++ gdesklets-0.35.2/debian/watch @@ -0,0 +1,4 @@ +version=2 +http://www.pycage.de/software_gdesklets.html \ + download/gdesklets/gDesklets-([\d]\.[\d.]*).tar.bz2 \ + debian uupdate --- gdesklets-0.35.2.orig/debian/changelog +++ gdesklets-0.35.2/debian/changelog @@ -0,0 +1,293 @@ +gdesklets (0.35.2-4) unstable; urgency=low + + * Work-around crash in gdesklets-daemon (Closes:#339698,#339718) + + -- Clément Stenac Sun, 20 Nov 2005 14:14:35 -0200 + +gdesklets (0.35.2-3) unstable; urgency=low + + * Fix dependencies on GNOME libs (Closes:#338396) + + -- Clément Stenac Fri, 10 Nov 2005 14:14:35 -0200 + +gdesklets (0.35.2-2) unstable; urgency=low + + * debian/control.in: + - Build-Depends on python-pyorbit-dev instead of python-pyorbit, + which has been split. (Closes:#338029) + + -- Gustavo Noronha Silva Wed, 9 Oct 2005 14:14:35 -0200 + +gdesklets (0.35.2-1) unstable; urgency=low + + * Clément Stenac: + * New upstream version + * Bump standards version to 3.6.2 + * Add explicit python dependency to make Lintian happier + * Use relative symbolic link for /usr/bin/gdesklets + * Add dependency on python-xml to avoid problem with expat + + -- Clément Stenac Sun, 24 Jul 2005 11:15:34 +0200 + +gdesklets (0.35.1-1) unstable; urgency=low + + * New upstream version (Closes: #301350). + * Rebuilt with the new libgtop (Closes: #313419). + + -- Sebastien Bacher Thu, 30 Jun 2005 23:47:34 +0200 + +gdesklets (0.33.1-2) unstable; urgency=low + + * Rebuilt for the libhowl transition (Closes: #298846). + * debian/control.in: + - updated the gnome-vfs requirements. + + -- Sebastien Bacher Thu, 10 Mar 2005 19:29:31 +0100 + +gdesklets (0.33.1-1) unstable; urgency=low + + * This version will probably break some very old desklets, + which used API which had been marked as deprecated for half a year. + * New upstream release: + - SVG scripting capabilities and lots of other improvements in . + - added menu option "View Source" for viewing the source of a display. + - removed deprecated part of libdesklets API. + + -- Sebastien Bacher Mon, 10 Jan 2005 15:03:02 +0100 + +gdesklets (0.32-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Wed, 22 Dec 2004 21:55:28 +0100 + +gdesklets (0.31.1-2) unstable; urgency=low + + * gdesklets: changed the option handling, should fix the session management + (Closes: #282908). + + -- Sebastien Bacher Thu, 25 Nov 2004 18:44:20 +0100 + +gdesklets (0.31.1-1) unstable; urgency=low + + * New upstream release: + - the graphical shell can deinstall .display files now. + - colors in the logfile viewer make it easier to spot errors and warnings. + - performance improvements. + + -- Sebastien Bacher Wed, 3 Nov 2004 17:58:38 +0100 + +gdesklets (0.30-1) experimental; urgency=low + + * NOTE: the configuration format has totally changed in the this + new version so you will get an empty configuration after the update. + You can migrate your configuration by running this tool: + /usr/share/gdesklets/migration-tool. + * New upstream release (Closes: #267993): + - a graphical shell for installing and managing desklets (Closes: #268222). + - the tray icon features a popup menu. + - the daemon writes a logfile now and is started automatically when needed. + - controls replace the less flexible sensor concept. Sensors are deprecated. + - increased performance. + * debian/control.in: + - Build-Depends on librsvg2-dev. + + -- Sebastien Bacher Wed, 30 Jun 2004 12:18:20 +0200 + +gdesklets (0.26.2-5) unstable; urgency=low + + * debian/control.in: + + updated Build-Depends on libgtop2-dev (Closes: #251721). + + -- Sebastien Bacher Sun, 30 May 2004 17:54:08 +0000 + +gdesklets (0.26.2-4) unstable; urgency=low + + * debian/control.in: + + depends on libgtop2-2. + + -- Sebastien Bacher Sat, 29 May 2004 22:29:15 +0000 + +gdesklets (0.26.2-3) unstable; urgency=low + + * Rebuilt for new libgtop2 in unstable. + * Included menu entry from Julien Louis + (Closes: #246864). + * debian/control: + + removed Depends on gnome-utils (Closes: #249128). + + -- Sebastien Bacher Wed, 26 May 2004 08:32:41 +0200 + +gdesklets (0.26.2-2) experimental; urgency=low + + * Built for experimental. + + -- Sebastien Bacher Fri, 30 Apr 2004 23:37:48 +0200 + +gdesklets (0.26.2-1) unstable; urgency=low + + * New upstream release. + + fixes the positioning bug for anchored windows (Closes: #241375). + + -- Sebastien Bacher Fri, 30 Apr 2004 21:42:14 +0200 + +gdesklets (0.26.1-4) experimental; urgency=low + + * Rebuilt with libgtop2-2 package. + + -- Sebastien Bacher Tue, 30 Mar 2004 19:47:16 +0200 + +gdesklets (0.26.1-3) experimental; urgency=low + + * Rebuilt with experimental libgtop2. + * Switched to CDBS. + * debian/patches/01_python-interpreter.patch: + + patch to fix python interpreter (Closes: #234876). + + -- Sebastien Bacher Sun, 28 Mar 2004 14:53:54 +0200 + +gdesklets (0.26.1-2) unstable; urgency=low + + * Added Build-Depends on libxml-parser-perl (Closes: #238401). + + -- Sebastien Bacher Wed, 17 Mar 2004 00:31:32 +0100 + +gdesklets (0.26.1-1) unstable; urgency=low + + * New upstream release + + the tray icon is now disabled by default (Closes: #234829). + + -- Sebastien Bacher Tue, 16 Mar 2004 21:00:22 +0100 + +gdesklets (0.26-1) unstable; urgency=low + + * New upstream release + + fix session management (Closes: #229412). + + fix copyright symbol (Closes: #230776). + + should remember the positions after a move using WM (Closes: 228955). + * Changed Build-Depends from swig1.3 to swig. + * Added Build-Depends on libgnomeui-dev. + + -- Sebastien Bacher Sun, 22 Feb 2004 14:50:58 +0100 + +gdesklets (0.25.1-1) unstable; urgency=low + + * New upstream release + + survive ill-behaving sensors (Closes: #225118). + + -- Sebastien Bacher Tue, 30 Dec 2003 20:58:00 +0100 + +gdesklets (0.25-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Thu, 25 Dec 2003 15:56:55 +0100 + +gdesklets (0.24.1-1) unstable; urgency=low + + * New upstream release. + * debian/control: + + adapted for the GNOME Team. + + updated Build-Depends. + * debian/rules: + + adapted for the GNOME Team. + + -- Sebastien Bacher Sun, 9 Nov 2003 12:25:20 +0100 + +gdesklets (0.23-3) unstable; urgency=low + + * Added schemas registration (Closes: #218142). + + -- Sebastien Bacher Fri, 31 Oct 2003 20:45:34 +0100 + +gdesklets (0.23-2) unstable; urgency=low + + * Use Display.py from the CVS to fix a bug on the right click with + some window managers. + + -- Sebastien Bacher Tue, 28 Oct 2003 21:30:02 +0100 + +gdesklets (0.23-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Fri, 17 Oct 2003 18:29:00 +0200 + +gdesklets (0.22.1-1) unstable; urgency=low + + * New upstream release. + + Fixed bug about abs path (Closes: #212337). + + Remove gdesklets-core.pc Removed dependencies (Closes: #208621). + + -- Sebastien Bacher Sun, 28 Sep 2003 19:04:48 +0200 + +gdesklets (0.22-1) unstable; urgency=low + + * New upstream release + + Fixed session management (Closes: #211197). + + Supports Drag 'n Drop. + + -- Sebastien Bacher Mon, 22 Sep 2003 14:32:59 +0200 + +gdesklets (0.21.2-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Fri, 12 Sep 2003 18:24:15 +0200 + +gdesklets (0.21.1-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Thu, 11 Sep 2003 17:49:41 +0200 + +gdesklets (0.21-1) unstable; urgency=low + + * New upstream release. + + desklets are not raised by mouse anymore (Closes: #210269). + + no popup on gnome-session exit (Closes: #208565). + + removed from alt+tab list (Closes: #208971). + * Updated dependencies. + + -- Sebastien Bacher Wed, 10 Sep 2003 14:37:19 +0200 + +gdesklets (0.20-2) unstable; urgency=low + + * Switched Build-Depend from python-gnome2 to python-gnome2-dev. + * Updated french translation. + + -- Sebastien Bacher Tue, 2 Sep 2003 00:52:31 +0200 + +gdesklets (0.20-1) unstable; urgency=low + + * New upstream release. + * Added pack_sensor to the package. + * Updated Build-Depends and Depends. + + -- Sebastien Bacher Sun, 31 Aug 2003 15:02:41 +0200 + +gdesklets (0.13-1) unstable; urgency=low + + * New upstream release. + * Updated Standards-Version to 3.6.1.0. + + -- Sebastien Bacher Sun, 24 Aug 2003 18:22:03 +0200 + +gdesklets (0.12.1-1) unstable; urgency=low + + * New upstream release. + * Added some missing Build-Depends. + + -- Sebastien Bacher Mon, 18 Aug 2003 16:59:54 +0200 + +gdesklets (0.12-1) unstable; urgency=low + + * New upstream release. + + -- Sebastien Bacher Sun, 17 Aug 2003 23:16:15 +0200 + +gdesklets (0.11-1) unstable; urgency=low + + * Initial Release (Closes: #204961). + + -- Sebastien Bacher Tue, 12 Aug 2003 17:08:57 +0200 --- gdesklets-0.35.2.orig/debian/copyright +++ gdesklets-0.35.2/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by Sebastien Bacher on +Mon, 11 Aug 2003 23:50:03 +0200. + +It was downloaded from http://www.pycage.de/software_gdesklets.html + +Upstream Authors: Martin Grimme + Christian Meyer + Jesse Andrews + +Copyright: + +You are free to redistribute this software under the terms of the GNU +General Public License. +On Debian systems, the complete text of the GNU General Public License can +be found at /usr/share/common-licenses/GPL. --- gdesklets-0.35.2.orig/debian/docs +++ gdesklets-0.35.2/debian/docs @@ -0,0 +1,2 @@ +README +TODO --- gdesklets-0.35.2.orig/debian/rules +++ gdesklets-0.35.2/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f +# -*- mode: makefile; coding: utf-8 -*- + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/class/gnome.mk + +include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk + +common-post-build-arch:: + cd utils && make clean && make CFLAGS+=-O1 + +binary-post-install/gdesklets:: + install -m 755 debian/pack_sensor.py debian/gdesklets/usr/share/gdesklets/ + rm -f debian/gdesklets/usr/bin/gdesklets + rm -f debian/gdesklets/usr/share/gdesklets/data/gdesklets.png + -rm -f debian/gdesklets/usr/share/mime/globs + -rm -f debian/gdesklets/usr/share/mime/magic + -rm -f debian/gdesklets/usr/share/mime/aliases + -rm -f debian/gdesklets/usr/share/mime/subclasses + -rm -f debian/gdesklets/usr/share/mime/XMLnamespaces + -rm -f debian/gdesklets/usr/share/applications/mimeinfo.cache + ln -sf ../lib/gdesklets/gdesklets debian/gdesklets/usr/bin/gdesklets + find debian -name *.py[co] -exec rm -f {} \; + cp debian/migration-tool debian/gdesklets/usr/share/gdesklets/ + chmod 755 debian/gdesklets/usr/share/gdesklets/migration-tool + chmod 644 debian/gdesklets/usr/lib/gdesklets/NullObject.py --- gdesklets-0.35.2.orig/debian/NEWS.Debian +++ gdesklets-0.35.2/debian/NEWS.Debian @@ -0,0 +1,9 @@ +gdesklets (0.30-1) experimental; urgency=low + + The configuration format has totally changed in the this new version so you + will get an empty configuration after the update. + + You can migrate your configuration by running this tool: + /usr/share/gdesklets/migration-tool. + + -- Sebastien Bacher Wed, 30 Jun 2004 12:18:20 +0200 --- gdesklets-0.35.2.orig/debian/pack_sensor.py +++ gdesklets-0.35.2/debian/pack_sensor.py @@ -0,0 +1,157 @@ +#!/usr/bin/python + +# +# This script packs the given sensor into an installer script. The user +# only has to start the installer script in order to install the sensor into +# her home directory. +# +# Usage: pack_sensor.bin +# where path is the package directory of the sensor to pack. +# +# (c) 2003 Martin Grimme +# + + +import sys, os, commands, base64 + +NAME = "Pack Sensor" +VERSION = "0.33" + + +# the installer +INSTALLER = """#! /usr/bin/env python + +# +# Autogenerated installer for gDesklets sensors. +# +# Usage: Install_Xyz_Sensor.bin [--nomsg] [--list] [] +# +# The default destination is user specific sensor path. overrides +# the destination path. +# The option --nomsg can be used to suppress message dialogs. +# The option --list only shows the contents of the archive without installing. +# + + +import sys, os, commands, base64, tempfile + + +ERROR_B64 = "Could not extract the archive.\\n" \\ + "The installer seems to be corrupted." +ERROR_TAR = "Could not extract the archive.\\n" \\ + "tar reported an error:\\n" +SUCCESS = "The sensor has been installed successfully.\\n" \\ + "gDesklets is now able to use it." + + +# default settings +no_message = 0 +list_only = 0 +destination = "~/.gdesklets/Sensors" + +# parse arguments +args = sys.argv[1:] +for p in args: + if (p == "--nomsg"): no_message = 1 + elif (p == "--list"): list_only = 1 + else: destination = p +#end for + + +try: + import pygtk; pygtk.require("2.0") + import gtk +except: + no_message = 1 + + + +def message(msg, mtype): + + d = gtk.MessageDialog(None, 0, + (mtype == "error") and gtk.MESSAGE_ERROR or + gtk.MESSAGE_INFO, gtk.BUTTONS_OK, + unicode(msg, "iso-8859-1")) + d.run() + d.destroy() + + + +def install(data, destination, no_message, list_only): + + try: + archive = base64.decodestring(data) + except: + if (no_message): print ERROR_B64 + else: message(ERROR_B64, "error") + sys.exit(1) + + tmp = tempfile.mktemp() + fd = open(tmp, "w") + fd.write(archive) + fd.close() + if (list_only): + cmd = "mkdir -p %%(destination)s; cd %%(destination)s; " \\ + "LANG=C tar -tzf %%(tmp)s 2>&1" + else: + cmd = "mkdir -p %%(destination)s; cd %%(destination)s; " \\ + "LANG=C tar -xzf %%(tmp)s 2>&1" + fail, out = commands.getstatusoutput(cmd %% vars()) + os.unlink(tmp) + + if (fail): + if (no_message): print ERROR_TAR + out + else: message(ERROR_TAR + out, "error") + sys.exit(1) + + print out + if (not list_only): + if (no_message): print SUCCESS + else: message(SUCCESS, "info") + + + +# the tarball in base64 encoding +BASE64DATA = \"\"\"%(data)s\"\"\" + +install(BASE64DATA, destination, no_message, list_only) +""" + + +if (len(sys.argv) != 2): + print "Usage: pack_sensor " + sys.exit(1) +else: + print NAME + " " + VERSION + ", (c) 2003 Martin Grimme" + print "" + +package = sys.argv[1] +if (package[-1] == "/"): package = package[:-1] +name = os.path.basename(package) +dir = os.path.dirname(package) or "." +oldcwd = os.getcwd() +os.chdir(dir) + +print "packing " + name + "..." + +# create the tarball +fail, data = commands.getstatusoutput( + "tar -c --exclude=CVS --exclude=Makefile --exclude=*.pyc " + "--exclude .cvsignore --exclude '*~' --exclude .xvpics " + "--exclude po -f - '%(name)s' | gzip" % vars()) +if (fail): + print "Could not create installer:", data + sys.exit(1) + +os.chdir(oldcwd) + +# encode tarball +data = base64.encodestring(data) + +# write the installer +filename = "Install_" + name + "_Sensor.bin" +fd = open(filename, "w") +fd.write(INSTALLER % vars()) +fd.close() +os.system("chmod 0755 %(filename)s" % vars()) +print "created " + filename