Esempio n. 1
0
File: CmdHash.py Progetto: argp/aosd
 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))
Esempio n. 2
0
File: CmdList.py Progetto: argp/aosd
 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.'
         )
Esempio n. 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)
Esempio n. 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('====================')
Esempio n. 5
0
File: CmdHash.py Progetto: argp/aosd
 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))
Esempio n. 6
0
File: CmdList.py Progetto: argp/aosd
 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.')
Esempio n. 7
0
 def valid_values(cls, release_type, release_version):
     return Packages.get(release_type, release_version)