Commit graph

46 commits

Author SHA1 Message Date
Arnout Vandecappelle (Essensium/Mind) f304caab11 package/pkg-utils.mk: add dl_dir to show-info output
It can be useful for scripts to be able to access a package's source
file after download. That used to be easy, just DL_DIR/PKG_SOURCE.
However, with the subdirectories in DL_DIR which can be overridden with
PKG_DL_SUBDIR, that is no longer easy.

Therefore, this patch adds dl_dir to the package information. It prints
just PKG_DL_SUBDIR, to avoid dumping absolute paths to the buildroot
directory in the show-info output.

It can be used with the following jq script to get a newline-separated
list of all downloaded files:

make show-info | jq -r '.[] | ("dl/" + .dl_dir + "/" + .downloads[]?.source)'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-09-25 21:54:55 +02:00
Vadim Kochan ffc6da9537 package/pkg-utils: add install_{staging, target, images} details in show-info
This commit extends the show-info/<pkg>-show-info logic to include in
the JSON output details about whether the package installs files to
target, staging and/or images.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-06 22:28:32 +02:00
Yann E. MORIN f8177b7813 core: introduce new global show-info
Users are increasingly trying to extract information about packages. For
example, they might need to get the list of URIs, or the dependencies of
a package.

Although we do have a bunch of rules to generate some of that, this is
done in ad-hoc way, with most of the output formats just ad-hoc, raw,
unformatted blurbs, mostly internal data dumped as-is.

Introduce a new rule, show-info, that provides a properly formatted
output of all the meta-information about packages: name, type, version,
licenses, dependencies...

We choose to use JSON as the output format, because it is pretty
versatile, has parsers in virtually all languages, has tools to parse
from the shell (jq). It also closely matches Python data structure,
which makes it easy to use with our own internal tools as well. Finally,
JSON being a key-value store, allows for easy expanding the output
without requiring existing consumers to be updated; new, unknown keys
are simply ignored by those (as long as they are true JSON parsers).

The complex part of this change was the conditional output of parts of
the data: virtual packages have no source, version, license or
downloads, unlike non-virtual packages. Same goes for filesystems. We
use a wrapper macro, show-info, that de-multiplexes unto either the
package-related- or filesystem-related macros, and for packages, we also
use a detailed macro for non-virtual packages.

It is non-trivial to properly output correct JSON blurbs, especially
when trying to output an array of objects, like so, where the last item
shall not be followed by a comma:  [ { ... }, { ... } ]

So, we use a trick (as sugegsted by Arnout), to $(subst) any pair of
",}" or ", }" or ",]" or ", ]" with only the respective closing symbol,
"}" or "]".

The whole stuff is $(strip)ed to make it a somewhat-minified JSON blurb
that fits on a single line with all spaces squashed (but still with
spaces, as it is not possible to differentiate spaces between JSON
elements from spaces inside JSON strings).

Reported-by: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-04-15 23:37:44 +02:00
Michal Sojka e33ea1c9a2 core/legal-info: Add package dependencies with licenses to the manifest
This adds one column to the legal-info manifest table. It contains the
dependencies of the given package and their licenses. This information
is useful when assessing license compatibility of the packages and
their libraries.

An example of the content of the new column for the MPD package is
shown below:

    "alsa-lib [LGPL-2.1+ (library), GPL-2.0+ (aserver)] boost
    [BSL-1.0] libid3tag [GPL-2.0+] libmad [GPL-2.0+] libogg
    [BSD-3-Clause] libvorbis [BSD-3-Clause] libzlib [Zlib]
    skeleton-init-common [unknown] skeleton-init-sysv [unknown] sqlite
    [Public domain] toolchain-external-linaro-arm [unknown]"

[Credits to Yann E. MORIN <yann.morin.1998@free.fr> for suggesting a
few simplifications.]

Signed-off-by: Michal Sojka <sojka@merica.cz>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-10-21 19:13:20 +02:00
Michal Sojka 8f14901043 core/legal-info: Change order of legal-manifest parameters
The last parameter {HOST|TARGET} is now first. With this change,
adding new columns to the legal manifest file (as in the next commit)
will be slightly easier to review.

