def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     package_dir = path.join(self.base_directory, package_name)
     ensure_directory_exists(package_dir)
     final_filepath = hard_link_or_raise_exception(filepath, package_dir)
     if self._get_latest_update_file_in_directory(package_dir) == final_filepath:
         self._extract_update(package_dir, final_filepath)
Beispiel #2
0
 def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(
         filepath)
     directory = path.join(self.base_directory,
                           package_name.replace('_', '-'))
     ensure_directory_exists(directory)
     filename = '{0}-{1}.tar.gz'.format(package_name, package_version)
     hard_link_or_raise_exception(filepath, path.join(directory, filename))
Beispiel #3
0
 def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     platform_string = "vmware-esx" if extension == "ova" else platform_string # TODO this needs to change in our build
     dirpath = path.join(self.base_directory, 'packages', package_name, 'releases', package_version,
                         'distributions', platform_string, 'architectures', architecture,
                         'extensions', extension)
     ensure_directory_exists(dirpath)
     hard_link_or_raise_exception(filepath, dirpath)
     self.rebuild_index()
 def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(
         filepath)
     package_dir = path.join(self.base_directory, package_name)
     ensure_directory_exists(package_dir)
     final_filepath = hard_link_or_raise_exception(filepath, package_dir)
     if self._get_latest_update_file_in_directory(
             package_dir) == final_filepath:
         self._extract_update(package_dir, final_filepath)
Beispiel #5
0
 def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     platform_string = "vmware-esx" if extension == "ova" else platform_string # TODO this needs to change in our build
     dirpath = path.join(self.base_directory, 'packages', package_name, 'releases', package_version,
                         'distributions', platform_string, 'architectures', architecture,
                         'extensions', extension)
     ensure_directory_exists(dirpath)
     hard_link_or_raise_exception(filepath, dirpath)
     self.rebuild_index()
Beispiel #6
0
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     except FilenameParsingFailed:
         return False
     if package_name == 'python':
         return False
     if filepath.endswith('deb') and not is_really_deb(filepath):
         return False
     if filepath.endswith('rpm') and not is_really_rpm(filepath):
         return False
     return True
 def _get_latest_update_file_in_directory(self, dirpath):
     from pkg_resources import parse_version
     latest_update_file, latest_version = None, parse_version('0')
     update_files = [
         filepath for filepath in glob(path.join(dirpath, '*.zip'))
         if ARCH in filepath
     ]
     for filepath in update_files:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(
             filepath)
         package_version = parse_version(package_version)
         if package_version > latest_version:
             latest_version = package_version
             latest_update_file = filepath
     return latest_update_file
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(
             filepath)
     except FilenameParsingFailed:
         return False
     if ARCH in architecture:
         return True
     return False
Beispiel #9
0
 def test_parser(self, case):
     actual = parse_filepath(case['basename'])
     self.assertEquals(actual, case['expected'])
Beispiel #10
0
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(
             filepath)
     except FilenameParsingFailed:
         return False
     return platform_string == 'python' and architecture == 'sdist'
Beispiel #11
0
 def consume_file(self, filepath, platform, arch):
     package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     directory = path.join(self.base_directory, package_name)
     ensure_directory_exists(directory)
     filename = '{0}-{1}.tar.gz'.format(package_name, package_version)
     hard_link_or_raise_exception(filepath, path.join(directory, filename))
Beispiel #12
0
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     except FilenameParsingFailed:
         return False
     return platform_string == 'python' and architecture == 'sdist'
Beispiel #13
0
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(
             filepath)
     except FilenameParsingFailed:
         return False
     if package_name == 'python':
         return False
     if filepath.endswith('deb') and not is_really_deb(filepath):
         return False
     if filepath.endswith('rpm') and not is_really_rpm(filepath):
         return False
     return True
 def _get_latest_update_file_in_directory(self, dirpath):
     from pkg_resources import parse_version
     latest_update_file, latest_version = None, parse_version('0')
     update_files = [filepath for filepath in glob(path.join(dirpath, '*.zip')) if ARCH in filepath]
     for filepath in update_files:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
         package_version = parse_version(package_version)
         if package_version > latest_version:
             latest_version = package_version
             latest_update_file = filepath
     return latest_update_file
 def are_you_interested_in_file(self, filepath, platform, arch):
     try:
         package_name, package_version, platform_string, architecture, extension = parse_filepath(filepath)
     except FilenameParsingFailed:
         return False
     if ARCH in architecture:
         return True
     return False