Pull any properties out of the VERSION file that are from older
versions of HDFS and only necessary during upgrade.
430202
private void setDeprecatedPropertiesForUpgrade(Properties props) {
    deprecatedProperties = new HashMap<String, String>();
    String md5 = props.getProperty(MESSAGE_DIGEST_PROPERTY);
    if (md5 != null) {
      deprecatedProperties.put(MESSAGE_DIGEST_PROPERTY, md5);
    }
  }
1113612
def prev_deps(env):
    """"""
    # TODO something more clever.
    if not os.path.isfile(env.envctoxfile):
        return []

    with open(env.envctoxfile) as f:
        return f.read().split()
380165
def from_version(self, version, require_https=False):
        
        if version is None or self.version() == version:
            return self
        else:
            return Hive.from_url(self.get_version_url(version), require_https=require_https)
341574
function extractPackageVersion(inPath) {
    if (!inPath) {
        throw new Error('Input path argument is required');
    }

    // Require here so we have the update version.
    const pkg = fs.readFileSync(inPath, 'utf-8');

    // index 0 is line that matched, index 1 is first control group (version number in this case)
    const matches = /"version": "([0-9]+\.[0-9]+\.[0-9]+)"/.exec(pkg);
    const version = matches[1];

    return version;
}
965835
def get_versions():
    """"""
    # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
    # __file__, we can work backwards from there to the root. Some
    # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
    # case we can only use expanded keywords.

    cfg = get_config()
    verbose = cfg.verbose

    try:
        return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
                                          verbose)
    except NotThisMethod:
        pass

    try:
        root = os.path.realpath(__file__)
        # versionfile_source is the relative path from the top of the source
        # tree (where the .git directory might live) to this file. Invert
        # this to find the root from __file__.
        for i in cfg.versionfile_source.split('/'):
            root = os.path.dirname(root)
    except NameError:
        return {"version": "0+unknown", "full-revisionid": None,
                "dirty": None,
                "error": "unable to find root of source tree"}

    try:
        pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
        return render(pieces, cfg.style)
    except NotThisMethod:
        pass

    try:
        if cfg.parentdir_prefix:
            return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
    except NotThisMethod:
        pass

    _version_path = os.path.join(os.path.dirname(__file__), '_version')
    if os.path.exists(_version_path):
        with open(_version_path) as f:
            l = f.readline().strip()
            return {
                'version': l,
                'error': None,
                'dirty': None,
                'full-revisionid': l
            }

    return {"version": "0+unknown", "full-revisionid": None,
            "dirty": None,
            "error": "unable to compute version"}
261553
private String extractNumericVersion(Collection<String> versionStrings) {
        if (versionStrings == null) {
            return "";
        }
        for (String value : versionStrings) {
            String releaseValue = calculateReleaseVersion(value);
            if (!releaseValue.equals(value)) {
                return releaseValue;
            }
        }
        return "";
    }
169642
def cleanup(bucket, prefix, versions)
      objects = @con.get_bucket(bucket, :prefix => prefix).body['Contents']

      return if objects.size <= versions

      objects[0...(objects.size - versions)].each do |o|
       Mongolicious.logger.info("Removing outdated version #{o['Key']}")
       @con.delete_object(bucket, o['Key'])
      end
    end
547964
def hashes_get(versions_file, base_path):
    
    files = versions_file.files_get_all()
    result = {}
    for f in files:
        try:
            result[f] = functions.md5_file(base_path + f)
        except IOError:
            # Not all files exist for all versions.
            pass

    return result
931716
private synchronized void copyMetaFilesForUpgrade() throws IOException {
    Configuration conf = new Configuration();
    File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
    File prevDir = journalStorage.getSingularStorageDir().getPreviousTmp();
    FileSystem fs = FileSystem.getLocal(conf).getRaw();

    FileUtil.copy(new File(prevDir, LAST_PROMISED_FILENAME), fs, new File(
        currentDir, LAST_PROMISED_FILENAME), false, conf);
    FileUtil.copy(new File(prevDir, LAST_WRITER_EPOCH), fs, new File(
        currentDir, LAST_WRITER_EPOCH), false, conf);
    FileUtil.copy(new File(prevDir, COMMITTED_TXID_FILENAME), fs, new File(
        currentDir, COMMITTED_TXID_FILENAME), false, conf);
    FileUtil.copy(new File(prevDir, JNStorage.PAXOS_DIR), fs, new File(
        currentDir, JNStorage.PAXOS_DIR), false, conf);
  }
530099
def get_highest_version(versions):
    
    sorted_versions = []
    for ver in versions:
        sorted_versions.append((pkg_resources.parse_version(ver), ver))

    sorted_versions = sorted(sorted_versions)
    sorted_versions.reverse()
    return sorted_versions[0][1]
548538
def versions(self, rev=None, index=None):
        """"""
        raise NotImplementedError
        _revisions = [line.split()[0] for line in self.log.split('\n') if line]
        _versions = [Version(self.obj.repo.commit(r)) for r in _revisions if rev is None or r.startswith(rev)]
        if index is not None and len(_versions) > index:
            _versions = _versions[index]
        return _versions
1193881
def obsolete_files
      out = (existing_files - new_files - new_dirs + replaced_files).to_a
      Jekyll::Hooks.trigger :clean, :on_obsolete, out
      out
    end
1292535
function skip() {
    rimraf(file, function() {})
    delete f.versions[v]
    if (f._attachments)
      delete f._attachments[file]
    need.splice(need.indexOf(v), 1)
    maybeDone(null)
  }
1056833
def _version_from_file(
        path_to_version,
        default_version=DEFAULT_VERSION,
):
    
    version_filepath = os.path.join(path_to_version, 'version.txt')
    if not os.path.isfile(version_filepath):
        warnings.warn(
            'Unable to resolve current version',
            exceptions.ProsperDefaultVersionWarning)
        return default_version

    with open(version_filepath, 'r') as v_fh:
        data = v_fh.read()

    return data
130950
def get_version_from_file(path):
    
    filename = os.path.join(path, VERSION_FILE)
    if not os.path.isfile(filename):
        # Look in the parent directory of path instead.
        filename = os.path.join(os.path.dirname(path), VERSION_FILE)
        if not os.path.isfile(filename):
            filename = ''

    if filename:
        with open(filename) as fh:
            version = fh.readline().strip()
            if version:
                return version
1370720
def get_versioned_files(cls):
        """"""
        encoding = cls._get_terminal_encoding()
        output = run(['bzr', 'ls', '-VR'], encoding=encoding)
        return output.splitlines()
181335
def get_versions(default={"version": "unknown", "full": ""}, verbose=False):
    """"""

    # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
    # __file__, we can work backwards from there to the root. Some
    # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
    # case we can only use expanded keywords.

    keywords = { "refnames": git_refnames,
                 "full_revisionid": git_full_revisionid,
                 "short_revisionid": git_short_revisionid }
    ver = git_versions_from_keywords(keywords, tag_prefix, verbose)
    if ver:
        return ver

    try:
        root = os.path.abspath(__file__)
        # versionfile_source is the relative path from the top of the source
        # tree (where the .git directory might live) to this file. Invert
        # this to find the root from __file__.
# TODO(dustin): Shouldn't this always loop until it fails?
        for i in range(len(versionfile_source.split(os.sep))):
            root = os.path.dirname(root)
    except NameError:
        return default

    return (git_versions_from_vcs(tag_prefix, root, verbose)
            or versions_from_parentdir(parentdir_prefix, root, verbose)
            or default)