From: Michael Tremer Date: Tue, 28 Jun 2022 09:45:33 +0000 (+0000) Subject: packages: Drop old copy/move functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feb54e5058331330425a42915f84701f2ff7d589;p=pbs.git packages: Drop old copy/move functions Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/packages.py b/src/buildservice/packages.py index f65e2892..1ea841cb 100644 --- a/src/buildservice/packages.py +++ b/src/buildservice/packages.py @@ -371,33 +371,6 @@ class Package(base.DataObject): # Store the path self._set_attribute("path", path) - def copy(self, dst): - if os.path.isdir(dst): - dst = os.path.join(dst, self.filename) - - if os.path.exists(dst): - raise IOError("Destination file exists: %s" % dst) - - src = os.path.join(PACKAGES_DIR, self.path) - - log.debug("Copying %s to %s" % (src, dst)) - - shutil.copy2(src, dst) - - def move(self, target_dir): - # Create directory if it does not exist, yet. - if not os.path.exists(target_dir): - os.makedirs(target_dir) - - # Make full path where to put the file. - target = os.path.join(target_dir, os.path.basename(self.path)) - - # Copy the file to the target directory (keeping metadata). - shutil.move(self.path, target) - - # Update file path in the database. - self._set_attribute("path", os.path.relpath(target, PACKAGES_DIR)) - @lazy_property def build(self): if self.job: