[PATCH 5/7] targets/snapshot.py: Update the code and log messages to use the configured repo_name

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 5/7] targets/snapshot.py: Update the code and log messages to use the configured repo_name

Brian Dolbec-3
From b5410d12852222fca19e01cfdcbb37e87b6f21ff Mon Sep 17 00:00:00 2001
From: Brian Dolbec <[hidden email]>
Date: Thu, 9 Mar 2017 01:17:07 -0800
Subject: [PATCH 5/7] targets/snapshot.py: Update the code and log messages to
 use the configured repo_name
To: [hidden email]

One more portage name seperation from being used to represent the ebuild repository.
---
 catalyst/targets/snapshot.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index 8a9acdd9..087834eb 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -22,7 +22,7 @@ class snapshot(TargetBase, GenBase):
  TargetBase.__init__(self, myspec, addlargs)
  GenBase.__init__(self,myspec)
  #self.settings=myspec
- self.settings["target_subpath"]="portage"
+ self.settings["target_subpath"]="repos"
  st=self.settings["storedir"]
  self.settings["snapshot_path"] = normpath(st + "/snapshots/"
  + self.settings["snapshot_name"]
@@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase):
 
  success = True
  self.setup()
- log.notice('Creating Portage tree snapshot %s from %s ...',
- self.settings['version_stamp'], self.settings['portdir'])
+ log.notice('Creating %s tree snapshot %s from %s ...',
+ self.settings["repo_name"], self.settings['version_stamp'],
+ self.settings['portdir'])
 
  mytmp=self.settings["tmp_path"]
  ensure_dirs(mytmp)
@@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase):
  mytmp + '/' + self.settings['repo_name'] + '/'],
  env=self.env)
 
- log.notice('Compressing Portage snapshot tarball ...')
+ log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"])
  compressor = CompressMap(self.settings["compress_definitions"],
  env=self.env, default_mode=self.settings['compression_mode'],
  comp_prog=self.settings["comp_prog"])
@@ -93,9 +94,9 @@ class snapshot(TargetBase, GenBase):
  def kill_chroot_pids(self):
  pass
 
- @staticmethod
- def cleanup():
+ def cleanup(self):
  log.info('Cleaning up ...')
+ self.purge()
 
  def purge(self):
  clear_dir(self.settings['tmp_path'])
--
2.12.0



--
Brian Dolbec <dolsen>