diff options
author | 2017-03-03 23:02:35 +0200 | |
---|---|---|
committer | 2017-03-03 23:03:38 +0200 | |
commit | a92c21c23496c06f0a7056f37db8d8f097f8aa1f (patch) | |
tree | db87340b610af7b8e2ac9532fe368e2db32aa8a2 | |
parent | gnome: Use download.gnome.org instead of ftp with longer paths (diff) | |
download | gentoo-bumpchecker-a92c21c23496c06f0a7056f37db8d8f097f8aa1f.tar.gz gentoo-bumpchecker-a92c21c23496c06f0a7056f37db8d8f097f8aa1f.tar.bz2 gentoo-bumpchecker-a92c21c23496c06f0a7056f37db8d8f097f8aa1f.zip |
gnome: Remove some old scraping related code we won't need
gnome includes a JSON file for each package with all the versions that
many other tools rely on now, so we won't need full scraping again
-rw-r--r-- | modules/gnome_module.py | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/modules/gnome_module.py b/modules/gnome_module.py index 911391a..062fed7 100644 --- a/modules/gnome_module.py +++ b/modules/gnome_module.py @@ -34,10 +34,6 @@ class GNOME: self.gnome_release = ".".join(gnome_release_list[:2]) self.ftpserver = "download.gnome.org" - self.release_directories = ["admin/" + self.major_release + "/" + self.full_release + "/", - "platform/" + self.major_release + "/" + self.full_release + "/", - "desktop/" + self.major_release + "/" + self.full_release + "/", - "bindings/" + self.major_release + "/" + self.full_release + "/"] self.latest_versions_file_path = 'http://www.gnome.org/~vuntz/tmp/versions/' self.latest_versions_url = self.latest_versions_file_path + 'versions-' + self.gnome_release self.release_versions_file_path = 'https://download.gnome.org/teams/releng/' @@ -71,105 +67,6 @@ class GNOME: def generate_data_release(self): return self.generate_data_from_versions_markup(self.release_versions_file_path + self.full_release + '/versions') - """ We might want to modify this later to an extra fallback and/or for non-official modules whose tarballs are hosted on GNOME or compatible FTP - def generate_data_ftp(self): - # Deprecated: connect to ftp and get the list of all the packages in the release directories - walker = ftp_module.FTPWalker(self.ftpserver,"anonymous","test@test.com") - - files = [] - for directory in self.release_directories: - f_files = ftp_module.find_files(walker, directory,"","") - files.extend(f_files) - - # filter out bad files - files = self.filter_files(files) - - # create package objects for the files - release_packages = [] # the packages that are required for a release - for package_name in files: - release_package = package_module.Package(package_name) - release_packages.append(release_package) - - # while connected, find out the latest version of the packages that we found in the - # release directories - latest_packages = [] # the latest versions of packages on the gnome ftp. - for package in release_packages: - file_list = ftp_module.find_files(walker, "pub/GNOME/sources" + "/" + package.raw_name + "/" + package.major_minor,"","") - - # if maintainers release tarballs late, they will not get picked up - # therefore, if the tarball is 1 less than the y of the x.y you - # specify, lets also check to see if there are any files for - # the actual release number. - major = package.major_minor.split(".")[0] - minor = package.major_minor.split(".")[1] - options = clioptions_module.Options() - args = options.get_arguments() - release_minor = args.release_number.split(".")[1] - - if int(minor) == (int(release_minor) -1): - file_list_future = ftp_module.find_files(walker, "pub/GNOME/sources" + "/" + package.raw_name + "/" + major + "." + str(int(minor)+1),"","") - - # if there are results, replace the old list. - if len(file_list_future) > 0: - file_list = file_list_future - elif self.nextrev == True: - # Try to find minor+1 - file_list_future = ftp_module.find_files(walker, "pub/GNOME/sources" + "/" + package.raw_name + "/" + major + "." + str(int(minor)+1),"","") - - # if there are results, replace the old list. - if len(file_list_future) > 0: - file_list = file_list_future - - # make sure we don't try to do this on directories with no files, - # or on directories that don't exist - - # create package objects for the files - if len(file_list) > 0: - latest = self.filter_latest_only(file_list) - latest_package = package_module.Package(package.name + "-" + latest) - latest_packages.append(latest_package) - - # disconnect from the ftp - - # cache the results - cache = simple_cache_module.SimpleCache() - for release_package in release_packages: - latest_package = portage_module.findpackage(release_package.name, latest_packages) - if latest_package != None: - cache.write_to_queue(release_package.name_plus_version_plus_revision, latest_package.name_plus_version_plus_revision) - else: - print "No matching latest package!" + str(release_package.name) - cache.flush_queue() - - return (release_packages, latest_packages) - """ - - def filter_files(self, files): - # we want to filter out all the bad files. - newfiles = [] - for file in files: - # only keep files with .tar.bz2 ending. - if 0 < file.find(".tar.") and 0 < file.find(".bz2"): - file = file.replace(".tar.bz2", "") - newfiles.append(file) - - return newfiles - - # this needs to be fixed so that if a directory doesn't have LATEST-IS-, it returns an error - def filter_latest_only(self, lines): - latest_string = "LATEST-IS-" - latest = "" - for item in lines: - if 0 <= item.string.rfind(latest_string): - latest = item - - try: - return_latest = latest[10:] - except: - return_latest = "" - - return return_latest - import portage_module def compare_packages(release_packages, latest_packages, packages_in_portage): # we care about 5 cases |