openwrt/include
Christian Marangi 9536446965
quilt.mk: don't error on refresh/update if patches doesn't exist
The current code fails if we have package or host tools with no patches
to apply. The error printend is the following: (taking ubus as an
example)

make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[1]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt'
make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
The source directory contains no quilt patches.
make[2]: *** [Makefile:81: quilt-check] Error 1
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
time: package/system/ubus/refresh#0.06#0.00#0.07
    ERROR: package/system/ubus failed to build.
make[1]: *** [package/Makefile:120: package/system/ubus/refresh] Error 1
make[1]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt'
make: *** [/home/ansuel/openwrt-ansuel/openwrt/include/toplevel.mk:232: package/ubus/refresh] Error 2

We exit 1 after saying that there are no patches because later in the
function quilt pop fails to execute.

Having no patches for a package and calling refresh should not be
a critical error and the function should just do nothing.

To handle this improve quilt.mk with the following addition.
- If we don't have any patch for the package, we print a warning and we
  create an empty series. This is useful to trick quilt and make it do
  nothing.
  We also create a status file .quilt_no_patch to detect in the other
  function that we don't have patches to handle.
- In refresh makefile target, we check if .quilt_no_patch exist and
  we skip quilt cleanup if this exist.
- In RefreshDir function we change the logic and now we delete the
  patches directory and not only the content. This is done as a cleanup
  to clean case with empty patches directory.
- In RefreshDir we check if .quilt_no_patch exist and we skip creating
  the patches directory and copying the refreshed patches.
- In RefreshDir we delete at the end any trace of .quilt_no_patch if
  present.

This is needed to support run like package/refresh that will run the
refresh process on any package present in the buildroot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-06 21:59:29 +02:00
..
site generic: groundwork for RISC-V 2023-05-28 13:19:10 +02:00
autotools.mk autotools: add list of fake paths to tools 2023-05-04 06:07:26 +02:00
bpf.mk
cmake.mk build: suppress cmake warnings about unused vars 2023-10-04 12:28:45 +02:00
debug.mk
depends.mk
device_table.txt
download.mk build: make git sub-modules to fetch configurable 2023-07-28 09:00:49 +02:00
feeds.mk
hardened-ld-pie.specs
hardening.mk
host-build.mk host-build: add support for a stampfile per installed binary 2023-06-05 08:31:53 +02:00
image-commands.mk image: add additional fields to Netgear encrypted image 2023-07-01 14:42:11 +02:00
image.mk build: add ALT5 vendor/model/variant 2023-07-08 20:19:00 +02:00
kernel-5.15 kernel: bump 5.15 to 5.15.133 2023-10-04 21:03:12 +02:00
kernel-6.1 kernel: bump 6.1 to 6.1.55 2023-09-24 12:45:34 +02:00
kernel-build.mk
kernel-defaults.mk kernel: add CONFIG_INITRAMFS_PRESERVE_MTIME config to Initramfs function 2023-05-22 22:28:18 +02:00
kernel-version.mk kernel: fix wrong detection of Linux-Testing-Version in makefile DUMP 2023-05-31 20:28:40 +02:00
kernel.mk kernel: fix KernelPackage when all KCONFIG are versioned 2023-07-04 19:29:41 +02:00
logo.png
logo.svg
meson.mk meson: prepare to use different linkers 2023-07-04 20:25:40 +02:00
netfilter.mk
nls.mk
openssl-module.mk
package-bin.mk
package-defaults.mk
package-dumpinfo.mk
package-ipkg.mk build: replace SourceName with PKG_NAME compile unit name 2023-09-24 19:33:53 +02:00
package-seccomp.mk
package.mk build: add support to use the mold linker for packages 2023-07-04 20:25:41 +02:00
prereq-build.mk prereq-build: increase GCC requirement to 8 2023-08-14 20:18:42 +02:00
prereq.mk prereq: merge common cases in SetupHostCommand 2023-08-26 14:00:36 +02:00
quilt.mk quilt.mk: don't error on refresh/update if patches doesn't exist 2023-10-06 21:59:29 +02:00
rootfs.mk
scan.awk
scan.mk treewide: add ORIG_PATH variable 2023-06-05 08:31:47 +02:00
shell.sh
subdir.mk
target.mk generic: groundwork for RISC-V 2023-05-28 13:19:10 +02:00
toolchain-build.mk
toplevel.mk treewide: add ORIG_PATH variable 2023-06-05 08:31:47 +02:00
trusted-firmware-a.mk
u-boot.mk u-boot.mk: add support for config customization 2023-06-10 21:31:07 +02:00
uclibc++.mk
unpack.mk
verbose.mk
version.mk