On Fri, 14 Jan 2011, John Fischer wrote:
Alok,
Thanks for looking over the DC changes. I really appreciate it.
John
On 01/14/11 11:06 AM, Alok Aggarwal wrote:
Yes, please move it to AIPrePkgImgMod since only AI uses it right
now.
So moved.
Here are my comments for pre_pkg_img_mod.py, I looked at that file
only:
230: Why change the mode to 'a'? I think we want to truncate
that file if it exists.
OK. I'll add a comment above the self.add_versions() file stating
that it needs to be done after self.calculate_size().
227, 238: Since both these functions need this path it should
probably be moved up to the parse_doc function above around
line 99.
Moved.
241, 244, 247, 254: These try/excepts are not needed. The build
will continue even in the case of errors with these try/excepts
in place.
Removed.
250-253: Nit. This may be simplified as:
for line in img_fh.readlines():
img_fh.write(line)
I am reading a version file located in /usr/share/auto-install and
adding the lines that do not start with a comment into the .image_info
file. I use the TextFile class to read the versions file which does
the remove comment lines and left most white-space from the line.
TextFile does not have a readlines() method within the class.
However, the readline() method returns None when EOF is encounter.
Okay, the suggested change is moot then. I'm good with
the changes.
Alok
When the try/except blocking is removed it might be a little easier
to follow:
# append the .image_info file with the version file information
with open(self.img_info_path, "a") as img_fh:
version_fh = TextFile(filename=img_version_path, lstrip_ws=True)
# the version file open()
version_line = version_fh.readline() # priming the while
loop control
while version_line: # loop
until EOF
img_fh.write(version_line) # writing
version data into .image_file
version_line = version_fh.readline() # updating the
while loop control
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss