Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/
Date: Thu, 26 Feb 2015 19:25:41
Message-Id: 1424978120.5c79385fc2a02d4e539ef5fe646397da98f72bde.dolsen@gentoo
1 commit: 5c79385fc2a02d4e539ef5fe646397da98f72bde
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 1 07:31:59 2013 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 26 19:15:20 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=5c79385f
7
8 Rename local unpack var to _unpack
9
10 The method name was unpack, so rename the local var to _unpack to help avoid confusion.
11
12 ---
13 catalyst/base/stagebase.py | 18 +++++++++---------
14 catalyst/targets/livecd_stage2.py | 6 +++---
15 2 files changed, 12 insertions(+), 12 deletions(-)
16
17 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
18 index f8443d8..bdeaedd 100644
19 --- a/catalyst/base/stagebase.py
20 +++ b/catalyst/base/stagebase.py
21 @@ -662,7 +662,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
22 raise CatalystError("Unable to auto-unbind " + target)
23
24 def unpack(self):
25 - unpack=True
26 + _unpack=True
27
28 clst_unpack_hash = self.resume.get("unpack")
29
30 @@ -712,49 +712,49 @@ class StageBase(TargetBase, ClearBase, GenBase):
31 if os.path.isdir(self.settings["source_path"]) \
32 and self.resume.is_enabled("unpack"):
33 """ Autoresume is valid, SEEDCACHE is valid """
34 - unpack=False
35 + _unpack=False
36 invalid_snapshot=False
37
38 elif os.path.isfile(self.settings["source_path"]) \
39 and self.settings["source_path_hash"]==clst_unpack_hash:
40 """ Autoresume is valid, tarball is valid """
41 - unpack=False
42 + _unpack=False
43 invalid_snapshot=True
44
45 elif os.path.isdir(self.settings["source_path"]) \
46 and self.resume.is_disabled("unpack"):
47 """ Autoresume is invalid, SEEDCACHE """
48 - unpack=True
49 + _unpack=True
50 invalid_snapshot=False
51
52 elif os.path.isfile(self.settings["source_path"]) \
53 and self.settings["source_path_hash"]!=clst_unpack_hash:
54 """ Autoresume is invalid, tarball """
55 - unpack=True
56 + _unpack=True
57 invalid_snapshot=True
58 else:
59 """ No autoresume, SEEDCACHE """
60 if "seedcache" in self.settings["options"]:
61 """ SEEDCACHE so let's run rsync and let it clean up """
62 if os.path.isdir(self.settings["source_path"]):
63 - unpack=True
64 + _unpack=True
65 invalid_snapshot=False
66 elif os.path.isfile(self.settings["source_path"]):
67 """ Tarball so unpack and remove anything already there """
68 - unpack=True
69 + _unpack=True
70 invalid_snapshot=True
71 """ No autoresume, no SEEDCACHE """
72 else:
73 """ Tarball so unpack and remove anything already there """
74 if os.path.isfile(self.settings["source_path"]):
75 - unpack=True
76 + _unpack=True
77 invalid_snapshot=True
78 elif os.path.isdir(self.settings["source_path"]):
79 """ We should never reach this, so something is very wrong """
80 raise CatalystError(
81 "source path is a dir but seedcache is not enabled")
82
83 - if unpack:
84 + if _unpack:
85 self.mount_safety_check()
86
87 if invalid_snapshot:
88
89 diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
90 index 38b6884..45a6767 100644
91 --- a/catalyst/targets/livecd_stage2.py
92 +++ b/catalyst/targets/livecd_stage2.py
93 @@ -86,7 +86,7 @@ class livecd_stage2(StageBase):
94 myf.close()
95
96 def unpack(self):
97 - unpack=True
98 + _unpack=True
99 display_msg=None
100
101 clst_unpack_hash = self.resume.get("unpack")
102 @@ -102,12 +102,12 @@ class livecd_stage2(StageBase):
103 if os.path.isdir(self.settings["source_path"]) and \
104 self.resume.is_enabled("unpack"):
105 print "Resume point detected, skipping unpack operation..."
106 - unpack=False
107 + _unpack=False
108 elif "source_path_hash" in self.settings:
109 if self.settings["source_path_hash"] != clst_unpack_hash:
110 invalid_snapshot=True
111
112 - if unpack:
113 + if _unpack:
114 self.mount_safety_check()
115 if invalid_snapshot:
116 print "No Valid Resume point detected, cleaning up ..."