Skip to contentSkip to conversation

core: do not attempt downloads with no _VERSION set

PATCH New Thomas Petazzoni 2 participants 15 messages Jul 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/13 core: do not attempt downloads with no _VERSION set

From: Alex Suykov <[email protected]>

Currently, when the package defines no _SOURCE and no _VERSION variables, we end up trying to download <PACKAGE>-undefined.tar.gz.

This is utterly pointless.

Change the logic to not attempt a download when neither _SOURCE nor _VERSION is set:
- do not set an undefined _VERSION to "undefined"
- do not append an empty (or "undefined") version to the package rawname

Consequently, for packages that have no _VERSION, the build directory will be just the package name (which to some may look nicer than the current "package-undefined").

Furthermore, the message trace is also a bit leaner (to the same people that find "package" nicer than "package-undefined").

---
 package/pkg-generic.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/pkg-generic.mk +3 -5
index 94187f9..dab455c 100644
@@ -386,8 +386,6 @@ ifndef $(2)_VERSION
   $(2)_DL_VERSION := $$($(3)_DL_VERSION)
  else ifdef $(3)_VERSION
   $(2)_DL_VERSION := $$($(3)_VERSION)
- else
-  $(2)_DL_VERSION = undefined
  endif
 else
  $(2)_DL_VERSION := $$(strip $$($(2)_VERSION))
@@ -398,8 +396,8 @@ ifdef $(3)_OVERRIDE_SRCDIR
   $(2)_OVERRIDE_SRCDIR ?= $$($(3)_OVERRIDE_SRCDIR)
 endif
 
-$(2)_BASE_NAME	=  $(1)-$$($(2)_VERSION)
-$(2)_RAW_BASE_NAME = $$($(2)_RAWNAME)-$$($(2)_VERSION)
+$(2)_BASE_NAME	= $$(if $$($(2)_VERSION),$(1)-$$($(2)_VERSION),$(1))
+$(2)_RAW_BASE_NAME = $$(if $$($(2)_VERSION),$$($(2)_RAWNAME)-$$($(2)_VERSION),$$($(2)_RAWNAME))
 $(2)_DL_DIR	=  $$(DL_DIR)/$$($(2)_BASE_NAME)
 $(2)_DIR	=  $$(BUILD_DIR)/$$($(2)_BASE_NAME)
 
@@ -429,7 +427,7 @@ endif
 ifndef $(2)_SOURCE
  ifdef $(3)_SOURCE
   $(2)_SOURCE = $$($(3)_SOURCE)
- else
+ else ifdef $(2)_VERSION
   $(2)_SOURCE			?= $$($(2)_RAW_BASE_NAME).tar.gz
  endif
 endif
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/13 makedevs: remove VERSION/SOURCE

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the VERSION and SOURCE variables in the makedevs package.

---
 package/makedevs/makedevs.mk | 5 -----
 1 file changed, 5 deletions(-)
package/makedevs/makedevs.mk +0 -5
index 130f5bc..95933c4 100644
@@ -4,11 +4,6 @@
 #
 ################################################################################
 
-# source included in buildroot
-MAKEDEVS_SOURCE =
-HOST_MAKEDEVS_SOURCE =
-
-MAKEDEVS_VERSION = buildroot-$(BR2_VERSION)
 MAKEDEVS_LICENSE = GPLv2
 
 HOST_MAKEDEVS_CFLAGS = $(HOST_CFLAGS)
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/13 makedevs: remove VERSION/SOURCE

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Now that the package infrastructure doen't attempt to download a package

s/doen/doesn/ (everywhere).

Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 3/13 pkg-virtual: remove VERSION/SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the VERSION and SOURCE variables in the virtual package infrastructure.

---
 package/pkg-virtual.mk | 6 ------
 1 file changed, 6 deletions(-)
package/pkg-virtual.mk +0 -6
index 3fbe0a3..bcb2cad 100644
@@ -43,12 +43,6 @@ endif
 
 $(2)_IS_VIRTUAL = YES
 
-# A virtual package does not have any source associated
-$(2)_SOURCE =
-
-# Fake a version string, so it looks nicer in the build log
-$(2)_VERSION = virtual
-
 # Add dependency against the provider
 $(2)_DEPENDENCIES += $$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2)))
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/13 getent: remove VERSION/SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the VERSION and SOURCE variables in the getent package.

