Exemple #1
0
 def action(cls, args):
     release_type = args[1]['type']
     if args[0] == 'update':
         version_number = args[1]['version']
         package_list = Packages.get(release_type, version_number)
         for package_name in package_list:
             build_number = Packages.resolveNumberFromVersion(
                 release_type, version_number, package_name)
             recorded_hash = Hashes.get(release_type, package_name,
                                        build_number)
             if recorded_hash == '':
                 output_file = manager.DownloadPackageTarball(
                     release_type, package_name, build_number, False)
                 if output_file != '':
                     new_hash = Hashes.calculate(output_file)
                     Hashes.add(release_type, package_name, build_number,
                                new_hash)
                 else:
                     print(
                         'Missing package! If there was an error before this please check to see if the url exists and file a radar on the missing tarball!'
                     )
     if args[0] == 'get':
         package_name = args[1]['package']
         build_number = args[1]['build']
         print(Hashes.get(release_type, package_name, build_number))
Exemple #2
0
 def action(cls, args):
     release_type = args.get('type', None)
     package_name = args.get('package', None)
     if release_type != None:
         if package_name != None:
             package_list = Packages.list(release_type)
             has_valid_package = package_name in package_list
             if has_valid_package == True:
                 print('Builds for package ' + package_name + ':')
                 for build_number in Builds.get(release_type, package_name):
                     print(build_number)
             else:
                 if len(package_list) > 0:
                     logging_helper.getLogger().error(
                         'Invalid package name!')
                 else:
                     logging_helper.getLogger().error(
                         'The package list has not been built yet, please run "cache rebuild" to rebuild it. If that does not resolve this please run "cache setup".'
                     )
         else:
             print('Packages for ' + release_type + ':')
             for package_name in Packages.list(release_type):
                 print(package_name)
     else:
         logging_helper.getLogger().info(
             'Please select a release type before using the "list" command for packages, or please select a release type and package before using the "list" command for build numbers.'
         )
Exemple #3
0
 def query(cls, release_type, version, args):
     # only use the first value
     if len(args) > 0:
         build_number = None
         if version != None:
             build_number = Packages.resolveNumberFromVersion(release_type, version, args[0])
         return (args[0] in cls.valid_values(release_type, version), [args[0], build_number])
     else:
         return (False, None)
Exemple #4
0
 def action(cls, args):
     release_type = args[1]['type']
     if args[0] == 'update':
         version_number = args[1]['version']
         package_list = Packages.get(release_type, version_number)
         for package_name in package_list:
             build_number = Packages.resolveNumberFromVersion(release_type, version_number, package_name)
             recorded_hash = Hashes.get(release_type, package_name, build_number)
             if recorded_hash == '':
                 output_file = manager.DownloadPackageTarball(release_type, package_name, build_number, False)
                 if output_file != '':
                     new_hash = Hashes.calculate(output_file)
                     Hashes.add(release_type, package_name, build_number, new_hash)
                 else:
                     print('Missing package! If there was an error before this please check to see if the url exists and file a radar on the missing tarball!')
     if args[0] == 'get':
         package_name = args[1]['package']
         build_number = args[1]['build']
         print(Hashes.get(release_type, package_name, build_number))
     print('====================')
Exemple #5
0
 def action(cls, args):
     release_type = args[1]["type"]
     if args[0] == "update":
         version_number = args[1]["version"]
         package_list = Packages.get(release_type, version_number)
         for package_name in package_list:
             build_number = Packages.resolveNumberFromVersion(release_type, version_number, package_name)
             recorded_hash = Hashes.get(release_type, package_name, build_number)
             if recorded_hash == "":
                 output_file = manager.DownloadPackageTarball(release_type, package_name, build_number, False)
                 if output_file != "":
                     new_hash = Hashes.calculate(output_file)
                     Hashes.add(release_type, package_name, build_number, new_hash)
                 else:
                     print(
                         "Missing package! If there was an error before this please check to see if the url exists and file a radar on the missing tarball!"
                     )
     if args[0] == "get":
         package_name = args[1]["package"]
         build_number = args[1]["build"]
         print(Hashes.get(release_type, package_name, build_number))
Exemple #6
0
 def action(cls, args):
     release_type = args.get('type', None)
     package_name = args.get('package', None)
     if release_type != None:
         if package_name != None:
             package_list = Packages.list(release_type)
             has_valid_package = package_name in package_list
             if has_valid_package == True:
                 print('Builds for package '+package_name+':')
                 for build_number in Builds.get(release_type, package_name):
                     print(build_number)
             else:
                 if len(package_list) > 0:
                     logging_helper.getLogger().error('Invalid package name!')
                 else:
                     logging_helper.getLogger().error('The package list has not been built yet, please run "cache rebuild" to rebuild it. If that does not resolve this please run "cache setup".')
         else:
             print('Packages for '+release_type+':')
             for package_name in Packages.list(release_type):
                 print(package_name)
     else:
         logging_helper.getLogger().info('Please select a release type before using the "list" command for packages, or please select a release type and package before using the "list" command for build numbers.')
Exemple #7
0
 def valid_values(cls, release_type, release_version):
     return Packages.get(release_type, release_version)