Merge lp://qastaging/~deeptik/linaro-image-tools/fix_bug_Bug816767 into lp://qastaging/linaro-image-tools/11.11
Proposed by
Deepti B. Kalakeri
Status: | Merged |
---|---|
Approved by: | James Westby |
Approved revision: | no longer in the source branch. |
Merged at revision: | 404 |
Proposed branch: | lp://qastaging/~deeptik/linaro-image-tools/fix_bug_Bug816767 |
Merge into: | lp://qastaging/linaro-image-tools/11.11 |
Diff against target: |
183 lines (+46/-47) 1 file modified
linaro-hwpack-replace (+46/-47) |
To merge this branch: | bzr merge lp://qastaging/~deeptik/linaro-image-tools/fix_bug_Bug816767 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby (community) | Approve | ||
Review via email:
|
Description of the change
This patch fixes the bug Bug #816767 [linaro-
It now replaces old deb (with a different name) package with a new hwpack,
so that l-m-c can determine which package is to be installed in later hwpack installation.
The changes adds the new option --prefix-pkg-remove to handle this where the user is needed to provide the
prefix of the debian package that needs to be removed while including the new one.
To post a comment you must log in.
Hi Deepti,
This looks quite good; I've only a few suggestions.
On Thu, 2011-08-04 at 16:38 +0000, Deepti B. Kalakeri wrote: hwpack- replace' hwpack- replace 2011-08-03 11:29:43 +0000 hwpack- replace 2011-08-04 16:38:27 +0000 ArgumentParser( ) add_argument( "-t", "--hwpack_name", dest="hwpack_name", add_argument( "-p", "--deb_pack", dest="deb_pack", add_argument( "-t", "--hwpack-name", dest="hwpack_name", add_argument( "-p", "--deb-pack", dest="deb_pack", add_argument( "-r", "--prefix- pkg-remove" , dest="prefix_ pkg_remove" ,
> === modified file 'linaro-
> --- linaro-
> +++ linaro-
> @@ -36,10 +36,12 @@
>
>
> parser = argparse.
> -parser.
> - help="Specific hwpack_name to use (default: None)")
> -parser.
> +parser.
> + help="Specific hwpack-name to use (default: None)")
> +parser.
> help="Specific debian package to replace (default: None).")
> +parser.
> + help="Specific debian package to remove (default: None).")
The user actually specifies the name prefix of the packages that should
be removed and not the actual package, so the help text above is not
correct. It also mentions a default value, which doesn't make much sense
to me as the argument is required, no?
> parser. add_argument( "-d", "--debug-output", action= "store_ true", dest="debug", manifest_ info(tempdir, new_debpack_info, deb_pack_found): manifest_ info(tempdir, new_debpack_info, prefix_pkg_remove): manifest_ fname = os.path. join(tempdir, "manifest") info.name, new_debpack_ info.version) FileInput( debpack_ manifest_ fname, inplace=1): info.name == package_name: write(line) debug(" Adding the new debian package info to manifest") manifest_ fname, "a") new_debpack_ line) debug(" Replaced the old debian package information "\ Packages_ info(debpack_ dirname, new_debpack_info): h("%s" % prefix_pkg_remove) or \
> help="Verbose messages are displayed when specified")
>
> -def modify_
> +def modify_
> """ Modify the manifest file to include the new debian information """
>
> debpack_
> new_debpack_line = '%s=%s\n' % (new_debpack_
>
> for line in fileinput.
> - if '=' in line:
> - package_name, version = line.split('=')
> - old_debpack = '%s=%s' % (package_name, version)
> - else:
> - package_name = line.rstrip("\n")
> - old_debpack = '%s' % package_name
> -
> - if new_debpack_
> - deb_pack_found = 1
> - line = new_debpack_line
> - sys.stdout.
> -
> - if deb_pack_found == 0:
> - logger.
> - fout = open(debpack_
> - fout.write(
> - fout.close()
> - else:
> - logger.
> - "with the new information")
> -
> -
> -def modify_
> + if not (line.startswit
You don't need the backslash here because of the parenthesis around the
two line.startswith() calls.
> + line.startswith ("hwpack- linaro" )):
I, for one, will surely not remember why we need this when I come back
from holidays, and I'm sure others who didn't participate in the
discussion where we realized it was necessary would be equally confused,
so it's important to leave a comment here...