Signed-off-by: Michal Sojka <sojka@merica.cz>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-10-21 19:12:31 +02:00
Yann E. MORIN 0c45649c12 legal-info: use the per-package variable to get the hash file
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-10-20 20:04:06 +02:00
Yann E. MORIN 63eeb9a383 core/legal-info: use hash file from version sub-dir
When we have multiple versions for a package, and the licensing terms
depend on the version actually selected (e.g. like Qt5), storing the
hashes for those license files in the .hash file is broken: the infra
will ensure that all hashes for a file do match, which would not be the
case here.

We fix that by first looking for a hash file in the version sub-dir
first, and if that does not exist, then we use the main hash file.

Drop the useless intermediate variable 'ret'.

Update the documentation accordingly.

Reported-by: Joshua Henderson <joshua.henderson@microchip.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Joshua Henderson <joshua.henderson@microchip.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-29 22:34:41 +02:00
Yann E. MORIN 518b797b2b core/pkg-utils: check hashes of license files
This will help catch a change of license even if the filename does
not change.

For now, a missing hash for the license files is not a fatal error, to
let people catch up and add them. When we switch to make it mandatory,
we can simplify the code by just removing the case statement.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-07-03 18:03:51 +02:00
Yann E. MORIN ea5695b5df core/pkg-util: pass package directory and name when saving license files
This will be useful when checking the hashes of the license files.

