From 26f8ce4eefd9c0e6d3858480b4d97df4f62a7454 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Mon, 7 Jan 2013 23:17:22 -0800 Subject: [PATCH] catalyst: Add 'snapshot_name' default W. Trevor King: Refactored Git history for Brian Dolbec's content changes. Reviewed-by: Matt Turner Signed-off-by: W. Trevor King Signed-off-by: Brian Dolbec --- catalyst | 1 + modules/generic_stage_target.py | 6 ++++-- modules/snapshot_target.py | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/catalyst b/catalyst index 0fc65b0d..131529ae 100755 --- a/catalyst +++ b/catalyst @@ -68,6 +68,7 @@ def parse_config(myconfig): "portdir": "/usr/portage", "repo_name": "portage", "sharedir": "/usr/share/catalyst", + "snapshot_name": "portage-", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", "storedir": "/var/tmp/catalyst", } diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 6ee35d28..63661fe1 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -410,7 +410,8 @@ class generic_stage_target(generic_target): def set_snapshot_path(self): self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ - "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") + "/snapshots/" + self.settings["snapshot_name"] + + self.settings["snapshot"] + ".tar.xz") if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"]=\ @@ -418,7 +419,8 @@ class generic_stage_target(generic_target): hash_function=self.settings["hash_function"],verbose=False) else: self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") + "/snapshots/" + self.settings["snapshot_name"] + + self.settings["snapshot"] + ".tar.bz2") if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"]=\ diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py index 02b98316..ba1bab55 100644 --- a/modules/snapshot_target.py +++ b/modules/snapshot_target.py @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target): self.settings=myspec self.settings["target_subpath"]="portage" st=self.settings["storedir"] - self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ - +".tar.bz2") + self.settings["snapshot_path"] = normpath(st + "/snapshots/" + + self.settings["snapshot_name"] + + self.settings["version_stamp"] + ".tar.bz2") self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) def setup(self): -- 2.26.2