mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
Add support for local packages through 'file://' pseudo-protocol
This can be used this way : <pkg>_VERSION = 42 <pkg>_SITE = file:///some/local/directory <pkg>_SOURCE = mypkg-$(<pkg>_VERSION).tar.bz2 Can be useful to integrate a home-made project or for testing purposes. The default command to retrieve files is 'cp' but 'rsync' could also be used. Through sshfs, it should also be possible to get non-public remote files on a ssh server. [ Thomas Petazzoni: use $(PKG)_SITE and $(PKG)_SOURCE variables instead of $(1) and $(2) ] [ Peter: don't append $(QUIET), cp doesn't handle -q] Signed-off-by: David Wagner <david.wagner@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
parent
9e4aeb3c2b
commit
2690e76aa2
@ -32,6 +32,10 @@ config BR2_GIT
|
|||||||
string "Git command"
|
string "Git command"
|
||||||
default "git"
|
default "git"
|
||||||
|
|
||||||
|
config BR2_LOCALFILES
|
||||||
|
string "Local files retrieval command"
|
||||||
|
default "cp"
|
||||||
|
|
||||||
config BR2_ZCAT
|
config BR2_ZCAT
|
||||||
string "zcat command"
|
string "zcat command"
|
||||||
default "gzip -d -c"
|
default "gzip -d -c"
|
||||||
|
@ -92,6 +92,7 @@ WGET:=$(call qstrip,$(BR2_WGET)) $(QUIET)
|
|||||||
SVN:=$(call qstrip,$(BR2_SVN)) $(QUIET)
|
SVN:=$(call qstrip,$(BR2_SVN)) $(QUIET)
|
||||||
BZR:=$(call qstrip,$(BR2_BZR)) $(QUIET)
|
BZR:=$(call qstrip,$(BR2_BZR)) $(QUIET)
|
||||||
GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
|
GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
|
||||||
|
LOCALFILES:=$(call qstrip,$(BR2_LOCALFILES))
|
||||||
|
|
||||||
# Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK'
|
# Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK'
|
||||||
# used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the
|
# used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the
|
||||||
@ -104,18 +105,18 @@ DL_DIR:=$(TOPDIR)/dl
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# The DOWNLOAD_{GIT,SVN,BZR} helpers are in charge of getting a
|
# The DOWNLOAD_{GIT,SVN,BZR,LOCALFILES} helpers are in charge of getting a
|
||||||
# working copy of the source repository for their corresponding SCM,
|
# working copy of the source repository for their corresponding SCM,
|
||||||
# checking out the requested version / commit / tag, and create an
|
# checking out the requested version / commit / tag, and create an
|
||||||
# archive out of it. DOWNLOAD_WGET is the normal wget-based download
|
# archive out of it. DOWNLOAD_WGET is the normal wget-based download
|
||||||
# mechanism.
|
# mechanism.
|
||||||
#
|
#
|
||||||
# The SOURCE_CHECK_{GIT,SVN,BZR,WGET} helpers are in charge of simply
|
# The SOURCE_CHECK_{GIT,SVN,BZR,WGET,LOCALFILES} helpers are in charge of simply
|
||||||
# checking that the source is available for download. This can be used
|
# checking that the source is available for download. This can be used
|
||||||
# to make sure one will be able to get all the sources needed for
|
# to make sure one will be able to get all the sources needed for
|
||||||
# one's build configuration.
|
# one's build configuration.
|
||||||
#
|
#
|
||||||
# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,WGET} helpers simply output to
|
# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,WGET,LOCALFILES} helpers simply output to
|
||||||
# the console the names of the files that will be downloaded, or path
|
# the console the names of the files that will be downloaded, or path
|
||||||
# and revision of the source repositories, producing a list of all the
|
# and revision of the source repositories, producing a list of all the
|
||||||
# "external dependencies" of a given build configuration.
|
# "external dependencies" of a given build configuration.
|
||||||
@ -189,6 +190,19 @@ define SHOW_EXTERNAL_DEPS_WGET
|
|||||||
echo $(2)
|
echo $(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define DOWNLOAD_LOCALFILES
|
||||||
|
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
|
||||||
|
$(LOCALFILES) $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE) $(DL_DIR)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SOURCE_CHECK_LOCALFILES
|
||||||
|
test -e $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SHOW_EXTERNAL_DEPS_LOCALFILES
|
||||||
|
echo $($(PKG)_SITE)/$($(PKG)_SOURCE)
|
||||||
|
endef
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# DOWNLOAD -- Download helper. Will try to download source from:
|
# DOWNLOAD -- Download helper. Will try to download source from:
|
||||||
# 1) BR2_PRIMARY_SITE if enabled
|
# 1) BR2_PRIMARY_SITE if enabled
|
||||||
@ -211,6 +225,7 @@ define DOWNLOAD
|
|||||||
git) $($(DL_MODE)_GIT) && exit ;; \
|
git) $($(DL_MODE)_GIT) && exit ;; \
|
||||||
svn) $($(DL_MODE)_SVN) && exit ;; \
|
svn) $($(DL_MODE)_SVN) && exit ;; \
|
||||||
bzr) $($(DL_MODE)_BZR) && exit ;; \
|
bzr) $($(DL_MODE)_BZR) && exit ;; \
|
||||||
|
file) $($(DL_MODE)_LOCALFILES) && exit ;; \
|
||||||
*) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
|
*) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
|
||||||
esac ; \
|
esac ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user