From eb0e8d7b0ed721aa2c2d06bf6077723ab210b2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 11 Jul 2006 17:52:06 +0000 Subject: [PATCH] =?UTF-8?q?xdelta=20g=C3=BCle=20g=C3=BCle,=20silinen=20hed?= =?UTF-8?q?elerden=20ortaya=20=C3=A7=C4=B1kan=20bir=20sorun=20bulamad?= =?UTF-8?q?=C4=B1m=20(t=C3=BCm=20testleri=20ge=C3=A7iyor,=20paket=20kaynak?= =?UTF-8?q?=20kodu=20=C3=A7ekiyor,=20index=20g=C3=BCncelliyor,=20ikili=20d?= =?UTF-8?q?epodan=20paket=20al=C4=B1yor.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/configfile.py | 2 -- pisi/constants.py | 1 - pisi/package.py | 40 +--------------------------------------- pisi/util.py | 14 -------------- 4 files changed, 1 insertion(+), 56 deletions(-) diff --git a/pisi/configfile.py b/pisi/configfile.py index 6bcbb922..ba5c67f5 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -20,7 +20,6 @@ #[general] #destinationdirectory = / #autoclean = False -#xdelta = False # #[build] #host = i686-pc-linux-gnu @@ -59,7 +58,6 @@ class GeneralDefaults: """Default values for [general] section""" destinationdirectory = "/" autoclean = False - xdelta = False distribution = "Pardus" distribution_release = "1.1" http_proxy = os.getenv("HTTP_PROXY") or None diff --git a/pisi/constants.py b/pisi/constants.py index 1e29d64f..40445d15 100644 --- a/pisi/constants.py +++ b/pisi/constants.py @@ -47,7 +47,6 @@ class Constants: def __init__(self): # suffix for package names self.__c.package_suffix = ".pisi" - self.__c.xdelta_suffix = ".xdelta" # suffix for lzma self.__c.lzma_suffix = ".lzma" diff --git a/pisi/package.py b/pisi/package.py index 48e2f482..1de13e18 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -41,48 +41,10 @@ class Package: url = URI(packagefn) if url.is_remote_file(): - from fetcher import fetch_url, FetchError + from fetcher import fetch_url dest = ctx.config.packages_dir() self.filepath = join(dest, url.filename()) - # get current package name without version info (like tasma) - current_pkg = util.pure_package_name(url.filename()) - - # if package is installed (which means we are upgrading it), - # calculate needed info - if ctx.installdb.is_installed(current_pkg) and ctx.config.values.general.xdelta: - installed = True - - # calculate currently installed package's name and pisi file's location - (version, release, build) = ctx.installdb.get_version(current_pkg) - current = util.package_name(current_pkg, version, release, build, prependSuffix=False) - current_fn = join(dest, current) + ctx.const.package_suffix - - # calculate xdelta file location (format: oldpackage_newpackage.xdelta) - # ex: tasma-1.0.2-4-1_tasma-1.0.3-5-2.xdelta - delta = basename(url.filename()).rstrip(ctx.const.package_suffix) - delta = "%s_%s" % (current, delta) + ctx.const.xdelta_suffix - - # create xdelta_url for fetching - xdelta_url = URI(join(dirname(str(url)), delta)) - xdelta_fn = join(dest, xdelta_url.filename()) - else: - installed = False - - if installed and exists(current_fn) and ctx.config.values.general.xdelta: - # if package is installed and old pisi file exists, fetch xdelta - if not exists(xdelta_fn): - ctx.ui.info(_("Trying to fetch xdelta: %s") % xdelta_url) - try: - fetch_url(xdelta_url, dest, ctx.ui.Progress) - except FetchError,e: - ctx.ui.warning(_('XDelta %s: not exists') % xdelta_url) - else: - # generate new one using old pisi file and xdelta - util.generate_pisi_file(xdelta_fn, current_fn, self.filepath) - else: - util.generate_pisi_file(xdelta_fn, current_fn, self.filepath) - # FIXME: exists is not enough, also sha1sum check needed # when implemented in pisi-index.xml if not exists(self.filepath): diff --git a/pisi/util.py b/pisi/util.py index c7bbab96..6ef0ca17 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -642,15 +642,6 @@ def env_update(): pisi.environment.update_environment(ctx.config.dest_dir()) -def pure_package_name(package_name): - "return pure package name from given string" - "ex: package_name=tasma-1.0.3-5-2.pisi, returns tasma" - - if package_name.endswith(ctx.const.package_suffix): - package_name = package_name.rstrip(ctx.const.package_suffix) - - return parse_package_name(package_name)[0] - def parse_package_name(package_name): "return package name and version string" "ex: package_name=tasma-1.0.3-5-2, returns (tasma, 1.0.3-5-2)" @@ -666,8 +657,3 @@ def parse_package_name(package_name): version = package_name[len(name) + 1:] return (name, version) - -def generate_pisi_file(patchFile, fromFile, toFile): - if run_batch("xdelta patch %s %s %s" % (patchFile, fromFile, toFile))[0]: - raise Error(_("ERROR: xdelta patch %s %s %s failed") % (patchFile, fromFile, toFile)) -