* [PATCH 0/2] Add checklicense task to get missing license text
@ 2011-05-13 6:59 Mei Lei
2011-05-13 6:59 ` [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code Mei Lei
2011-05-13 6:59 ` [PATCH 2/2] distrodata.bbclass: Add checklicense task Mei Lei
0 siblings, 2 replies; 6+ messages in thread
From: Mei Lei @ 2011-05-13 6:59 UTC (permalink / raw)
To: poky
From: Mei Lei <lei.mei@intel.com>
Hi Saul,
For adding the information of missing license text into pkg-report system, I add a new task called checklicense in distrodata.bbclass. This check logic is writen by Beth in license.bbclass, avoid affecting the build time, I rewrite this task in distrodata.bbclass.
And there are a lot of repeat code in distrodata.bbclass, create a new function to reduce the repeat code.
Thanks
Lei
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: lmei3/licensecheck
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lmei3/licensecheck
Thanks,
Mei Lei <lei.mei@intel.com>
---
Mei Lei (2):
distro_check.py: Add a new function to reduce the repeat code
distrodata.bbclass: Add checklicense task
meta/classes/distrodata.bbclass | 88 ++++++++++++++++++++++++---------------
meta/lib/oe/distro_check.py | 15 +++++++
2 files changed, 69 insertions(+), 34 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code 2011-05-13 6:59 [PATCH 0/2] Add checklicense task to get missing license text Mei Lei @ 2011-05-13 6:59 ` Mei Lei 2011-05-13 17:13 ` Joshua Lock 2011-05-13 6:59 ` [PATCH 2/2] distrodata.bbclass: Add checklicense task Mei Lei 1 sibling, 1 reply; 6+ messages in thread From: Mei Lei @ 2011-05-13 6:59 UTC (permalink / raw) To: poky From: Mei Lei <lei.mei@intel.com> A lot of repeat code in distrodata.bbclass when creating log file, we can define a function called create_log_file to do it. Signed-off-by: Mei Lei <lei.mei@intel.com> --- meta/lib/oe/distro_check.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py index c85d4fb..134e92a 100644 --- a/meta/lib/oe/distro_check.py +++ b/meta/lib/oe/distro_check.py @@ -341,6 +341,21 @@ def compare_in_distro_packages_list(distro_check_dir, d): bb.note("Matching: %s" % matching_distros) return matching_distros +def create_log_file(d, logname): + #logpath = bb.data.getVar('LOG_DIR', e.data, 1) + logpath = bb.data.getVar('LOG_DIR', d, 1) + bb.utils.mkdirhier(logpath) + logfile = logpath +"/" + logname.split(".")[0] + ".%s.csv" % bb.data.getVar('DATETIME', d, 1) + if not os.path.exists(logfile): + slogfile = os.path.join(logpath, logname) + if os.path.exists(slogfile): + os.remove(slogfile) + os.system("touch %s" % logfile) + os.symlink(logfile, slogfile) + bb.data.setVar('LOG_FILE', logfile, d) + return logfile + + def save_distro_check_result(result, datetime, d): pn = bb.data.getVar('PN', d, True) logdir = bb.data.getVar('LOG_DIR', d, True) -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code 2011-05-13 6:59 ` [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code Mei Lei @ 2011-05-13 17:13 ` Joshua Lock 0 siblings, 0 replies; 6+ messages in thread From: Joshua Lock @ 2011-05-13 17:13 UTC (permalink / raw) To: poky On Thu, 2011-01-13 at 15:04 +0800, Mei Lei wrote: > From: Mei Lei <lei.mei@intel.com> > > A lot of repeat code in distrodata.bbclass when creating log file, we > can define a function called create_log_file to do it. I like the intent of the patch, some comments on coding style below. > > Signed-off-by: Mei Lei <lei.mei@intel.com> > --- > meta/lib/oe/distro_check.py | 15 +++++++++++++++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py > index c85d4fb..134e92a 100644 > --- a/meta/lib/oe/distro_check.py > +++ b/meta/lib/oe/distro_check.py > @@ -341,6 +341,21 @@ def compare_in_distro_packages_list(distro_check_dir, d): > bb.note("Matching: %s" % matching_distros) > return matching_distros > > +def create_log_file(d, logname): > + #logpath = bb.data.getVar('LOG_DIR', e.data, 1) No need for this commented line. > + logpath = bb.data.getVar('LOG_DIR', d, 1) We are trying to move towards using Boolean values where appropriate to aid readability, this line should be: logpath = bb.data.getVar('LOG_DIR', d, True) > + bb.utils.mkdirhier(logpath) > + logfile = logpath +"/" + logname.split(".")[0] + ".%s.csv" % bb.data.getVar('DATETIME', d, 1) Can you use the Python standard library functions for handling filenames here? And a boolean True in the getVar() call. Something like the following feels more Pythonic: logfn, logext = os.path.splitext(logname) logfile = os.path.join(logpath, "%s.%s.csv" % (logfn, bb.data.getVar('DATETIME', d, True)) > + if not os.path.exists(logfile): > + slogfile = os.path.join(logpath, logname) > + if os.path.exists(slogfile): > + os.remove(slogfile) > + os.system("touch %s" % logfile) > + os.symlink(logfile, slogfile) > + bb.data.setVar('LOG_FILE', logfile, d) > + return logfile > + > + > def save_distro_check_result(result, datetime, d): > pn = bb.data.getVar('PN', d, True) > logdir = bb.data.getVar('LOG_DIR', d, True) -- Joshua Lock Yocto Build System Monkey Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] distrodata.bbclass: Add checklicense task 2011-05-13 6:59 [PATCH 0/2] Add checklicense task to get missing license text Mei Lei 2011-05-13 6:59 ` [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code Mei Lei @ 2011-05-13 6:59 ` Mei Lei 2011-05-13 17:13 ` Joshua Lock 1 sibling, 1 reply; 6+ messages in thread From: Mei Lei @ 2011-05-13 6:59 UTC (permalink / raw) To: poky From: Mei Lei <lei.mei@intel.com> This task will check which license text is missing Signed-off-by: Mei Lei <lei.mei@intel.com> --- meta/classes/distrodata.bbclass | 88 ++++++++++++++++++++++++--------------- 1 files changed, 54 insertions(+), 34 deletions(-) diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass index 905dad7..58a2cf7 100644 --- a/meta/classes/distrodata.bbclass +++ b/meta/classes/distrodata.bbclass @@ -4,18 +4,8 @@ addhandler distro_eventhandler python distro_eventhandler() { if bb.event.getName(e) == "BuildStarted": - """initialize log files.""" - logpath = bb.data.getVar('LOG_DIR', e.data, 1) - bb.utils.mkdirhier(logpath) - logfile = os.path.join(logpath, "distrodata.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) - if not os.path.exists(logfile): - slogfile = os.path.join(logpath, "distrodata.csv") - if os.path.exists(slogfile): - os.remove(slogfile) - os.system("touch %s" % logfile) - os.symlink(logfile, slogfile) - bb.data.setVar('LOG_FILE', logfile, e.data) - + import oe.distro_check as dc + logfile = dc.create_log_file(e.data,"distrodata.csv") lf = bb.utils.lockfile(logfile + ".lock") f = open(logfile, "a") f.write("Package,Description,Owner,License,ChkSum,Status,VerMatch,Version,Upsteam,Non-Update,Reason,Recipe Status\n") @@ -211,17 +201,8 @@ do_distrodataall() { addhandler checkpkg_eventhandler python checkpkg_eventhandler() { if bb.event.getName(e) == "BuildStarted": - """initialize log files.""" - logpath = bb.data.getVar('LOG_DIR', e.data, 1) - bb.utils.mkdirhier(logpath) - logfile = os.path.join(logpath, "checkpkg.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) - if not os.path.exists(logfile): - slogfile = os.path.join(logpath, "checkpkg.csv") - if os.path.exists(slogfile): - os.remove(slogfile) - os.system("touch %s" % logfile) - os.symlink(logfile, slogfile) - bb.data.setVar('LOG_FILE', logfile, e.data) + import oe.distro_check as dc + logfile = dc.create_log_file(e.data,"checkpkg.csv") lf = bb.utils.lockfile(logfile + ".lock") f = open(logfile, "a") @@ -662,17 +643,8 @@ python check_eventhandler() { distro_check_dir = os.path.join(tmpdir, "distro_check") datetime = bb.data.getVar('DATETIME', e.data, 1) """initialize log files.""" - logpath = bb.data.getVar('LOG_DIR', e.data, 1) - bb.utils.mkdirhier(logpath) - logfile = os.path.join(logpath, "distrocheck.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) - if not os.path.exists(logfile): - slogfile = os.path.join(logpath, "distrocheck.csv") - if os.path.exists(slogfile): - os.remove(slogfile) - os.system("touch %s" % logfile) - os.symlink(logfile, slogfile) - bb.data.setVar('LOG_FILE', logfile, e.data) - + import oe.distro_check as dc + logfile = dc.create_log_file(e.data,"distrocheck.csv") return } @@ -701,3 +673,51 @@ do_distro_checkall[nostamp] = "1" do_distro_checkall() { : } +##Check Missing License Text +addhandler checklicense_eventhandler +python checklicense_eventhandler() { + if bb.event.getName(e) == "BuildStarted": + """initialize log files.""" + import oe.distro_check as dc + logfile = dc.create_log_file(e.data,"missinglicense.csv") + lf = bb.utils.lockfile(logfile + ".lock") + f = open(logfile, "a") + f.write("Package\tLicense\tMissingLicense\n") + f.close() + bb.utils.unlockfile(lf) + return +} + +addtask checklicense +do_checklicense[nostamp] = "1" +python do_checklicense() { + import os + import bb + import shutil + logpath = bb.data.getVar('LOG_DIR', d, 1) + bb.utils.mkdirhier(logpath) + pn = bb.data.getVar('PN',d,1) + logfile = os.path.join(logpath, "missinglicense.csv") + generic_directory = bb.data.getVar('COMMON_LICENSE_DIR', d, True) + license_types = bb.data.getVar('LICENSE', d, True) + for license_type in ((license_types.replace('+', '').replace('|', '&') + .replace('(', '').replace(')', '').replace(';', '') + .replace(',', '').replace(" ", "").split("&"))): + if not os.path.isfile(os.path.join(generic_directory, license_type)): + lf = bb.utils.lockfile(logfile + ".lock") + f = open(logfile,"a") + f.write("%s\t%s\t%s\n" % \ + (pn,license_types,license_type)) + f.close() + bb.utils.unlockfile(lf) + return +} + +addtask checklicenseall after do_checklicense +do_checklicenseall[recrdeptask] = "do_checklicense" +do_checklicenseall[nostamp] = "1" +do_checklicenseall() { + : +} + + -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] distrodata.bbclass: Add checklicense task 2011-05-13 6:59 ` [PATCH 2/2] distrodata.bbclass: Add checklicense task Mei Lei @ 2011-05-13 17:13 ` Joshua Lock 2011-05-16 12:30 ` Mei, Lei 0 siblings, 1 reply; 6+ messages in thread From: Joshua Lock @ 2011-05-13 17:13 UTC (permalink / raw) To: poky On Thu, 2011-01-13 at 15:04 +0800, Mei Lei wrote: > From: Mei Lei <lei.mei@intel.com> > > This task will check which license text is missing Can you flesh out this commit log some please? Why is this task useful? When should it be used? Etc. Code style comments in line below, thanks! > > Signed-off-by: Mei Lei <lei.mei@intel.com> > --- > meta/classes/distrodata.bbclass | 88 ++++++++++++++++++++++++--------------- > 1 files changed, 54 insertions(+), 34 deletions(-) > > diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass > index 905dad7..58a2cf7 100644 > --- a/meta/classes/distrodata.bbclass > +++ b/meta/classes/distrodata.bbclass > @@ -4,18 +4,8 @@ addhandler distro_eventhandler > python distro_eventhandler() { > > if bb.event.getName(e) == "BuildStarted": > - """initialize log files.""" > - logpath = bb.data.getVar('LOG_DIR', e.data, 1) > - bb.utils.mkdirhier(logpath) > - logfile = os.path.join(logpath, "distrodata.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) > - if not os.path.exists(logfile): > - slogfile = os.path.join(logpath, "distrodata.csv") > - if os.path.exists(slogfile): > - os.remove(slogfile) > - os.system("touch %s" % logfile) > - os.symlink(logfile, slogfile) > - bb.data.setVar('LOG_FILE', logfile, e.data) > - > + import oe.distro_check as dc > + logfile = dc.create_log_file(e.data,"distrodata.csv") > lf = bb.utils.lockfile(logfile + ".lock") > f = open(logfile, "a") > f.write("Package,Description,Owner,License,ChkSum,Status,VerMatch,Version,Upsteam,Non-Update,Reason,Recipe Status\n") > @@ -211,17 +201,8 @@ do_distrodataall() { > addhandler checkpkg_eventhandler > python checkpkg_eventhandler() { > if bb.event.getName(e) == "BuildStarted": > - """initialize log files.""" > - logpath = bb.data.getVar('LOG_DIR', e.data, 1) > - bb.utils.mkdirhier(logpath) > - logfile = os.path.join(logpath, "checkpkg.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) > - if not os.path.exists(logfile): > - slogfile = os.path.join(logpath, "checkpkg.csv") > - if os.path.exists(slogfile): > - os.remove(slogfile) > - os.system("touch %s" % logfile) > - os.symlink(logfile, slogfile) > - bb.data.setVar('LOG_FILE', logfile, e.data) > + import oe.distro_check as dc > + logfile = dc.create_log_file(e.data,"checkpkg.csv") > > lf = bb.utils.lockfile(logfile + ".lock") > f = open(logfile, "a") > @@ -662,17 +643,8 @@ python check_eventhandler() { > distro_check_dir = os.path.join(tmpdir, "distro_check") > datetime = bb.data.getVar('DATETIME', e.data, 1) > """initialize log files.""" > - logpath = bb.data.getVar('LOG_DIR', e.data, 1) > - bb.utils.mkdirhier(logpath) > - logfile = os.path.join(logpath, "distrocheck.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) > - if not os.path.exists(logfile): > - slogfile = os.path.join(logpath, "distrocheck.csv") > - if os.path.exists(slogfile): > - os.remove(slogfile) > - os.system("touch %s" % logfile) > - os.symlink(logfile, slogfile) > - bb.data.setVar('LOG_FILE', logfile, e.data) > - > + import oe.distro_check as dc > + logfile = dc.create_log_file(e.data,"distrocheck.csv") > return > } > > @@ -701,3 +673,51 @@ do_distro_checkall[nostamp] = "1" > do_distro_checkall() { > : > } > +##Check Missing License Text > +addhandler checklicense_eventhandler > +python checklicense_eventhandler() { > + if bb.event.getName(e) == "BuildStarted": > + """initialize log files.""" > + import oe.distro_check as dc > + logfile = dc.create_log_file(e.data,"missinglicense.csv") Whitespace: logfile = dc.create_log_file(e.data, "missinglicense.csv") > + lf = bb.utils.lockfile(logfile + ".lock") Personally I prefer to use string formatting rather for this sort of thing: + lf = bb.utils.lockfile("%s.lock" % logfile) > + f = open(logfile, "a") > + f.write("Package\tLicense\tMissingLicense\n") > + f.close() > + bb.utils.unlockfile(lf) > + return > +} > + > +addtask checklicense > +do_checklicense[nostamp] = "1" > +python do_checklicense() { > + import os > + import bb > + import shutil > + logpath = bb.data.getVar('LOG_DIR', d, 1) > + bb.utils.mkdirhier(logpath) > + pn = bb.data.getVar('PN',d,1) pn = bb.data.getVar('PN', d, True) Please try and maintain whitespace style and use boolean values where appropriate. > + logfile = os.path.join(logpath, "missinglicense.csv") > + generic_directory = bb.data.getVar('COMMON_LICENSE_DIR', d, True) > + license_types = bb.data.getVar('LICENSE', d, True) > + for license_type in ((license_types.replace('+', '').replace('|', '&') > + .replace('(', '').replace(')', '').replace(';', '') > + .replace(',', '').replace(" ", "").split("&"))): > + if not os.path.isfile(os.path.join(generic_directory, license_type)): > + lf = bb.utils.lockfile(logfile + ".lock") Maybe use string formatters here too: + lf = bb.utils.lockfile("%s.lock" % logfile) > + f = open(logfile,"a") > + f.write("%s\t%s\t%s\n" % \ > + (pn,license_types,license_type)) > + f.close() > + bb.utils.unlockfile(lf) > + return > +} > + > +addtask checklicenseall after do_checklicense > +do_checklicenseall[recrdeptask] = "do_checklicense" > +do_checklicenseall[nostamp] = "1" > +do_checklicenseall() { > + : > +} > + > + -- Joshua Lock Yocto Build System Monkey Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] distrodata.bbclass: Add checklicense task 2011-05-13 17:13 ` Joshua Lock @ 2011-05-16 12:30 ` Mei, Lei 0 siblings, 0 replies; 6+ messages in thread From: Mei, Lei @ 2011-05-16 12:30 UTC (permalink / raw) To: poky@yoctoproject.org Hi Josh, Thanks for your comments, I am very appreciate of that. I have revised these patches and sent a new pull-request to mail list, please review it. Thanks Lei >-----Original Message----- >From: poky-bounces@yoctoproject.org [mailto:poky-bounces@yoctoproject.org] >On Behalf Of Joshua Lock >Sent: Saturday, May 14, 2011 1:14 AM >To: poky@yoctoproject.org >Subject: Re: [poky] [PATCH 2/2] distrodata.bbclass: Add checklicense task > >On Thu, 2011-01-13 at 15:04 +0800, Mei Lei wrote: >> From: Mei Lei <lei.mei@intel.com> >> >> This task will check which license text is missing > >Can you flesh out this commit log some please? Why is this task useful? >When should it be used? Etc. > >Code style comments in line below, thanks! > >> >> Signed-off-by: Mei Lei <lei.mei@intel.com> >> --- >> meta/classes/distrodata.bbclass | 88 >++++++++++++++++++++++++--------------- >> 1 files changed, 54 insertions(+), 34 deletions(-) >> >> diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass >> index 905dad7..58a2cf7 100644 >> --- a/meta/classes/distrodata.bbclass >> +++ b/meta/classes/distrodata.bbclass >> @@ -4,18 +4,8 @@ addhandler distro_eventhandler >> python distro_eventhandler() { >> >> if bb.event.getName(e) == "BuildStarted": >> - """initialize log files.""" >> - logpath = bb.data.getVar('LOG_DIR', e.data, 1) >> - bb.utils.mkdirhier(logpath) >> - logfile = os.path.join(logpath, "distrodata.%s.csv" % >bb.data.getVar('DATETIME', e.data, 1)) >> - if not os.path.exists(logfile): >> - slogfile = os.path.join(logpath, "distrodata.csv") >> - if os.path.exists(slogfile): >> - os.remove(slogfile) >> - os.system("touch %s" % logfile) >> - os.symlink(logfile, slogfile) >> - bb.data.setVar('LOG_FILE', logfile, e.data) >> - >> + import oe.distro_check as dc >> + logfile = dc.create_log_file(e.data,"distrodata.csv") >> lf = bb.utils.lockfile(logfile + ".lock") >> f = open(logfile, "a") >> > f.write("Package,Description,Owner,License,ChkSum,Status,VerMatch,Versio >n,Upsteam,Non-Update,Reason,Recipe Status\n") >> @@ -211,17 +201,8 @@ do_distrodataall() { >> addhandler checkpkg_eventhandler >> python checkpkg_eventhandler() { >> if bb.event.getName(e) == "BuildStarted": >> - """initialize log files.""" >> - logpath = bb.data.getVar('LOG_DIR', e.data, 1) >> - bb.utils.mkdirhier(logpath) >> - logfile = os.path.join(logpath, "checkpkg.%s.csv" % >bb.data.getVar('DATETIME', e.data, 1)) >> - if not os.path.exists(logfile): >> - slogfile = os.path.join(logpath, "checkpkg.csv") >> - if os.path.exists(slogfile): >> - os.remove(slogfile) >> - os.system("touch %s" % logfile) >> - os.symlink(logfile, slogfile) >> - bb.data.setVar('LOG_FILE', logfile, e.data) >> + import oe.distro_check as dc >> + logfile = dc.create_log_file(e.data,"checkpkg.csv") >> >> lf = bb.utils.lockfile(logfile + ".lock") >> f = open(logfile, "a") >> @@ -662,17 +643,8 @@ python check_eventhandler() { >> distro_check_dir = os.path.join(tmpdir, "distro_check") >> datetime = bb.data.getVar('DATETIME', e.data, 1) >> """initialize log files.""" >> - logpath = bb.data.getVar('LOG_DIR', e.data, 1) >> - bb.utils.mkdirhier(logpath) >> - logfile = os.path.join(logpath, "distrocheck.%s.csv" % >bb.data.getVar('DATETIME', e.data, 1)) >> - if not os.path.exists(logfile): >> - slogfile = os.path.join(logpath, "distrocheck.csv") >> - if os.path.exists(slogfile): >> - os.remove(slogfile) >> - os.system("touch %s" % logfile) >> - os.symlink(logfile, slogfile) >> - bb.data.setVar('LOG_FILE', logfile, e.data) >> - >> + import oe.distro_check as dc >> + logfile = dc.create_log_file(e.data,"distrocheck.csv") >> return >> } >> >> @@ -701,3 +673,51 @@ do_distro_checkall[nostamp] = "1" >> do_distro_checkall() { >> : >> } >> +##Check Missing License Text >> +addhandler checklicense_eventhandler >> +python checklicense_eventhandler() { >> + if bb.event.getName(e) == "BuildStarted": >> + """initialize log files.""" >> + import oe.distro_check as dc >> + logfile = dc.create_log_file(e.data,"missinglicense.csv") >Whitespace: logfile = dc.create_log_file(e.data, "missinglicense.csv") >> + lf = bb.utils.lockfile(logfile + ".lock") >Personally I prefer to use string formatting rather for this sort of >thing: >+ lf = bb.utils.lockfile("%s.lock" % logfile) >> + f = open(logfile, "a") >> + f.write("Package\tLicense\tMissingLicense\n") >> + f.close() >> + bb.utils.unlockfile(lf) >> + return >> +} >> + >> +addtask checklicense >> +do_checklicense[nostamp] = "1" >> +python do_checklicense() { >> + import os >> + import bb >> + import shutil >> + logpath = bb.data.getVar('LOG_DIR', d, 1) >> + bb.utils.mkdirhier(logpath) >> + pn = bb.data.getVar('PN',d,1) > >pn = bb.data.getVar('PN', d, True) > >Please try and maintain whitespace style and use boolean values where >appropriate. > >> + logfile = os.path.join(logpath, "missinglicense.csv") >> + generic_directory = bb.data.getVar('COMMON_LICENSE_DIR', d, True) >> + license_types = bb.data.getVar('LICENSE', d, True) >> + for license_type in ((license_types.replace('+', '').replace('|', '&') >> + .replace('(', '').replace(')', '').replace(';', '') >> + .replace(',', '').replace(" ", "").split("&"))): >> + if not os.path.isfile(os.path.join(generic_directory, license_type)): >> + lf = bb.utils.lockfile(logfile + ".lock") >Maybe use string formatters here too: >+ lf = bb.utils.lockfile("%s.lock" % logfile) >> + f = open(logfile,"a") >> + f.write("%s\t%s\t%s\n" % \ >> + (pn,license_types,license_type)) >> + f.close() >> + bb.utils.unlockfile(lf) >> + return >> +} >> + >> +addtask checklicenseall after do_checklicense >> +do_checklicenseall[recrdeptask] = "do_checklicense" >> +do_checklicenseall[nostamp] = "1" >> +do_checklicenseall() { >> + : >> +} >> + >> + > >-- >Joshua Lock > Yocto Build System Monkey > Intel Open Source Technology Centre > >_______________________________________________ >poky mailing list >poky@yoctoproject.org >https://lists.yoctoproject.org/listinfo/poky ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-16 12:30 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-05-13 6:59 [PATCH 0/2] Add checklicense task to get missing license text Mei Lei 2011-05-13 6:59 ` [PATCH 1/2] distro_check.py: Add a new function to reduce the repeat code Mei Lei 2011-05-13 17:13 ` Joshua Lock 2011-05-13 6:59 ` [PATCH 2/2] distrodata.bbclass: Add checklicense task Mei Lei 2011-05-13 17:13 ` Joshua Lock 2011-05-16 12:30 ` Mei, Lei
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.