[Uludag-commits] r16933 - in branches/pisi-1.1/pisi: . cli pxml

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
2 Şub 2008 Cmt 19:44:32 EET


Author: caglar
Date: Sat Feb  2 19:44:31 2008
New Revision: 16933

Modified:
   branches/pisi-1.1/pisi/api.py
   branches/pisi-1.1/pisi/archive.py
   branches/pisi-1.1/pisi/atomicoperations.py
   branches/pisi-1.1/pisi/build.py
   branches/pisi-1.1/pisi/cli/commands.py
   branches/pisi-1.1/pisi/comariface.py
   branches/pisi-1.1/pisi/component.py
   branches/pisi-1.1/pisi/configfile.py
   branches/pisi-1.1/pisi/metadata.py
   branches/pisi-1.1/pisi/operations.py
   branches/pisi-1.1/pisi/package.py
   branches/pisi-1.1/pisi/packagedb.py
   branches/pisi-1.1/pisi/pxml/autoxml.py
   branches/pisi-1.1/pisi/util.py
Log:
trailing whitespace

Modified: branches/pisi-1.1/pisi/api.py
=================================================================
--- branches/pisi-1.1/pisi/api.py	(original)
+++ branches/pisi-1.1/pisi/api.py	Sat Feb  2 19:44:31 2008
@@ -52,10 +52,10 @@
          comar_sockname = None,
          signal_handling = True):
     """Initialize PiSi subsystem.
-    
+
     You should call finalize() when your work is finished. Otherwise
     you can left the database in a bad state.
-    
+
     """
 
     # UI comes first
@@ -171,10 +171,10 @@
 
 def package_graph(A, repo = pisi.itembyrepodb.installed, ignore_installed = False):
     """Construct a package relations graph.
-    
+
     Graph will contain all dependencies of packages A, if ignore_installed
     option is True, then only uninstalled deps will be added.
-    
+
     """
 
     ctx.ui.debug('A = %s' % str(A))
@@ -184,7 +184,7 @@
 
     G_f = pgraph.PGraph(ctx.packagedb, repo)             # construct G_f
 
-    # find the "install closure" graph of G_f by package 
+    # find the "install closure" graph of G_f by package
     # set A using packagedb
     for x in A:
         G_f.add_package(x)
@@ -225,7 +225,7 @@
 
 def generate_base_upgrade(A):
     # all the packages of the system.base must be installed on the system.
-    # method returns the currently needed system.base component install and 
+    # method returns the currently needed system.base component install and
     # upgrade needs
     base = upgrade_base(A, ignore_package_conflicts = True)
     return list(base)

Modified: branches/pisi-1.1/pisi/archive.py
=================================================================
--- branches/pisi-1.1/pisi/archive.py	(original)
+++ branches/pisi-1.1/pisi/archive.py	Sat Feb  2 19:44:31 2008
@@ -137,7 +137,7 @@
             # accessed. Removing and creating the file will also
             # change the inode and will do the trick (in fact, old
             # file will be deleted only when its closed).
-            # 
+            #
             # Also, tar.extract() doesn't write on symlinks... Not any
             # more :).
             if self.file_path == install_tar_path:

Modified: branches/pisi-1.1/pisi/atomicoperations.py
=================================================================
--- branches/pisi-1.1/pisi/atomicoperations.py	(original)
+++ branches/pisi-1.1/pisi/atomicoperations.py	Sat Feb  2 19:44:31 2008
@@ -163,14 +163,14 @@
 
         # If it is explicitly specified that package conflicts with this package and also
         # we passed check_conflicts tests in operations.py than this means a non-conflicting
-        # pkg is in "order" to be installed that has no file conflict problem with this package. 
+        # pkg is in "order" to be installed that has no file conflict problem with this package.
         # PS: we need this because "order" generating code does not consider conflicts.
         def really_conflicts(pkg):
             if not self.pkginfo.conflicts:
                 return True
 
             return not pkg in map(lambda x:x.package, self.pkginfo.conflicts)
-        
+
         # check file conflicts
         file_conflicts = []
         for f in self.files.list:
@@ -312,22 +312,22 @@
                 # may contain same config typed files with same hashes, so the delta
                 # package will not have that config file. In order to protect user
                 # changed config files, they are renamed with ".old" prefix in case
-                # of the hashes of these files on the filesystem and the new config 
+                # of the hashes of these files on the filesystem and the new config
                 # file that is coming from the new package. But in delta package case
                 # with the given scenario there wont be any, so we can pass this one.
                 # If the config files were not be the same between these packages the
                 # delta package would have it and extract it and the path would point
