diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index fa68f14ca0..2508d75cce 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -749,12 +749,10 @@ $(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES) endif $(2)_MANIFEST_LICENSE_FILES ?= not saved -# If the package declares _LICENSE_FILES, we need to extract it, -# for overriden, local or normal remote packages alike, whether -# we want to redistribute it or not. -ifneq ($$($(2)_LICENSE_FILES),) +# We need to extract and patch a package to be able to retrieve its +# license files (if any) and the list of patches applied to it (if +# any). $(1)-legal-info: $(1)-patch -endif # We only save the sources of packages we want to redistribute, that are # non-overriden (local or true override). @@ -810,6 +808,13 @@ endif $$(Q)support/scripts/hardlink-or-copy \ $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL) \ $$($(2)_REDIST_SOURCES_DIR) +# Save patches and generate the series file + $$(Q)while read f; do \ + support/scripts/hardlink-or-copy \ + $$$${f} \ + $$($(2)_REDIST_SOURCES_DIR) || exit 1; \ + printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \ + done <$$($(2)_DIR)/.applied_patches_list endif # redistribute endif # other packages diff --git a/support/legal-info/README.header b/support/legal-info/README.header index d07c45d912..418de14588 100644 --- a/support/legal-info/README.header +++ b/support/legal-info/README.header @@ -14,10 +14,11 @@ This material is composed of the following items. compiled programs. Note: this may have not been saved due to technical limitations, you may need to collect it manually. - * The source code for all packages; this has been saved in the sources/ - subdirectory (except for the non-redistributable packages, which have not - been saved); patches applied to some packages by Buildroot are included in - the Buildroot sources and were not duplicated in the sources/ subdirectory. + * The original source code for all packages; this has been saved in the + sources/ subdirectory (except for the non-redistributable packages, which + have not been saved). Patches that were applied are also saved, along + with a file named 'series' that lists the patches in the order they were + applied. * A manifest file listing the configured packages and related information. * The license text of the packages; they have been saved in the licenses/ subdirectory.