]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commit
check-package: prepare to extend to other directories
authorRicardo Martincoski <ricardo.martincoski@gmail.com>
Sun, 1 Apr 2018 05:08:14 +0000 (02:08 -0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 1 Apr 2018 05:58:07 +0000 (07:58 +0200)
commita7b4bbfc14b9dbea7906b4ddedb80119da8377c2
tree671f113088d7307163047528fe6cf74496298231
parent0c90c109cbd629d664a965aa1690c3ef2b90ba02
check-package: prepare to extend to other directories

Currently the script only checks files inside the package/ directory.
Upcoming patches will enable it for other directories.

In order to reliably test for file names, i.e. the Config.in in the base
directory, normalize the path of files to check to a relative path to
the base directory.

Rename the variable that holds the compiled regexp to better represent
its content and rearrange how it is declared to make easy to later add
new directories to check. As a consequence the files that declare
package infra types would not be ignored anymore, so create a new
variable to list the files intree to be ignored during the check. The
same variable will be used by upcoming patches to ignore other files.
Ignore pkg-*.mk and doc-asciidoc.mk since they are package infra files.

In order to not produce weird results when used for files outside the
tree (i.e. in a private br2-external) add an explicit command line
option (-b) that bypasses any checks that would make a file be ignored
by the path that contains it.
When in this out-of-tree mode, the user is responsible for providing a
list of files to check that do not contain files the script does not
understand, e.g. package infra files.

As a result of this patch, besides the known use:
$ ./utils/check-package package/new-package/*
someone with the utils/ directory in the path can now also run:
$ cd package/new-package/
$ check-package *
or
$ check-package -b /path/to/br2-ext-tree/package/staging-package/*

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/check-package