-                # to that new config file. If they are same and the user had changed 
-                # that file and using the changed config file, there is no problem 
+                # to that new config file. If they are same and the user had changed
+                # that file and using the changed config file, there is no problem
                 # here.
                 if os.path.exists(path):
                     os.rename(path, newconfig)
 
                 os.rename(oldconfig, path)
 
-        # Delta package does not contain the files that have the same hash as in 
-        # the old package's. Because it means the file has not changed. But some 
-        # of these files may be relocated to some other directory in the new package. 
+        # Delta package does not contain the files that have the same hash as in
+        # the old package's. Because it means the file has not changed. But some
+        # of these files may be relocated to some other directory in the new package.
         # We handle these cases here.
         def relocate_files():
             for old_file, new_file in pisi.delta.find_relocations(self.old_files, self.files):
@@ -337,7 +337,7 @@
                 if not os.path.exists(destdir):
                     os.makedirs(destdir)
 
-                if os.path.islink(old_path): 
+                if os.path.islink(old_path):
                     if not os.path.lexists(new_path):
                         os.symlink(os.readlink(old_path), new_path)
                 else:

Modified: branches/pisi-1.1/pisi/build.py
=================================================================
--- branches/pisi-1.1/pisi/build.py	(original)
+++ branches/pisi-1.1/pisi/build.py	Sat Feb  2 19:44:31 2008
@@ -454,7 +454,7 @@
         else:
             if mandatory:
                 raise Error(_("unable to call function from actions: %s") % func)
-        
+
         os.chdir(curDir)
         return True
 

Modified: branches/pisi-1.1/pisi/cli/commands.py
=================================================================
--- branches/pisi-1.1/pisi/cli/commands.py	(original)
+++ branches/pisi-1.1/pisi/cli/commands.py	Sat Feb  2 19:44:31 2008
@@ -528,7 +528,7 @@
 
     def run(self):
 
-        from pisi.delta import create_delta_package 
+        from pisi.delta import create_delta_package
 
         self.init(database=False, write=False)
 

Modified: branches/pisi-1.1/pisi/comariface.py
=================================================================
--- branches/pisi-1.1/pisi/comariface.py	(original)
+++ branches/pisi-1.1/pisi/comariface.py	Sat Feb  2 19:44:31 2008
@@ -31,14 +31,14 @@
 
 def get_comar():
     """Connect to the comar daemon and return the handle"""
-    
+
     sockname = "/var/run/comar.socket"
     # YALI starts comar chrooted in the install target, but uses PiSi outside of
     # the chroot environment, so PiSi needs to use a different socket path to be
     # able to connect true comar (usually /mnt/target/var/run/comar.socket).
     if ctx.comar_sockname:
         sockname = ctx.comar_sockname
-    
+
     # This function is sometimes called when comar has recently started
     # or restarting after an update. So we give comar a chance to become
     # active in a reasonable time.
@@ -75,7 +75,7 @@
                 if ctx.keyboard_interrupt_pending():
                     return
                 raise Error, _("connection with comar unexpectedly closed")
-        
+
         cmd = reply[0]
         if cmd == com.RESULT and not multiple:
             return
@@ -95,22 +95,22 @@
 
 def post_install(package_name, provided_scripts, scriptpath, metapath, filepath):
     """Do package's post install operations"""
-    
+
     ctx.ui.info(_("Configuring %s package") % package_name)
     self_post = False
     com = get_comar()
-    
+
     for script in provided_scripts:
         ctx.ui.debug(_("Registering %s comar script") % script.om)
         if script.om == "System.Package":
             self_post = True
         com.register(script.om, package_name, os.path.join(scriptpath, script.script))
         wait_for_result(com)
-    
+
     ctx.ui.debug(_("Calling post install handlers"))
     com.call("System.PackageHandler.setupPackage", [ "metapath", metapath, "filepath", filepath ])
     wait_for_result(com)
-    
+
     if self_post:
         ctx.ui.debug(_("Running package's post install script"))
         com.call_package("System.Package.postInstall", package_name)
@@ -118,18 +118,18 @@
 
 def pre_remove(package_name, metapath, filepath):
     """Do package's pre removal operations"""
-    
+
     ctx.ui.info(_("Configuring %s package for removal") % package_name)
     com = get_comar()
-    
+
     ctx.ui.debug(_("Running package's pre remove script"))
     com.call_package("System.Package.preRemove", package_name)
     wait_for_result(com)
-    
+
     ctx.ui.debug(_("Calling pre remove handlers"))
     com.call("System.PackageHandler.cleanupPackage", [ "metapath", metapath, "filepath", filepath ])
     wait_for_result(com)
-    
+
     ctx.ui.debug(_("Unregistering comar scripts"))
     com.remove(package_name)
     wait_for_result(com)

