[V2,4/4,RFC] pkg-perl: add per package upgrade target

Message ID 20181011161248.13457-5-francois.perrad@gadz.org
State New
Headers show
Series
  • scancpan
Related show

Commit Message

Francois Perrad Oct. 11, 2018, 4:12 p.m.
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/pkg-generic.mk |  6 +++++-
 package/pkg-perl.mk    | 11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 91b61c6de..f349c6c1f 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -779,6 +779,9 @@  $(1)-external-deps:
 	@echo "file://$$($(2)_OVERRIDE_SRCDIR)"
 endif
 
+$(1)-upgrade:
+			+$$($(2)_UPGRADE_CMDS)
+
 $(1)-show-version:
 			@echo $$($(2)_VERSION)
 
@@ -1030,7 +1033,8 @@  DL_TOOLS_DEPENDENCIES += $$(call extractor-dependency,$$($(2)_SOURCE))
 	$(1)-rsync \
 	$(1)-show-depends \
 	$(1)-show-version \
-	$(1)-source
+	$(1)-source \
+	$(1)-upgrade
 
 ifneq ($$($(2)_SOURCE),)
 ifeq ($$($(2)_SITE),)
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 74a116075..53413b3eb 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -61,6 +61,17 @@  ifeq ($(4),target)
 SCANCPAN_ALL_DISTRIB += $$($(2)_DISTNAME)
 endif
 
+# Upgrade helper
+ifeq ($(4),target)
+define $(2)_UPGRADE_CMDS
+	utils/scancpan -force -target $$($(3)_DISTNAME)
+endef
+else
+define $(2)_UPGRADE_CMDS
+	utils/scancpan -force -host $$($(3)_DISTNAME)
+endef
+endif
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file. And take care of the differences between host and target