diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-25 01:12:14 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-25 01:12:14 +0000 |
commit | 6a5d8c66b3e389664b47fe4b24ca8b5623a7fb3f (patch) | |
tree | 3ae12132088f84916d4ee808aaeb3938c6053fbb /pym | |
parent | 66e6165b149d3b5f343e3a9231edde103d0ce8c0 (diff) | |
download | portage-6a5d8c66b3e389664b47fe4b24ca8b5623a7fb3f.tar.gz portage-6a5d8c66b3e389664b47fe4b24ca8b5623a7fb3f.tar.bz2 portage-6a5d8c66b3e389664b47fe4b24ca8b5623a7fb3f.zip |
Remove code from unused config.load_infodir() method and issue a deprecation
warning if it's called. (trunk r12275)
svn path=/main/branches/2.1.6/; revision=12308
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/__init__.py | 70 |
1 files changed, 3 insertions, 67 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 75a71a752..09eeb85cb 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1855,73 +1855,9 @@ class config(object): self.regenerate(use_cache=use_cache) def load_infodir(self,infodir): - self.modifying() - backup_pkg_metadata = dict(self.configdict["pkg"].iteritems()) - if "pkg" in self.configdict and \ - "CATEGORY" in self.configdict["pkg"]: - self.configdict["pkg"].clear() - self.configdict["pkg"]["CATEGORY"] = \ - backup_pkg_metadata["CATEGORY"] - else: - raise portage.exception.PortageException( - "No pkg setup for settings instance?") - - retval = 0 - found_category_file = False - if os.path.isdir(infodir): - if os.path.exists(infodir+"/environment"): - self.configdict["pkg"]["PORT_ENV_FILE"] = infodir+"/environment" - - myre = re.compile('^[A-Z]+$') - null_byte = "\0" - for filename in listdir(infodir,filesonly=1,EmptyOnError=1): - if filename == "FEATURES": - # FEATURES from the build host shouldn't be interpreted as - # FEATURES on the client system. - continue - if filename == "CATEGORY": - found_category_file = True - continue - if myre.match(filename): - try: - file_path = os.path.join(infodir, filename) - mydata = open(file_path).read().strip() - if len(mydata) < 2048 or filename == "USE": - if null_byte in mydata: - writemsg("!!! Null byte found in metadata " + \ - "file: '%s'\n" % file_path, noiselevel=-1) - continue - if filename == "USE": - binpkg_flags = "-* " + mydata - self.configdict["pkg"][filename] = binpkg_flags - self.configdict["env"][filename] = mydata - else: - self.configdict["pkg"][filename] = mydata - self.configdict["env"][filename] = mydata - except (OSError, IOError): - writemsg("!!! Unable to read file: %s\n" % infodir+"/"+filename, - noiselevel=-1) - pass - retval = 1 - - # Missing or corrupt CATEGORY will cause problems for - # doebuild(), which uses it to infer the cpv. We already - # know the category, so there's no need to trust this - # file. Show a warning if the file is missing though, - # because it's required (especially for binary packages). - if not found_category_file: - writemsg("!!! CATEGORY file is missing: %s\n" % \ - os.path.join(infodir, "CATEGORY"), noiselevel=-1) - self.configdict["pkg"].update(backup_pkg_metadata) - retval = 0 - - # Always set known good values for these variables, since - # corruption of these can cause problems: - cat, pf = catsplit(self.mycpv) - self.configdict["pkg"]["CATEGORY"] = cat - self.configdict["pkg"]["PF"] = pf - - return retval + warnings.warn("portage.config.load_infodir() is deprecated", + DeprecationWarning) + return 1 def setcpv(self, mycpv, use_cache=1, mydb=None): """ |