Modified: branches/pisi-1.1/pisi/component.py
=================================================================
--- branches/pisi-1.1/pisi/component.py	(original)
+++ branches/pisi-1.1/pisi/component.py	Sat Feb  2 19:44:31 2008
@@ -132,9 +132,9 @@
 
     # walk: walks through the underlying  components' packages
     def get_union_packages(self, component_name, walk=False, repo=pisi.itembyrepodb.repos, txn = None):
-        """returns union of all repository component's packages, not just the first repo's 
+        """returns union of all repository component's packages, not just the first repo's
         component's in order"""
-        
+
         component = self.get_union_comp(component_name, txn, repo)
         if not walk:
             return component.packages
@@ -149,7 +149,7 @@
     # walk: walks through the underlying  components' packages
     def get_packages(self, component_name, walk=False, repo=None, txn = None):
         """returns the given component's and underlying recursive components' packages"""
-        
+
         component = self.get_component(component_name, repo, txn)
         if not walk:
             return component.packages

Modified: branches/pisi-1.1/pisi/configfile.py
=================================================================
--- branches/pisi-1.1/pisi/configfile.py	(original)
+++ branches/pisi-1.1/pisi/configfile.py	Sat Feb  2 19:44:31 2008
@@ -192,7 +192,7 @@
             r'(?P<padding>\s*)'
             r'(?P<value>.*)$'
             )
-        
+
         fp = open(self.filePath, "r+")
         # Default to " = " to match write(), but use the most recent
         # separator found if the file has any options.
@@ -299,4 +299,4 @@
                 fp.write(sect.getvalue())
 
         fp.close()
-        
+

Modified: branches/pisi-1.1/pisi/metadata.py
=================================================================
--- branches/pisi-1.1/pisi/metadata.py	(original)
+++ branches/pisi-1.1/pisi/metadata.py	Sat Feb  2 19:44:31 2008
@@ -29,7 +29,7 @@
 
 class Delta:
     __metaclass__ = autoxml.autoxml
-    
+
     t_PackageURI = [ autoxml.String, autoxml.optional]
     t_PackageSize = [ autoxml.Long, autoxml.optional]
     t_PackageHash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]

Modified: branches/pisi-1.1/pisi/operations.py
=================================================================
--- branches/pisi-1.1/pisi/operations.py	(original)
+++ branches/pisi-1.1/pisi/operations.py	Sat Feb  2 19:44:31 2008
@@ -266,7 +266,7 @@
         raise
     except Exception, e: #FIXME: what exception could we catch here, replace with that.
         return False
-        
+
     if ignore_build or (not build) or (not pkg.build):
         return pisi.version.Version(release) < pisi.version.Version(pkg.release)
     else:
@@ -448,7 +448,7 @@
                 ctx.ui.info(_('Package %s is already at the latest build %s.')
                             % (pkg.name, pkg.build), True)
 
-                
+
     A = set(Ap)
 
     if len(A)==0:
@@ -506,7 +506,7 @@
         remove_replaced_packages(order, replaces)
 
     remove_obsoleted_packages()
-    
+
     for path in paths:
         ctx.ui.info(util.colorize(_("Installing %d / %d") % (paths.index(path)+1, len(paths)), "yellow"))
         install_op = atomicoperations.Install(path, ignore_file_conflicts = True)
@@ -539,7 +539,7 @@
                 # add packages that can be upgraded
                 if ctx.installdb.is_installed(dep.package) and dependency.installed_satisfies_dep(dep):
                     continue
-                
+
                 if dependency.repo_satisfies_dep(dep):
                     if not dep.package in G_f.vertices():
                         Bp.add(str(dep.package))
@@ -547,7 +547,7 @@
                 else:
                     ctx.ui.error(_('Dependency %s of %s cannot be satisfied') % (dep, x))
                     raise Error(_("Upgrade is not possible."))
-                
+
         B = Bp
     # now, search reverse dependencies to see if anything
     # should be upgraded

Modified: branches/pisi-1.1/pisi/package.py
=================================================================
--- branches/pisi-1.1/pisi/package.py	(original)
+++ branches/pisi-1.1/pisi/package.py	Sat Feb  2 19:44:31 2008
@@ -99,7 +99,7 @@
         self.impl.unpack_dir_flat(dir, outdir)
 
     def extract_to(self, outdir, clean_dir = False):
