diff3_1_3vsorig.txt Spaces between several blocks of text;
diff3_1_4vsorig.txt End spaces;
diff3_1_5vsorig.txt Docs/comments length;
diff3_1_6vsorig.txt sys.stderr.write(), commas to colons, length.
--- debderiver
+++ debderiver_patch3_1_3.py
@@ -34,7 +34,7 @@
 
 class Suite(object):
     """Suite.
-    
+
     A suite is a repository of packages."""
 
     def __init__(self):
@@ -49,7 +49,7 @@
 
 class Distribution(Suite):
     """Distribution.
-    
+
     This is the suite that can stand on its own, i.e. provides a working
     operating system.  There's only one of these per operating system
     version."""
@@ -70,7 +70,7 @@
 
 class Supplementary_Suite(Suite):
     """Supplementary suite.
-    
+
     This is a suite that can be added to a distribution, i.e. packages from 
     it complement the principal "distribution" suite.  A supplementary suite 
     usually provides newer package versions or extra functionality (e.g. a 
@@ -206,7 +206,7 @@
                 ext = f.split('.')[-1].lower()
                 if ext in ('deb', 'dsc', 'udeb'):
                     self._do(' '.join(('include' + ext, suite, p)))
-                    
+
     def _include_thirdparty(self):
         """Recursively include third-party packages."""
 
--- debderiver
+++ debderiver_patch3_1_4.py
@@ -71,9 +71,9 @@
 class Supplementary_Suite(Suite):
     """Supplementary suite.
     
