tags: patch

The diff also includes debian/rules changes to integrate dpatch.  I did not 
include a diff for debian/control, but obviously control needs dpatch added 
to build depends.

I did the rules changes.  Credit for the pysol patch should go to:

Edoardo Batini <[EMAIL PROTECTED]>
diff -u pysol-4.82.1/debian/rules pysol-4.82.1/debian/rules
--- pysol-4.82.1/debian/rules
+++ pysol-4.82.1/debian/rules
@@ -7,16 +7,22 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+PACKAGES=pysol
 TMPDIR = $(shell pwd)/debian/pysol
 
-build:
-build-stamp:
+include /usr/share/dpatch/dpatch.make
+
+build: build-stamp
+
+build-stamp: patch
 	dh_testdir
 	touch build-stamp
 
-clean:
+clean: clean-patched unpatch
+clean-patched:
 	dh_testdir
 	dh_testroot
+	rm -rf debian/pysol debian/files debian/substvars
 	rm -f build-stamp
 	rm -f *.py[co]
 	dh_clean
--- pysol-4.82.1.orig/debian/patches/01_patch_for_bug_39975.dpatch
+++ pysol-4.82.1/debian/patches/01_patch_for_bug_39975.dpatch
@@ -0,0 +1,39 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_patch_for_bug_39975.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Solving custom options persistance
+
[EMAIL PROTECTED]@
+
+diff -Nru ../../pysol-4.82.1/src/app.py ../../tmp/pysol-4.82.1/src/app.py
+--- ../../pysol-4.82.1/src/app.py	2007-04-29 23:57:27.000000000 +0200
++++ ../../tmp/pysol-4.82.1/src/app.py	2007-04-29 23:58:42.000000000 +0200
+@@ -408,8 +408,26 @@
+ 
+     # the PySol mainloop
+     def mainloop(self):
++        ## Following code added to solve:
++        ## - launchpad bug #39975
++        ## - debbugs #418546
++        ## class Option in app.py uses int values 0, 1 to set user preferences.
++        ## When user change a preference in a checkbox that value was changed to boolean True or False 
++        ## and stored in self.fn.opt (~/.pysol/options.dat)
++        ## That's why only two_values options were giving problems.
++        ## Hacked to convert back each boolean to 0 or 1 from custom options file so that Pysol accept that values.
++        try:
++            options = unpickle(self.fn.opt)
++            for k in options.__dict__.keys():
++                if options.__dict__[k] == False:
++                    setattr(options, k, 0)
++                elif options.__dict__[k] == True:
++                    setattr(options, k, 1)
++            self.opt = options
++        except:
++            self.startup_opt =self.opt.copy()
+         # copy startup options
+-        self.startup_opt = self.opt.copy()
++
+         # try to load statistics
+         try: self.loadStatistics()
+         except: pass
only in patch2:
unchanged:
--- pysol-4.82.1.orig/debian/patches/00list
+++ pysol-4.82.1/debian/patches/00list
@@ -0,0 +1 @@
+01_patch_for_bug_39975.dpatch

Reply via email to