Beispiel #1
0
 def locate_package_names(files):
     for fn in files:
         fn = fn.decode("utf-8")
         if util.is_package_name(fn, package_name):
             old_package_fn = util.join_path(root, fn)
             ctx.ui.info("(found old version %s)" % old_package_fn)
             old_pkg = Package(old_package_fn, "r")
             old_pkg.read(util.join_path(ctx.config.tmp_dir(), "oldpkg"))
             if str(old_pkg.metadata.package.name) != package_name:
                 ctx.ui.warning("Skipping %s with wrong pkg name " % old_package_fn)
                 continue
             old_build = old_pkg.metadata.package.build
             found.append((old_package_fn, old_build))
Beispiel #2
0
 def locate_old_package(old_package_fn):
     if util.is_package_name(os.path.basename(old_package_fn), package_name):
         try:
             old_pkg = Package(old_package_fn, 'r')
             old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
             ctx.ui.info(_('(found old version %s)') % old_package_fn)
             if str(old_pkg.metadata.package.name) != package_name:
                 ctx.ui.warning(_('Skipping %s with wrong pkg name ') %
                                         old_package_fn)
                 return
             old_build = old_pkg.metadata.package.build
             found.append( (old_package_fn, old_build) )
         except Error:
             ctx.ui.warning('Package file %s may be corrupt. Skipping.' % old_package_fn)
Beispiel #3
0
 def locate_package_names(files):
      for fn in files:
          fn = fn.decode('utf-8')
          if util.is_package_name(fn, package_name):
              old_package_fn = os.path.join(root, fn)
              ctx.ui.info('(found old version %s)' % old_package_fn)
              old_pkg = Package(old_package_fn, 'r')
              old_pkg.read(os.path.join(ctx.config.tmp_dir(), 'oldpkg'))
              if str(old_pkg.metadata.package.name) != package_name:
                  ctx.ui.warning('Skipping %s with wrong pkg name ' %
                                 old_package_fn)
                  continue
              old_build = old_pkg.metadata.package.build
              found.append( (old_package_fn, old_build) )
Beispiel #4
0
 def locate_package_names(files):
     for fn in files:
         if util.is_package_name(fn, package_name):
             old_package_fn = util.join_path(root, fn)
             try:
                 old_pkg = Package(old_package_fn, 'r')
                 old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
                 ctx.ui.info(_('(found old version %s)') % old_package_fn)
                 if str(old_pkg.metadata.package.name) != package_name:
                     ctx.ui.warning(_('Skipping %s with wrong pkg name ') %
                                    old_package_fn)
                     continue
                 old_build = old_pkg.metadata.package.build
                 found.append( (old_package_fn, old_build) )
             except:
                 ctx.ui.warning('Package file %s may be corrupt. Skipping.' % old_package_fn)
                 continue
Beispiel #5
0
 def locate_old_package(old_package_fn):
     if util.is_package_name(os.path.basename(old_package_fn),
                             package_name):
         try:
             old_pkg = Package(old_package_fn, 'r')
             old_pkg.read(util.join_path(ctx.config.tmp_dir(),
                                         'oldpkg'))
             ctx.ui.info(_('(found old version %s)') % old_package_fn)
             if str(old_pkg.metadata.package.name) != package_name:
                 ctx.ui.warning(
                     _('Skipping %s with wrong pkg name ') %
                     old_package_fn)
                 return
             old_build = old_pkg.metadata.package.build
             found.append((old_package_fn, old_build))
         except Exception, e:
             print e
             ctx.ui.warning(
                 'Package file %s may be corrupt. Skipping.' %
                 old_package_fn)