diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-03 10:59:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-05 10:22:56 -0800 |
commit | 06f2f8ce0a3093973ca54b48f542f8485b666079 (patch) | |
tree | dbcfa5c491eb2e5d237aa539cb7c6e77dc07dd6f /meta/classes/package_tar.bbclass | |
parent | d01dadfb87cfd2284b3e849d35a35fe5df0239c4 (diff) | |
download | poky-06f2f8ce0a3093973ca54b48f542f8485b666079.tar.gz |
meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:
sed \
-e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
-e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
-i `grep -ril getVar *`
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_tar.bbclass')
-rw-r--r-- | meta/classes/package_tar.bbclass | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass index 201bd91657..7590177e4b 100644 --- a/meta/classes/package_tar.bbclass +++ b/meta/classes/package_tar.bbclass | |||
@@ -9,9 +9,9 @@ python package_tar_fn () { | |||
9 | } | 9 | } |
10 | 10 | ||
11 | python package_tar_install () { | 11 | python package_tar_install () { |
12 | pkg = d.getVar('PKG', 1) | 12 | pkg = d.getVar('PKG', True) |
13 | pkgfn = d.getVar('PKGFN', 1) | 13 | pkgfn = d.getVar('PKGFN', True) |
14 | rootfs = d.getVar('IMAGE_ROOTFS', 1) | 14 | rootfs = d.getVar('IMAGE_ROOTFS', True) |
15 | 15 | ||
16 | if None in (pkg,pkgfn,rootfs): | 16 | if None in (pkg,pkgfn,rootfs): |
17 | bb.error("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)") | 17 | bb.error("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)") |
@@ -35,24 +35,24 @@ python package_tar_install () { | |||
35 | } | 35 | } |
36 | 36 | ||
37 | python do_package_tar () { | 37 | python do_package_tar () { |
38 | workdir = d.getVar('WORKDIR', 1) | 38 | workdir = d.getVar('WORKDIR', True) |
39 | if not workdir: | 39 | if not workdir: |
40 | bb.error("WORKDIR not defined, unable to package") | 40 | bb.error("WORKDIR not defined, unable to package") |
41 | return | 41 | return |
42 | 42 | ||
43 | outdir = d.getVar('DEPLOY_DIR_TAR', 1) | 43 | outdir = d.getVar('DEPLOY_DIR_TAR', True) |
44 | if not outdir: | 44 | if not outdir: |
45 | bb.error("DEPLOY_DIR_TAR not defined, unable to package") | 45 | bb.error("DEPLOY_DIR_TAR not defined, unable to package") |
46 | return | 46 | return |
47 | bb.mkdirhier(outdir) | 47 | bb.mkdirhier(outdir) |
48 | 48 | ||
49 | dvar = d.getVar('D', 1) | 49 | dvar = d.getVar('D', True) |
50 | if not dvar: | 50 | if not dvar: |
51 | bb.error("D not defined, unable to package") | 51 | bb.error("D not defined, unable to package") |
52 | return | 52 | return |
53 | bb.mkdirhier(dvar) | 53 | bb.mkdirhier(dvar) |
54 | 54 | ||
55 | packages = d.getVar('PACKAGES', 1) | 55 | packages = d.getVar('PACKAGES', True) |
56 | if not packages: | 56 | if not packages: |
57 | bb.debug(1, "PACKAGES not defined, nothing to package") | 57 | bb.debug(1, "PACKAGES not defined, nothing to package") |
58 | return | 58 | return |
@@ -79,11 +79,11 @@ python do_package_tar () { | |||
79 | pkgoutdir = outdir | 79 | pkgoutdir = outdir |
80 | bb.mkdirhier(pkgoutdir) | 80 | bb.mkdirhier(pkgoutdir) |
81 | bb.build.exec_func('package_tar_fn', localdata) | 81 | bb.build.exec_func('package_tar_fn', localdata) |
82 | tarfn = localdata.getVar('PKGFN', 1) | 82 | tarfn = localdata.getVar('PKGFN', True) |
83 | os.chdir(root) | 83 | os.chdir(root) |
84 | from glob import glob | 84 | from glob import glob |
85 | if not glob('*'): | 85 | if not glob('*'): |
86 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', 1), localdata.getVar('PKGR', 1))) | 86 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True))) |
87 | continue | 87 | continue |
88 | ret = os.system("tar -czf %s %s" % (tarfn, '.')) | 88 | ret = os.system("tar -czf %s %s" % (tarfn, '.')) |
89 | if ret != 0: | 89 | if ret != 0: |