On Fri, Mar 1, 2013 at 9:29 PM, Qi Liang <[email protected]> wrote: > tests/prebuild/license in qtqa repo is just for that purpose though I am not > sure how it got run on every qt5 module repo. > > http://qt.gitorious.org/qt/qtqa/trees/master/tests/prebuild/license
The license header checker autotest is used by the CI system. You can also run it manually before you commit changes. For example, if I want to manually check qtdeclarative, I do: cd ~/dev/qt5 QT_MODULE_TO_TEST=qtdeclarative qtqa/tests/prebuild/tst_licenses.pl Things to note about the autotest: * It checks that the first few lines of the header match the predefined patterns. The old Nokia copyright line still matches the acceptable pattern, so the script won't complain about those. I can probably fix that if there's sufficient interest. * It checks the text inside the QT_BEGIN_LICENSE/QT_END_LICENSE markers against the reference copies in qtbase/LICENSE.*, so you need to have qtbase in your tree with the correct branch checked out as well as qtqa and the module you want to check. * For each file checked, the script will print a line beginning with "ok" or "not ok" depending on the result. When not ok, it will also print some detail about why it failed. For those in Digia, you may also want to have a look in the old non-public mkdist repo which contained the packaging scripts for Qt4.x. In that repo there's a script called bin/replace-licenses.zsh and a small Qt program called replacetags (or maybe replace-tags) that the script calls. This can be used to automatically update the text between the QT_BEGIN_LICENSE and QT_END_LICENSE markers to the current version for the corresponding license type. The script was originally written by Thiago and I later enhanced it to handle license headers in non-C++ files and those embedded inside string literals in programs that generate other source files. (There is one file the script doesn't work on: qtbase/tests/auto/tools/moc/os9-newlines.h. That files has to be carefully updated with a hex editor when the license text changes.) I'd suggest moving that script into the qtqa module and making it use the reference text in qtbase/LICENSE.* instead of the (by now very stale) copies in mkdist. If nobody in Digia has the time to do this, I can do it, but someone in Digia would need to get permission to give me a copy of the code because mkdist was never made public. -- Jason _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