[Peter: use '.' as buildroot directory so /buildroot.hash isn't checked]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-07-03 18:03:20 +02:00
Baruch Siach f165032e4f package: add generic support for lz archives
This commit teaches the generic package handling code how to extract .tar.lz
archives. When lzip is not installed on the host, host-lzip gets built
automatically.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-15 22:11:11 +01:00
Baruch Siach dc7fcbe494 package: refactor listing of extractor dependencies
Don't special case $(XZCAT) when constructing DL_TOOLS_DEPENDENCIES. The next
commit will introduce another extractor that automatically builds when not
installed. Introduce EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS that lists
archive extensions for which the extractor is already checked in
support/dependencies/check-host-foo.mk. Use this in the newly introduced
extractor-dependency to populate DL_TOOLS_DEPENDENCIES.

Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
[Thomas: add missing space after "firstword", as noticed by Thomas DS.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-15 22:11:11 +01:00
Yann E. MORIN 81bf01cbff core/legal-info: don't generate big file with all license texts
By aggregating all the license files into a single big text-only file
means we have no way to use license files that are binary blobs (e.g.
pdf, rtf...).

Just do not generate that big file; if the user still wants it, it is
very easy to create it afterwards.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-15 12:52:42 +02:00
Yann E. MORIN 242e0087e5 core: move pkg-utils.mk to support/
pkg-utils.mk contains various definitions that are used in the package
infrastructures and packages themselves.

However, those definitions can be useful in other parts of Buildroot,
and are already used in a few places that are not related to the package
infrastructure. Also, $(sep) will be needed early in the Makefile when
we eventually support multiple br2-external trees.

Since this file only contains definitions, we can include it anytime.

So, consider that file to no longer be specific to the package infras:
  - move it to support and rename it,
  - move a few similar definitions from the main Makefile to that file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-08-27 16:03:35 +02:00
Yann E. MORIN cc05f407bc core/pkg-utils: add macro to escape-and-printf
In some cases we need to escape make variables and pass them to
printf(1).

This is the case in our fs infra, where we want to shoe-horn the
commands to generate the filesystems in the fakeroot script, or the
devices, permissions and users tables to their respective files.

We currently do so by replacing $(sep) with the literal '\n' but that's
not enough. This does not protect against strings with an embedded '%'
or a backslash.

Add a new macro that properly escapes a string and calls printf(1), so
that we get the expected output.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-07 22:20:53 +02:00
James Knight 2406955bce pkg-utils: mask tput failure for non-interactive sessions
When invoking a build from a non-interactive session (for example, a
Jenkins build), there is no terminal session to modify. When preparing
variables to track the bold and boldoff mode sequences, the `tput`
command will always fail as there is no terminal to query. The following
change masks the error message when `tput` fails; leaving the TERM_BOLD
and TERM_RESET variables empty.

Signed-off-by: James Knight <james.d.knight@live.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-02-21 18:30:09 +01:00
Petr Vorel 57d0d93efd pkg-generic: support for lzma archives
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-06-21 09:47:12 +02:00
Arnout Vandecappelle f17222f506 pkg-generic: substitute colon and space out of PKG_VERSION
Using a colon or a space in a make target doesn't work, so they have to
be filtered out of the PKG_VERSION variable just like the / currently
already is.

This will be needed for date-based CVS versions.

Add a helper macro 'sanitize' in pkg-utils.mk to implement this. This
also moves the strip to the inner level for the target branch.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-25 10:30:52 +02:00
Thomas Petazzoni 2366661e4f pkg-utils: update comments after renaming of package infra macros
The package infrastructure macros have a long time ago been renamed
from GENTARGETS, AUTOTARGETS to generic-package and
autotools-package. However, one comment in pkg-utils.mk keeps a
reference to these *TARGETS macros. This commit updates this comment
to match the new name of these macros.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-13 22:25:45 +02:00
Arnout Vandecappelle 9a89b98ae2 pkg-utils: describe the case conversion macros in more detail.
After the refactoring of the case conversion macros in dd5e620ac, the
macro became even harder to understand. Improve this explanation a
little so future generations can make sense of what we're doing here.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-16 19:04:18 +02:00
Thomas De Schampheleire f268f7131b .mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.

This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.

Alignment of line continuation characters (\) is kept as-is.

The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'

Brief explanation of this command:
    ^\([A-Z0-9a-z_]\+\)     a regular variable at the beginning of the line
    \([?:+]\?=\)            any assignment character =, :=, ?=, +=
    \([^\\]\+\)             any string not containing a line continuation
    \([^\\ \t]\+\s*\\\)     string, optional whitespace, followed by a
                            line continuation character
    \(\s*\\\)               optional whitespace, followed by a line
                            continuation character

Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.

This expression was tested on following test text: (initial tab not
included)

	FOO     = spaces before
	FOO     =   spaces before and after
	FOO	= tab before
	FOO	  = tab and spaces before
	FOO =	tab after
	FOO =	   tab and spaces after
	FOO =   	spaces and tab after
	FOO =    \
	FOO = bar \
	FOO = bar space    \
	FOO   =		   \
	GENIMAGE_DEPENDENCIES   = host-pkgconf libconfuse
	FOO     += spaces before
	FOO     ?=   spaces before and after
	FOO     :=
	FOO     =
	FOO	=
	FOO	  =
	FOO =
	   $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
	AT91BOOTSTRAP3_DEFCONFIG = \
	AXEL_DISABLE_I18N=--i18n=0

After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
  expression leaves the number of whitespace between the value and line
  continuation character intact, but the whitespace before that could have
  changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
  actually makes the code more readable.

Finally, the end result was manually reviewed.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 15:00:28 +02:00
Thomas De Schampheleire 2dc51b7c4d check-deprecated-variable: move from pkg-generic.mk to pkg-utils.mk
Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-05 13:38:06 +02:00
Yann E. MORIN 57ae95be21 pkg-utils: qstrip MESSAGE
Currently, the MESSAGE macro double-quotes the message. But a few call
sites also double-quote the message, resulting in a borked call to echo,
like:
    $(call MESSAGE,"user text")
would expand to:
    echo "Leading text "user message" trailign text"

Just use qstrip on the user message, so we get protected from either a
comma in the user text (so make does not interpret it), or a semi-colon
(so the shell does not interpret it.)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-09-29 08:40:32 +02:00
Clayton Shotwell af629e49ad legal-info: Add site to legal info manifest
I would like to propose adding the site to the legal-info manifest
files. This gives a little more information on where the sources came
from without adding much overhead. Please note that is is only for
packages where the source is not local or set with OVERRIDE_SRCDIR.

Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-23 23:36:43 +02:00
Thomas De Schampheleire 62bbfbaa63 pkg-utils: kconfig helpers: use single iso double quoting
The echo statements in the kconfig helpers are currently using double
quotes. For KCONFIG_SET_OPT this is problematic when the value argument
itself contains a double quote (a string value). In this case, the statement
    echo "$(1)=$(2)" >> $(3)
would become:
    echo "FOO="string value"" >> /some/path/.config
resulting in the string
    FOO=string value
in the config file, rather than the properly quoted
    FOO="string value"

The linux package worked around this by escaping the quote characters, but
a prettier solution is to use single quoting in the helpers (or
alternatively use no quoting at all).
A side effect of this change is that a $variable in the key or value would
no longer be interpreted by the shell, removing any unexpected behavior.

This change is only really necessary for KCONFIG_SET_OPT, but for symmetry
reasons the other helpers are updated too.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 19:18:40 +02:00
Thomas De Schampheleire 358bf95445 pkg-utils: kconfig helpers: add basic usage documentation
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 19:18:25 +02:00
Yann E. MORIN 8d42b6d045 legal-info: rename legal-warning-pkg-savednothing helper
This helper was called when none of the sources or license
files were saved.

Now we handle license files separately from the sources,
this is no longer the case: they are only called when the
sources are not saved.

Rename the handler and change the warning message accordingly.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-22 22:04:56 +02:00
Simon Dawson 0be303cacc replace references to Busybox with BusyBox
The correct capitalised form appears to be "BusyBox" rather than "Busybox";
fix all references to the latter form. (Most such references occur in the
manual and in commentary in package makefiles.)

Signed-off-by: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-01 23:58:43 +02:00
Maxime Hadjinlian 9725c5aefc infra: pkg-utils.mk replace "echo -e" with printf
printf is POSIX-compliant, echo -e is not.

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-21 10:45:15 +02:00
Thomas Petazzoni dd5e620ac8 pkg-utils: introduce a make-based LOWERCASE function
Until now, our UPPERCASE function was implemented purely in make for
performance reasons, but our LOWERCASE function was implemented by
calling "tr", which was reasonable due to the fact that LOWERCASE was
rarely used, but future changes might make a more heavy usage of the
LOWERCASE macro.

We want this LOWERCASE function to turn a "_" into a "-" and not a
".", so we slightly adjust the existing FROM and TO lists to make this
possible. This doesn't change the behavior of the UPPERCASE macro
because both "-" and "." are converted into "_" by this function.

This change takes advantage of suggestions made by Arnout
Vandecappelle, who said they further improve the performance of
UPPERCASE and LOWERCASE by 30%/40%.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-20 19:14:34 +02:00
Thomas Petazzoni 371327f7b6 Revert "packages infra: add function to get a Kconfig option"
This reverts commit c28a28eed1. The
whole host-lzop optional dependency logic cannot work, since the
configuration file will only be known after the kernel sources are
extracted, if an internal kernel defconfig is used, which is quite
common.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04 19:16:46 +01:00
Yann E. MORIN c28a28eed1 packages infra: add function to get a Kconfig option
We so far have no mean to get the value from a Kconfig option from the
.config file of a package (eg. linux, busybox...).

Add a new function that returns the unmangled value of an option.
It expect two arguments:
  - the Kconfig option name (complete, with leading CONFIG if necessary)
  - the .config file to get it from

Note that, if the Kconfig option is a string, the returned value will
contain the leading and trailing double-quotes.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 22:21:56 +01:00
Thomas De Schampheleire 582af5884f infra: remove unused helper function pkgparentdir
Thanks to the previous patches, no-one is using pkgparentdir anymore, so
remove it.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:10:44 +01:00
Thomas De Schampheleire 3880a6ab3c infra: remove redundant $(call) on pkgdir, pkgname, pkgparentdir
When calling make 'functions', the $(call) keyword is only needed if the
function takes arguments. For pkgdir, pkgname and pkgparentdir this is not
the case, so we can remove the call to make things more readable.

Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:09:35 +01:00
Thomas De Schampheleire 7f809ca1d2 legal info: cleanup utility functions
The legal-info utility functions where defined using two ways
util-foo = command-foo
and
define util-bar # parameter description
	command-bar
endef

This commit changes these functions to use the second form for clarity and
additionally adds parameter descriptions on all functions.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17 09:15:12 +01:00
Thomas De Schampheleire 366f17f747 legal info: split license texts for host and target
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17 09:15:04 +01:00
Thomas De Schampheleire cc4f34ddd4 legal info: split manifest for host and target
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17 09:14:51 +01:00
Thierry Bultel 6fb546ca41 Generation of locales: made call to tr more robust and added LOWERCASE macro
When calling 'tr' without quoting braces, bash can make really weird things
if there are existing 'single-letter-named' directories
eg:
thierry@thierry-desktop:~$ echo AAA | tr [A-Z] [a-z]
aaa
thierry@thierry-desktop:~$ mkdir m
thierry@thierry-desktop:~$ echo AAA | tr [A-Z] [a-z]
AAA

The (quick) analysis is that the callee (tr) argvs then
contain 'm' thus the translation does not work

Using quotes works around it:
thierry@thierry-desktop:~$ echo AAA | tr '[A-Z]' '[a-z]'
aaa

Signed-off-by: Thierry Bultel <thierry.bultel@wanadoo.fr>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-10 23:41:28 +01:00
Thomas De Schampheleire f8d89f0510 infra: introduce suitable-extractor helper function
In order to simplify determining the right extractor tool for a given
file type, this patch introduces a make function 'suitable-extractor'.
Its usage is $(call suitable-extractor,filename), and it returns the
path to the suitable extractor.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-06 23:30:27 +02:00
Alexandre Belloni 8dfd59d114 Normalize separator size to 80
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-06 22:30:24 +02:00
Peter Korsgaard 31aa4264d8 pkg-utils.mk: legal-license-file: handle multiple license files with same name
Some packages (kmod, e2fsprogs, ..) contain multiple (different) license
files with the same file name, but in different directories.

These are currently all copied to the same filename in
output/legal-info/licenses/<pkg>, overwriting everything but the last file.

Fix it by recreating the same directory structure under legal-info.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-05 10:58:40 +02:00
Arnout Vandecappelle f876cb598b legal-info: quote csv file contents, so commas can be used
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-11-14 22:43:45 +01:00
Samuel Martin 736ce2f3da pkg-utils.mk: fix/clean indentation
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 19:21:47 +02:00
Luca Ceresoli 7e76f904d2 legal-info: infrastructure to collect legally-relevant material
This allows to automatically collect material that may be needed to comply with
the license of packages that Buildroot prepares for the target device.

The core of the implementation is made by the following parts:
 - in package/pkg-utils.mk some helper functions are defined for common actions
   such as generating a warning, producing info about a package etc;
 - in package/pkg-gentargets.mk, within the GENTARGETS framework, a new
   <PKG>-legal-info target produces all the info for a given package;
 - Makefile implements the top-level targets:
   - legal-info-prepare creates the output directory and produces legal info
     about Buildroot itself and the toolchain, which mostly means just warning
     the user that this is not implemented;
   - legal-info, the only target that is supposed to be used directly, depends
     on all of the above and finishes things by producing the README files from
     the various pieces.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17 19:05:49 +02:00
Thomas De Schampheleire 75f18de67e pkg-utils.mk: add utility functions find*clauses and notfirstword
This patch adds a few utility functions to pkg-utils.mk.

Functions finddirclauses and findfileclauses help in building a find command
that skips a set of directories and performs operations on a set of files.
This pattern can for example be used to keep certain files or directories from
being stripped, or to remove certain files from a package installation.

The notfirstword function is the inverse of the 'firstword' function in make:
it returns all but the first word.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-06-23 23:14:56 +02:00
Thomas Petazzoni c0e6b52482 pkg-*.mk: add some comments, update some existing comments
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19 16:08:09 +02:00
Thomas Petazzoni 6e6b99a571 Split Makefile.package.in in pkg-download.mk, pkg-utils.mk and pkg-gentargets.mk
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19 16:07:15 +02:00