---
 package/getent/getent.mk | 4 ----
 1 file changed, 4 deletions(-)
package/getent/getent.mk +0 -4
index 18f0991..ed249e8 100644
@@ -4,10 +4,6 @@
 #
 ################################################################################
 
-# source included in Buildroot
-GETENT_SOURCE =
-
-GETENT_VERSION = buildroot-$(BR2_VERSION)
 GETENT_LICENSE = LGPLv2.1+
 
 # For glibc toolchains, we use the getent program built/installed by
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/13 initscripts: remove SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the initscripts package.

---
 package/initscripts/initscripts.mk | 3 ---
 1 file changed, 3 deletions(-)
package/initscripts/initscripts.mk +0 -3
index a5d8db7..cfee155 100644
@@ -4,9 +4,6 @@
 #
 ################################################################################
 
-# source included in buildroot
-INITSCRIPTS_SOURCE =
-
 define INITSCRIPTS_INSTALL_TARGET_CMDS
 	mkdir -p  $(TARGET_DIR)/etc/init.d
 	$(INSTALL) -D -m 0755 package/initscripts/init.d/* $(TARGET_DIR)/etc/init.d/
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/13 mke2img: remove SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the mke2img package.

---
 package/mke2img/mke2img.mk | 1 -
 1 file changed, 1 deletion(-)
package/mke2img/mke2img.mk +0 -1
index 04aaa8f..9de387a 100644
@@ -4,7 +4,6 @@
 #
 ################################################################################
 
-HOST_MKE2IMG_SOURCE =
 HOST_MKE2IMG_DEPENDENCIES = host-genext2fs host-e2fsprogs
 
 define HOST_MKE2IMG_INSTALL_CMDS
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/13 mkpasswd: remove VERSION/SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the VERSION and SOURCE variables in the mkpasswd package.

---
 package/mkpasswd/mkpasswd.mk | 3 ---
 1 file changed, 3 deletions(-)
package/mkpasswd/mkpasswd.mk +0 -3
index 0447ecc..07935a4 100644
@@ -7,11 +7,8 @@
 # source included in buildroot, taken from
 # https://github.com/rfc1036/whois/blob/master/
 # at revision 5a0f08500fa51608b6d3b73ee338be38c692eadb
-HOST_MKPASSWD_SOURCE =
 HOST_MKPASSWD_LICENSE = GPLv2+
 
-HOST_MKPASSWD_VERSION = buildroot-$(BR2_VERSION)
-
 define HOST_MKPASSWD_BUILD_CMDS
 	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
 		package/mkpasswd/mkpasswd.c package/mkpasswd/utils.c \
Signature · 1 line
2.7.4
#8 lore raw

PATCH 8/13 mkpimage: remove SOURCE

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the mkpimage package.

---
 package/mkpimage/mkpimage.mk | 1 -
 1 file changed, 1 deletion(-)
package/mkpimage/mkpimage.mk +0 -1
index 6360902..c30a680 100644
@@ -7,7 +7,6 @@
 # source included in the package
 # came from barebox's repository:
 # http://git.pengutronix.de/?p=barebox.git;a=blob;f=scripts/socfpga_mkimage.c;h=1a7a66d98841e9f52c3ea49c651286aa1412c9a5;hb=HEAD
-HOST_MKPIMAGE_SOURCE =
 HOST_MKPIMAGE_LICENSE = GPLv2
 
 define HOST_MKPIMAGE_BUILD_CMDS
Signature · 1 line
2.7.4
#9 lore raw

PATCH 9/13 skeleton: remove SOURCE variable

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the skeleton package.

---
 package/skeleton/skeleton.mk | 3 ---
 1 file changed, 3 deletions(-)
package/skeleton/skeleton.mk +0 -3
index 4e3cdc6..d8d1e70 100644
@@ -4,9 +4,6 @@
 #
 ################################################################################
 
-# source included in buildroot
-SKELETON_SOURCE =
-
 # The skeleton can't depend on the toolchain, since all packages depends on the
 # skeleton and the toolchain is a target package, as is skeleton.
 # Hence, skeleton would depends on the toolchain and the toolchain would depend
Signature · 1 line
2.7.4
#10 lore raw

PATCH 10/13 tz: remove SOURCE variable

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the tz package.

---
 package/tz/tz.mk | 1 -
 1 file changed, 1 deletion(-)
package/tz/tz.mk +0 -1
index 7a756eb..f0daf46 100644
@@ -4,7 +4,6 @@
 #
 ################################################################################
 
-TZ_SOURCE =
 TZ_DEPENDENCIES = host-tzdata host-tzdump
 TZ_LICENSE = Public domain
 
Signature · 1 line
2.7.4
#11 lore raw

PATCH 11/13 mcookie: remove SOURCE variable

In reply to Thomas Petazzoni

Now that the package infrastructure doen't attempt to download a package that has an empty version string, there's no need to define the SOURCE variable in the mcookie package.

---
 package/x11r7/mcookie/mcookie.mk | 2 --
 1 file changed, 2 deletions(-)
package/x11r7/mcookie/mcookie.mk +0 -2
index 87a236f..b14599d 100644
@@ -4,8 +4,6 @@
 #
 ################################################################################
 
-# Source included in Buildroot
-MCOOKIE_SOURCE =
 MCOOKIE_LICENSE = Public Domain
 
 define MCOOKIE_EXTRACT_CMDS
Signature · 1 line
2.7.4
#12 lore raw

PATCH 12/13 toolchain-external: remove SOURCE/SITE for locally available toolchain

In reply to Thomas Petazzoni

When the custom external toolchain is locally available, we currently define SITE/SOURCE to empty variables. Now that the package infrastructure doesn't define a value for SOURCE when VERSION is empty, it doesn't attempt to download a file anymore, so we can get rid of those empty SOURCE/SITE variables in the toolchain-external package.

---
 toolchain/toolchain-external/toolchain-external.mk | 8 --------
 1 file changed, 8 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +0 -8
index 7f46234..342bc84 100644
@@ -453,14 +453,6 @@ TOOLCHAIN_EXTERNAL_ACTUAL_SOURCE_TARBALL ?= \
 	$(subst -i686-pc-linux-gnu.tar.bz2,.src.tar.bz2,$(subst -i686-pc-linux-gnu-i386-linux.tar.bz2,-i686-pc-linux-gnu.src.tar.bz2,$(TOOLCHAIN_EXTERNAL_SOURCE)))
 endif
 
-# In fact, we don't need to download the toolchain, since it is already
-# available on the system, so force the site and source to be empty so
-# that nothing will be downloaded/extracted.
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED),y)
-TOOLCHAIN_EXTERNAL_SITE =
-TOOLCHAIN_EXTERNAL_SOURCE =
-endif
-
 TOOLCHAIN_EXTERNAL_ADD_TOOLCHAIN_DEPENDENCY = NO
 
 TOOLCHAIN_EXTERNAL_INSTALL_STAGING = YES
Signature · 1 line
2.7.4
#13 lore raw

PATCH 13/13 pkg-generic: check that SITE has a value when SOURCE

In reply to Thomas Petazzoni

Currently, when an user forgets to define a SITE, he gets some fairly weird download failure. In order to make things easier to diagnose, this commit adds a check in the package infrastructure that verifies that if SOURCE has a value, SITE is not empty.

Cc Thomas De Schampheleire <[email protected]>
---
 package/pkg-generic.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/pkg-generic.mk +6 -0
index dab455c..0c9c7ab 100644
@@ -938,6 +938,12 @@ endif
 	$(1)-source \
 	$(1)-source-check
 
+ifneq ($$($(2)_SOURCE),)
+ifeq ($$($(2)_SITE),)
+$$(error $(2)_SITE cannot be empty when $(2)_SOURCE is not)
+endif
+endif
+
 ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR)
 $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash)
 endif
Signature · 1 line
2.7.4
#14 lore raw

PATCH 1/13 core: do not attempt downloads with no _VERSION set

In reply to Thomas Petazzoni
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

From: Alex Suykov <[email protected]>
Currently, when the package defines no _SOURCE and no _VERSION variables, we end up trying to download <PACKAGE>-undefined.tar.gz.

This is utterly pointless.

Change the logic to not attempt a download when neither _SOURCE nor _VERSION is set:
- do not set an undefined _VERSION to "undefined"
- do not append an empty (or "undefined") version to the package rawname

Consequently, for packages that have no _VERSION, the build directory will be just the package name (which to some may look nicer than the current "package-undefined").

Quoted 8 lines

Furthermore, the message trace is also a bit leaner (to the same people that find "package" nicer than "package-undefined").

Committed entire series, thanks.

Signature · 1 line
Bye, Peter Korsgaard