[arch-commits] Commit in wicd/trunk (PKGBUILD deepcopy+python27-fixes.patch)

Rémy Oudompheng remy at archlinux.org
Fri Oct 8 11:32:05 UTC 2010


    Date: Friday, October 8, 2010 @ 07:32:05
  Author: remy
Revision: 94559

upgpkg: wicd 1.7.0-6
Remove deepcopy usage, fix a call to python instead of python2

Added:
  wicd/trunk/deepcopy+python27-fixes.patch
Modified:
  wicd/trunk/PKGBUILD

-------------------------------+
 PKGBUILD                      |    9 +++--
 deepcopy+python27-fixes.patch |   72 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-10-08 09:48:11 UTC (rev 94558)
+++ PKGBUILD	2010-10-08 11:32:05 UTC (rev 94559)
@@ -4,7 +4,7 @@
 
 pkgname=wicd
 pkgver=1.7.0
-pkgrel=5
+pkgrel=6
 pkgdesc="New and alternative wireless/wired network management utility"
 arch=(any)
 url="http://wicd.sourceforge.net/"
@@ -21,17 +21,20 @@
 source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz
         wicd-daemon
         wicd.desktop
-	wicd-scripts-execution.patch)
+	wicd-scripts-execution.patch
+	deepcopy+python27-fixes.patch)
 options=('emptydirs')
 backup=('etc/wicd/encryption/templates/active')
 md5sums=('003d2e67240989db55934553437ba32a'
          'f40e5f59998d0829707a7c9976afa8f8'
          '326df163a5732d38741371baa4fce9e5'
-         'f4c377a25aa077cb76955124adfcc03f')
+         'f4c377a25aa077cb76955124adfcc03f'
+	 '1b7ec95efcb8dc0fe48111da19b395b6')
 
 build() {
   cd $srcdir/$pkgname-$pkgver
   patch -p0 <$srcdir/wicd-scripts-execution.patch
+  patch -p1 -i $srcdir/deepcopy+python27-fixes.patch
   find . -type f -exec sed -i 's@#!/usr.*python@#!/usr/bin/python2@' {} \;
   export PYTHON=python2
   python2 setup.py configure --no-install-init --resume=/usr/share/wicd/scripts/ \

Added: deepcopy+python27-fixes.patch
===================================================================
--- deepcopy+python27-fixes.patch	                        (rev 0)
+++ deepcopy+python27-fixes.patch	2010-10-08 11:32:05 UTC (rev 94559)
@@ -0,0 +1,72 @@
+diff -ur wicd-1.7.0/wicd/configmanager.py wicd-1.7.0.new/wicd/configmanager.py
+--- wicd-1.7.0/wicd/configmanager.py	2010-01-15 05:49:11.000000000 +0100
++++ wicd-1.7.0.new/wicd/configmanager.py	2010-10-08 13:14:22.084345024 +0200
+@@ -35,7 +35,7 @@
+ class ConfigManager(RawConfigParser):
+     """ A class that can be used to manage a given configuration file. """
+     def __init__(self, path, debug=False, mark_whitespace="`'`"):
+-        RawConfigParser.__init__(self)
++        RawConfigParser.__init__(self, allow_no_value=True)
+         self.config_file = path
+         self.debug = debug
+         self.mrk_ws = mark_whitespace
+@@ -176,28 +176,35 @@
+ 
+ 
+     def _copy_section(self, name):
+-        # Yes, deepcopy sucks, but it is robust to changes in both
+-        # this class and RawConfigParser.
+-        p = copy.deepcopy(self)
+-        for sname in p.sections():
+-            if sname != name:
+-                p.remove_section(sname)
++        p = ConfigManager("", self.debug, self.mrk_ws)
++        p.add_section(name)
++        for (iname, value) in self.items(name):
++            p.set(name, iname, value)
++        # Store the filename this section was read from.
+         p.config_file = p.get_option(name, '_filename_', p.config_file)
+         p.remove_option(name, '_filename_')
+         return p
+ 
+     def write(self):
+         """ Writes the loaded config file to disk. """
+-        # Really don't like this deepcopy.
+-        p = copy.deepcopy(self)
+-        for sname in p.sections():
+-            fname = p.get_option(sname, '_filename_')
++        in_this_file = []
++        for sname in self.sections():
++            fname = self.get_option(sname, '_filename_')
+             if fname and fname != self.config_file:
++                # Write sections from other files
+                 section = self._copy_section(sname)
+-                p.remove_section(sname)
+                 section._write_one()
++            else:
++                # Save names of local sections
++                in_this_file.append(sname)
+ 
+-        for sname in p.sections():
++        # Make an instance with only these sections
++        p = ConfigManager("", self.debug, self.mrk_ws)
++        p.config_file = self.config_file
++        for sname in in_this_file:
++            p.add_section(sname)
++            for (iname, value) in self.items(sname):
++                p.set(sname, iname, value)
+             p.remove_option(sname, '_filename_')
+         p._write_one()
+ 
+diff -ur wicd-1.7.0/wicd/wicd-daemon.py wicd-1.7.0.new/wicd/wicd-daemon.py
+--- wicd-1.7.0/wicd/wicd-daemon.py	2010-01-15 05:49:11.000000000 +0100
++++ wicd-1.7.0.new/wicd/wicd-daemon.py	2010-10-08 13:11:15.811786603 +0200
+@@ -1802,7 +1802,7 @@
+     wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus)
+     daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
+     if not no_poll:
+-        child_pid = Popen([misc.find_path("python"), "-O", 
++        child_pid = Popen([misc.find_path("python2"), "-O", 
+                           os.path.join(wpath.daemon, "monitor.py")],
+                           shell=False, close_fds=True).pid
+     atexit.register(on_exit, child_pid)




More information about the arch-commits mailing list