-        """Extracts contents of the archive to outdir. Before extracting if clean_dir 
+        """Extracts contents of the archive to outdir. Before extracting if clean_dir
         is set, outdir is deleted with its contents"""
         self.impl.unpack(outdir, clean_dir)
 

Modified: branches/pisi-1.1/pisi/packagedb.py
=================================================================
--- branches/pisi-1.1/pisi/packagedb.py	(original)
+++ branches/pisi-1.1/pisi/packagedb.py	Sat Feb  2 19:44:31 2008
@@ -77,7 +77,7 @@
 
         replaces = self.get_replaces(repo)
         return set(str(o) for o in obsoletes) - set(replaces.keys())
-    
+
     # replacesdb holds the info about the replaced packages (ex. gaim -> pidgin)
     def get_replaces(self, repo = None):
         pairs = {}
@@ -88,7 +88,7 @@
                     pairs[r.package] = pkg_name
 
         return pairs
-    
+
     def get_rev_deps(self, name, repo = None, txn = None):
         if self.dr.has_key(name, repo, txn=txn):
             return self.dr.get_item(name, repo, txn=txn)
@@ -127,7 +127,7 @@
 
             if package_info.replaces:
                 self.drp.add_item(name, package_info.replaces, repo, txn)
-            
+
             # add component
             ctx.componentdb.add_package(package_info.partOf, package_info.name, repo, txn)
 

Modified: branches/pisi-1.1/pisi/pxml/autoxml.py
=================================================================
--- branches/pisi-1.1/pisi/pxml/autoxml.py	(original)
+++ branches/pisi-1.1/pisi/pxml/autoxml.py	Sat Feb  2 19:44:31 2008
@@ -270,7 +270,7 @@
         errorss = []
         formatters = []
 
-        # FIXME: What is this? Remove this crap and try to fix autoxml, if can not be fixed then 
+        # FIXME: What is this? Remove this crap and try to fix autoxml, if can not be fixed then
         # really throw whole autoxml to junk. But not this.
 
         # read declaration order from source
@@ -440,7 +440,7 @@
             def read(self, uri, keepDoc = False, tmpDir = '/tmp',
                      sha1sum = False, compress = None, sign = None, copylocal = False):
                 "read XML file and decode it into a python object"
-                self.readxml(uri, tmpDir, sha1sum=sha1sum, 
+                self.readxml(uri, tmpDir, sha1sum=sha1sum,
                              compress=compress, sign=sign, copylocal=copylocal)
                 errs = []
                 self.decode(self.rootNode(), errs)

Modified: branches/pisi-1.1/pisi/util.py
=================================================================
--- branches/pisi-1.1/pisi/util.py	(original)
+++ branches/pisi-1.1/pisi/util.py	Sat Feb  2 19:44:31 2008
@@ -241,9 +241,9 @@
 
 def join_path(a, *p):
     """Join two or more pathname components.
-    
+
     Python os.path.join cannot handle '/' at the start of latter components.
-    
+
     """
     path = a
     for b in p:
@@ -344,7 +344,7 @@
             # We pad them with zeroes, thus hash will be stable
             clean_ar_timestamps(path)
         value = sha1_file(path)
-    
+
     return (path, value)
 
 def get_file_hashes(top, excludePrefix=None, removePrefix=None):
@@ -355,20 +355,20 @@
             if len(filter(lambda x: temp.startswith(x), excludePrefix)) > 0:
                 return False
         return True
-    
+
     # single file/symlink case
     if not os.path.isdir(top) or os.path.islink(top):
         if is_included(top):
             yield calculate_hash(top)
         return
-    
+
     for root, dirs, files in os.walk(top):
         # Hash files and file symlinks
         for name in files:
             path = os.path.join(root, name)
             if is_included(path):
                 yield calculate_hash(path)
-        
+
         # Hash symlink dirs
         # os.walk doesn't enter them, we don't want to follow them either
         # but their name and hashes must be reported
@@ -378,7 +378,7 @@
             if os.path.islink(path):
                 if is_included(path):
                     yield calculate_hash(path)
-        
+
         # Hash empty dir
         # Discussed in bug #340
         if len(files) == 0 and len(dirs) == 0:
@@ -573,9 +573,9 @@
 
 def is_package_name(fn, package_name = None):
     """Check if fn is a valid filename for given package_name.
-    
+
     If not given a package name, see if fn fits the package name rules
-    
+
     """
     if (package_name==None) or fn.startswith(package_name + '-'):
         if fn.endswith(ctx.const.package_suffix):
@@ -591,9 +591,9 @@
 
 def parse_package_name(package_name):
     """Separate package name and version string.
-    
+
     example: tasma-1.0.3-5-2 -> (tasma, 1.0.3-5-2)
-    
+
     """
     # We should handle package names like 855resolution
     name = []
@@ -609,14 +609,14 @@
 
 def parse_delta_package_name(package_name):
     """Separate delta package name and release infos
-    
+
     example: tasma-5-7.pisi.delta -> (tasma, 5, 7)
-    
+
     """
     name, build = parse_package_name(package_name)
     build = build[:-len(ctx.const.delta_package_suffix)]
     buildFrom, buildTo = build.split("-")
-    
+
     return name, buildFrom, buildTo
 
 def filter_latest_packages(package_paths):


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi