Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 348634 Details for
Bug 212403
dev-util/catalyst: automatically clear autoresume points if spec has been modified
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
This is a patch to clear the autoresume point in Catalyst if the spec file being used is modified.
0001-Clears-autoresume-point-if-spec-file-has-been-change.patch (text/plain), 2.63 KB, created by
Devan Franchini (RETIRED)
on 2013-05-19 06:20:32 UTC
(
hide
)
Description:
This is a patch to clear the autoresume point in Catalyst if the spec file being used is modified.
Filename:
MIME Type:
Creator:
Devan Franchini (RETIRED)
Created:
2013-05-19 06:20:32 UTC
Size:
2.63 KB
patch
obsolete
>From 5625dc6eb805178addf16f281f55abdb29c55648 Mon Sep 17 00:00:00 2001 >From: Devan Franchini <twitch153@hotmail.com> >Date: Sun, 19 May 2013 02:14:35 -0400 >Subject: [PATCH] Clears autoresume point if spec file has been changed > >--- > catalyst/hash_utils.py | 41 +++++++++++++++++++++++++++++++++++++++-- > catalyst/main.py | 3 +++ > 2 files changed, 42 insertions(+), 2 deletions(-) > >diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py >index cd31ad3..8cfa1a7 100644 >--- a/catalyst/hash_utils.py >+++ b/catalyst/hash_utils.py >@@ -102,5 +102,42 @@ class HashMap(object): > print header+" (%s) = %s" % (short_file, result) > return result > >- >- >+ def gen_chksumfile(self, file_, filename, storedir, hash_type, exit_on_error=True): >+ filename = filename+"."+hash_type >+ modtime = os.path.getmtime(file_) >+ try: >+ with open(os.path.join(storedir,filename), 'w') as chksumfile: >+ chksumfile.write(filename+""+modtime+""+self.calc_hash2(file_, hash_type)) >+ return True >+ except IOError: >+ if exit_on_error: >+ raise CatalystError("Could not generate checksum for " + file_, print_traceback=True) >+ else: >+ return False >+ >+ def evaluate_spec(self, spec, chksumfile, hash_type): >+ with open(chksumfile, 'r') as specfile: >+ lines = specfile.readlines() >+ for line in lines: >+ filename, modtime, chksum = line.split() >+ modtime_n = os.path.getmtime(spec) >+ # First check the modification time to save >+ # resources, if it hasn't been modified, >+ # don't bother generating a second checksum. >+ if not modtime == modtime_n: >+ chksum_n = self.calc_hash2(spec, hash_type) >+ if not chksum == chksum_n: >+ return False >+ else: >+ return True >+ else: >+ return True >+ >+ def check_chksum(self, spec, filename, storedir, hash_type): >+ file_location=os.path.join(storedir,filename+"."+hash_type) >+ if os.path.exists(file_location): >+ return self.evaluate_spec(spec, file_location, hash_type) >+ else >+ # If the checksum doesn't exist, this is the first time >+ # using this spec file, so no need to check against it. >+ return self.gen_chksum(spec, filename, storedir, hash_type) >diff --git a/catalyst/main.py b/catalyst/main.py >index 05904ec..e320842 100644 >--- a/catalyst/main.py >+++ b/catalyst/main.py >@@ -329,6 +329,9 @@ def main(): > > if myspecfile: > spec = catalyst.config.SpecParser(myspecfile) >+ filename = settings["target"]+settings["subarch"]+settings["versionstamp"] >+ if not hash_map.check_chksum(myspecfile, filename, settings["storedir"], "sha512": >+ addlargs["clear-autoresume"] > addlargs.update(spec.get_values()) > > if mycmdline: >-- >1.8.1.5 > >twitch153@Octo_Azul ~/workspace/catalyst/catalyst $ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212403
:
348634
|
348954
|
348960