-    This is a suite that can be added to a distribution, i.e. packages from 
-    it complement the principal "distribution" suite.  A supplementary suite 
-    usually provides newer package versions or extra functionality (e.g. a 
+    This is a suite that can be added to a distribution, i.e. packages from
+    it complement the principal "distribution" suite.  A supplementary suite
+    usually provides newer package versions or extra functionality (e.g. a
     multimedia suite)."""
 
     def __init__(self, pocket, distribution):
@@ -140,7 +140,7 @@
 
         dist['Components'] = self._DEFAULT_COMPONENT
         if suite.fake_component_prefix:
-            dist['Components'] = '/'.join((suite.fake_component_prefix, 
+            dist['Components'] = '/'.join((suite.fake_component_prefix,
                     dist['Components']))
         dist['DebIndices'] = ' '.join(('Packages', self._DEFAULT_INDICES))
         dist['DscIndices'] = ' '.join(('Sources', self._DEFAULT_INDICES))
@@ -149,7 +149,7 @@
             dist['UDebIndices'] = dist['DebIndices']
         self._distributions.append(dist)
 
-    def _add_filter_list(self, codename, filter_list=None, 
+    def _add_filter_list(self, codename, filter_list=None,
             dist_codename=None):
         if not filter_list and not dist_codename:
             print >> sys.stderr, ('Either filter_list or dist_codename '
@@ -162,13 +162,13 @@
 
     def _add_update(self, suite):
         upd = {}
-        upd['FilterSrcList'] = ' '.join(('install', os.path.join('filters', 
+        upd['FilterSrcList'] = ' '.join(('install', os.path.join('filters',
                 suite.codename)))
         upd['Method'] = suite.upstream.method
         upd['Name'] = suite.upstream.name
         upd['Suite'] = suite.upstream.suite
         if suite.fake_component_prefix:
-            upd['Suite'] = '/'.join((upd['Suite'], 
+            upd['Suite'] = '/'.join((upd['Suite'],
                 suite.fake_component_prefix))
         upd['VerifyRelease'] = suite.upstream.key
 
@@ -255,12 +255,12 @@
                     print >> sys.stderr, 'Unable to create directory %s.' % \
                             path
 
-        # Reprepro wants some fields after others (e.g. Codename first). 
-        # Sorting them all is the easiest way to do that. We take scalars 
+        # Reprepro wants some fields after others (e.g. Codename first).
+        # Sorting them all is the easiest way to do that. We take scalars
         # first, lists second, each alphabetically in so far as reprepro 
allows.
-        FIELD_ORDER_DISTS = ('Codename', 'Description', 'FakeComponentPrefix', 
-                'Label', 'Origin', 'SignWith', 'Suite', 'Update', 'Version', 
-                'Architectures', 'Components', 'DebIndices', 'DscIndices', 
+        FIELD_ORDER_DISTS = ('Codename', 'Description', 'FakeComponentPrefix',
+                'Label', 'Origin', 'SignWith', 'Suite', 'Update', 'Version',
+                'Architectures', 'Components', 'DebIndices', 'DscIndices',
                 'UDebComponents', 'UDebIndices')
         dist_path = os.path.join(self._conf_path, 'distributions')
         f_dist = open(dist_path, 'w')
@@ -280,10 +280,10 @@
         f_upd.close()
 
         # First write real filter files, then create links.
-        for fl in [f for f in self._filter_lists.items() if 
+        for fl in [f for f in self._filter_lists.items() if
                 not isinstance(f[1], basestring)]:
             self._write_filter_file(fl[0], fl[1])
-        for fl in [f for f in self._filter_lists.items() if 
+        for fl in [f for f in self._filter_lists.items() if
                 isinstance(f[1], basestring)]:
             self._link_filter_file(fl[0], fl[1])
 
@@ -305,8 +305,8 @@
                         temp_dir_path
         f_inc = open(incoming_path, 'w')
         f_inc.write('Name: all\n')
-        f_inc.write('Allow: ' + 
-                ' '.join([' '.join([d['Codename'], d['Suite']]) for d in 
+        f_inc.write('Allow: ' +
+                ' '.join([' '.join([d['Codename'], d['Suite']]) for d in
                     self._distributions]) + '\n')
         f_inc.write('IncomingDir: ' + incoming_dir_path + '\n')
         f_inc.write('TempDir: ' + temp_dir_path + '\n')
@@ -390,7 +390,7 @@
         print >> sys.stderr, 'No distributions defined.'
         sys.exit(1)
     for dist in dists:
-        if not isinstance(dists[dist], dict): 
+        if not isinstance(dists[dist], dict):
             print >> sys.stderr, 'Distribution %s, no properties defined.' % \
                     dist
             sys.exit(1)
--- debderiver
+++ debderiver_patch3_1_5.py
@@ -71,10 +71,10 @@
 class Supplementary_Suite(Suite):
     """Supplementary suite.
     
-    This is a suite that can be added to a distribution, i.e. packages from 
-    it complement the principal "distribution" suite.  A supplementary suite 
-    usually provides newer package versions or extra functionality (e.g. a 
-    multimedia suite)."""
+    This is a suite that can be added to a distribution, i.e. packages
+    from it complement the principal "distribution" suite.
+    A supplementary suite usually provides newer package versions or
+    extra functionality (e.g. a multimedia suite)."""
 
     def __init__(self, pocket, distribution):
         Suite.__init__(self)
@@ -103,7 +103,8 @@
 class Reprepro(object):
     """Configure and operate reprepro.
 
-    Write reprepro's configuration files and execute reprepro commands."""
+    Write reprepro's configuration files and execute reprepro
+    commands."""
 
     def __init__(self, op_sys):
         self._DEFAULT_COMPONENT = 'main'
@@ -184,8 +185,8 @@
     def _do(self, command):
         """Execute a reprepro command."""
 
-        # TODO: replace this function with _do2, i.e. use subprocess instead of
-        # os.system.
+        # TODO: replace this function with _do2, i.e. use subprocess
+        # instead of os.system.
 
         os.system(' '.join(('reprepro --noskipold -Vb', self._base_path,
             command)))
@@ -228,10 +229,11 @@
     def _purge_purge_lists(self):
         """Purge packages that are in the purge lists.
 
-        Reprepro only blocks packages that are marked with "purge" in the
-        FilterLists.  To get rid of those packages if they were added to a
-        FilterList later, they need to be removed explicitly. This doesn't
-        delete packages that have the operating system's name in their 
version."""
+        Reprepro only blocks packages that are marked with "purge" in
+        the FilterLists. To get rid of those packages if they were added
+        to a FilterList later, they need to be removed explicitly. This
+        doesn't delete packages that have the operating system's name in
+        their version."""
 
         for dist in self._op_sys.distributions:
             for src_pkg in dist.purge_list:
@@ -256,8 +258,9 @@
                             path
 
         # Reprepro wants some fields after others (e.g. Codename first). 
-        # Sorting them all is the easiest way to do that. We take scalars 
-        # first, lists second, each alphabetically in so far as reprepro 
allows.
+        # Sorting them all is the easiest way to do that. We take
+        # scalars first, lists second, each alphabetically in so far as
+        # reprepro allows.
         FIELD_ORDER_DISTS = ('Codename', 'Description', 'FakeComponentPrefix', 
                 'Label', 'Origin', 'SignWith', 'Suite', 'Update', 'Version', 
                 'Architectures', 'Components', 'DebIndices', 'DscIndices', 
@@ -463,9 +466,9 @@
                             'fake_component_prefix']
                 # This is a configuration option instead of an automatic
                 # detection because detection means checking if a
-                # debian-installer directory (or Release file) exists, which
-                # means handling the upstream URI and protocol. That's more
-                # than I want to do now.
+                # debian-installer directory (or Release file) exists,
+                # which means handling the upstream URI and protocol.
+                # That's more than I want to do now.
                 if suites[suite].has_key('exclude_installer'):
                     if suites[suite]['exclude_installer']:
                         s.exclude_installer = True
--- debderiver
+++ debderiver_patch3_1_6.py
@@ -152,8 +152,8 @@
     def _add_filter_list(self, codename, filter_list=None, 
             dist_codename=None):
         if not filter_list and not dist_codename:
-            print >> sys.stderr, ('Either filter_list or dist_codename '
-                    'must be given.')
+            sys.stderr.write('Either filter_list or dist_codename '
+                    'must be given\n')
             sys.exit(1)
         if filter_list:
             self._filter_lists[codename] = filter_list
@@ -252,8 +252,8 @@
                 try:
                     os.mkdir(path)
                 except:
-                    print >> sys.stderr, 'Unable to create directory %s.' % \
-                            path
+                    sys.stderr.write('Unable to create directory '
+                                     '"%s"\n' % path)
 
         # Reprepro wants some fields after others (e.g. Codename first). 
         # Sorting them all is the easiest way to do that. We take scalars 
@@ -295,14 +295,14 @@
             try:
                 os.mkdir(incoming_dir_path)
             except:
-                print >> sys.stderr, 'Unable to create directory %s.' % \
-                        incoming_dir_path
+                sys.stderr.write('Unable to create directory "%s"\n' %
+                        incoming_dir_path)
         if not os.path.isdir(temp_dir_path):
             try:
                 os.mkdir(temp_dir_path)
             except:
-                print >> sys.stderr, 'Unable to create directory %s.' % \
-                        temp_dir_path
+                sys.stderr.write('Unable to create directory "%s"\n' %
+                        temp_dir_path)
         f_inc = open(incoming_path, 'w')
         f_inc.write('Name: all\n')
         f_inc.write('Allow: ' + 
@@ -319,7 +319,8 @@
                 try:
                     os.mkdir(p)
                 except:
-                    print >> sys.stderr, 'Unable to create directory %s.' % p
+                    sys.stderr.write('Unable to create directory '
+                                     '"%s"\n' % p)
 
     def _write_filter_file(self, codename, purge_list):
         filter_path = os.path.join(self._conf_path, 'filters', codename)
@@ -360,59 +361,60 @@
     try:
         main_conf = yaml.load(open(conf_file_path, 'r'))
     except:
-        print >> sys.stderr, 'Unable to load %s.' % conf_file_path
+        sys.stderr.write('Unable to load "%s"\n' % conf_file_path)
         sys.exit(1)
 
     # Validate operating system level.
     for key in ('os', 'base_dir', 'description', 'signing_key', 
'distributions'):
         if not main_conf.has_key(key):
-            print >> sys.stderr, 'Missing key: "%s".' % key
+            sys.stderr.write('Missing key: %s\n' % key)
             sys.exit(1)
 
     # Validate upstreams.
     ups = main_conf['upstreams']
     if not ups:
-        print >> sys.stderr, 'No upstreams defined.'
+        sys.stderr.write('No upstreams defined\n')
         sys.exit(1)
     for up in ups:
         if not isinstance(ups[up], dict):
-            print >> sys.stderr, 'Upstream %s, no properties defined.' % up
+            sys.stderr.write('Upstream %s, no properties defined\n' % up)
             sys.exit(1)
         for key in ('method', 'suite'):
             if not ups[up].has_key(key):
-                print >> sys.stderr, 'Upstream %s, missing key: "%s"' % \
-                        (up, key)
+                sys.stderr.write('Upstream %s: missing key: %s\n' %
+                                 (up, key))
                 sys.exit(1)
 
     # Validate distributions.
     dists = main_conf['distributions']
     if not dists:
-        print >> sys.stderr, 'No distributions defined.'
+        sys.stderr.write('No distributions defined\n')
         sys.exit(1)
     for dist in dists:
         if not isinstance(dists[dist], dict): 
-            print >> sys.stderr, 'Distribution %s, no properties defined.' % \
-                    dist
+            sys.stderr.write('Distribution %s: no properties '
+                             'defined\n' % dist)
             sys.exit(1)
         for key in ('alias', 'architectures', 'upstream', 'version'):
             if not dists[dist].has_key(key):
-                print >> sys.stderr, 'Distribution %s, missing key: "%s".' % \
-                        (dist, key)
+                sys.stderr.write('Distribution %s: missing key: %s\n' %
+                                 (dist, key))
                 sys.exit(1)
         if not dists[dist]['architectures']:
-            print >> sys.stderr, 'Distribution %s, no architectures defined.' \
-                    % dist
+            sys.stderr.write('Distribution %s: no architectures '
+                             'defined\n' % dist)
             sys.exit(1)
         if dists[dist].has_key('supplementary_suites'):
             suites = dists[dist]['supplementary_suites']
             if not isinstance(suites, dict):
-                print >> sys.stderr, ('Distribution %s, no supplementary '
-                        'suites defined.' % dist)
+                sys.stderr.write('Distribution %s: no supplementary '
+                                 'suites defined\n' % dist)
                 sys.exit(1)
             for suite in suites:
                 if not suites[suite].has_key('upstream'):
-                    print >> sys.stderr, 'Supplementary suite %s-%s, missing \
-                            key: "%s".' % (dist, suite, 'upstream')
+                    sys.stderr.write('Supplementary suite %s-%s: '
+                                     'missing key: %s\n' %
+                                     (dist, suite, 'upstream'))
 
     filter_dir_path = os.path.join(conf_dir_path, 'filters')
     for filter_file_name in os.listdir(filter_dir_path):
@@ -420,17 +422,17 @@
         try:
             filter_list = yaml.load(open(filter_file_path, 'r'))
         except:
-            print >> sys.stderr, 'Unable to load %s.' % filter_file_path
+            sys.stderr.write('Unable to load "%s"\n' % filter_file_path)
             sys.exit(1)
         if not isinstance(filter_list, list):
-            print >> sys.stderr, \
-                    'Filter file %s must contain a list of source packages.' % 
\
-                    filter_file_path
+            sys.stderr.write('Filter file "%s" must contain a list '
+                             'of source packages\n' % filter_file_path)
             sys.exit(1)
         for item in filter_list:
             if not isinstance(item, basestring):
-                print >> sys.stderr, 'Filter file %s: %s is not valid source \
-                        package name.' % (filter_file_path, item)
+                sys.stderr.write('Filter file "%s": "%s" is not a '
+                                 'valid source package name\n' %
+                                 (filter_file_path, item))
 
     # Pour into objects.
     opsys = OperatingSystem(main_conf['os'], main_conf['description'], \
_______________________________________________
gNewSense-dev mailing list
gNewSense-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/gnewsense-dev

Reply via email to