Remove duplicated functions in munkilib/updatecheck/download.py due to bad merge confict resolution

This commit is contained in:
Greg Neagle
2018-11-16 11:46:37 -08:00
parent b3e33b34ac
commit 8b1e2ba9ac

View File

@@ -111,25 +111,6 @@ def enough_disk_space(item_pl, installlist=None,
return False
def get_url_basename(url):
"""For a URL, absolute or relative, return the basename string.
e.g. "http://foo/bar/path/foo.dmg" => "foo.dmg"
"/path/foo.dmg" => "foo.dmg"
"""
url_parse = urlparse.urlparse(url)
return os.path.basename(url_parse.path)
def get_download_cache_path(url):
"""For a URL, return the path that the download should cache to.
Returns a string."""
cachedir = os.path.join(prefs.pref('ManagedInstallDir'), 'Cache')
return os.path.join(cachedir, get_url_basename(url))
def download_installeritem(item_pl,
installinfo, uninstalling=False, precaching=False):
"""Downloads an (un)installer item.