diff options
-rw-r--r-- | doc/bitbake-user-manual/bitbake-user-manual-fetching.xml | 8 | ||||
-rw-r--r-- | doc/bitbake-user-manual/bitbake-user-manual-metadata.xml | 2 | ||||
-rw-r--r-- | lib/bb/checksum.py | 2 | ||||
-rw-r--r-- | lib/bb/fetch2/__init__.py | 3 | ||||
-rw-r--r-- | lib/bb/fetch2/clearcase.py | 3 | ||||
-rw-r--r-- | lib/bb/fetch2/git.py | 2 | ||||
-rw-r--r-- | lib/bb/fetch2/npm.py | 1 | ||||
-rwxr-xr-x | lib/bb/main.py | 7 | ||||
-rw-r--r-- | lib/bb/tests/fetch.py | 8 | ||||
-rw-r--r-- | lib/bb/utils.py | 13 | ||||
-rw-r--r-- | lib/toaster/bldcontrol/management/commands/checksettings.py | 5 |
11 files changed, 37 insertions, 17 deletions
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml b/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml index c721e86eb..43eae6b85 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml +++ b/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml @@ -588,6 +588,14 @@ The name of the path in which to place the checkout. By default, the path is <filename>git/</filename>. </para></listitem> + <listitem><para><emphasis>"usehead":</emphasis> + Enables local <filename>git://</filename> URLs to use the + current branch HEAD as the revision for use with + <filename>AUTOREV</filename>. + The "usehead" parameter implies no branch and only works + when the transfer protocol is + <filename>file://</filename>. + </para></listitem> </itemizedlist> Here are some example URLs: <literallayout class='monospaced'> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml index 0cfa53d02..918d0fbcb 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml @@ -502,7 +502,7 @@ </section> <section id='unsetting-variables'> - <title>Unseting variables</title> + <title>Unsetting variables</title> <para> It is possible to completely remove a variable or a variable flag diff --git a/lib/bb/checksum.py b/lib/bb/checksum.py index 84289208f..4e1598fe8 100644 --- a/lib/bb/checksum.py +++ b/lib/bb/checksum.py @@ -97,6 +97,8 @@ class FileChecksumCache(MultiProcessCache): def checksum_dir(pth): # Handle directories recursively + if pth == "/": + bb.fatal("Refusing to checksum /") dirchecksums = [] for root, dirs, files in os.walk(pth): for name in files: diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index f70f1b515..e758a6818 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -853,6 +853,9 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None): if val: cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) + # Disable pseudo as it may affect ssh, potentially causing it to hang. + cmd = 'export PSEUDO_DISABLED=1; ' + cmd + logger.debug(1, "Running %s", cmd) success = False diff --git a/lib/bb/fetch2/clearcase.py b/lib/bb/fetch2/clearcase.py index 36beab6a5..3a6573d0b 100644 --- a/lib/bb/fetch2/clearcase.py +++ b/lib/bb/fetch2/clearcase.py @@ -69,7 +69,6 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd from bb.fetch2 import logger -from distutils import spawn class ClearCase(FetchMethod): """Class to fetch urls via 'clearcase'""" @@ -107,7 +106,7 @@ class ClearCase(FetchMethod): else: ud.module = "" - ud.basecmd = d.getVar("FETCHCMD_ccrc") or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool") + ud.basecmd = d.getVar("FETCHCMD_ccrc") or "/usr/bin/env cleartool || rcleartool" if d.getVar("SRCREV") == "INVALID": raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.") diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index 5ef8cd69e..758acb6a7 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -357,7 +357,7 @@ class Git(FetchMethod): logger.debug(1, "No Origin") runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d, workdir=ud.clonedir) - fetch_cmd = "LANG=C %s fetch -f --prune --progress %s refs/*:refs/*" % (ud.basecmd, repourl) + fetch_cmd = "LANG=C %s fetch -f --progress %s refs/*:refs/*" % (ud.basecmd, repourl) if ud.proto.lower() != 'file': bb.fetch2.check_network_access(d, fetch_cmd, ud.url) progresshandler = GitProgressHandler(d) diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py index b5f148ca0..ccc287b16 100644 --- a/lib/bb/fetch2/npm.py +++ b/lib/bb/fetch2/npm.py @@ -32,7 +32,6 @@ from bb.fetch2 import runfetchcmd from bb.fetch2 import logger from bb.fetch2 import UnpackError from bb.fetch2 import ParameterError -from distutils import spawn def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually not what diff --git a/lib/bb/main.py b/lib/bb/main.py index 7711b290d..85d933266 100755 --- a/lib/bb/main.py +++ b/lib/bb/main.py @@ -401,9 +401,6 @@ def setup_bitbake(configParams, configuration, extrafeatures=None): # In status only mode there are no logs and no UI logger.addHandler(handler) - # Clear away any spurious environment variables while we stoke up the cooker - cleanedvars = bb.utils.clean_environment() - if configParams.server_only: featureset = [] ui_module = None @@ -419,6 +416,10 @@ def setup_bitbake(configParams, configuration, extrafeatures=None): server_connection = None + # Clear away any spurious environment variables while we stoke up the cooker + # (done after import_extension_module() above since for example import gi triggers env var usage) + cleanedvars = bb.utils.clean_environment() + if configParams.remote_server: # Connect to a remote XMLRPC server server_connection = bb.server.xmlrpcclient.connectXMLRPC(configParams.remote_server, featureset, diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index 7d7c5d7ff..53146d903 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -757,12 +757,12 @@ class FetchLatestVersionTest(FetcherTest): ("dtc", "git://git.qemu.org/dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "") : "1.4.0", # combination version pattern - ("sysprof", "git://git.gnome.org/sysprof", "cd44ee6644c3641507fb53b8a2a69137f2971219", "") + ("sysprof", "git://gitlab.gnome.org/GNOME/sysprof;protocol=https", "cd44ee6644c3641507fb53b8a2a69137f2971219", "") : "1.2.0", ("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "") : "2014.01", # version pattern "yyyymmdd" - ("mobile-broadband-provider-info", "git://git.gnome.org/mobile-broadband-provider-info", "4ed19e11c2975105b71b956440acdb25d46a347d", "") + ("mobile-broadband-provider-info", "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info;protocol=https", "4ed19e11c2975105b71b956440acdb25d46a347d", "") : "20120614", # packages with a valid UPSTREAM_CHECK_GITTAGREGEX ("xf86-video-omap", "git://anongit.freedesktop.org/xorg/driver/xf86-video-omap", "ae0394e687f1a77e966cf72f895da91840dffb8f", "(?P<pver>(\d+\.(\d\.?)*))") @@ -796,8 +796,8 @@ class FetchLatestVersionTest(FetcherTest): # packages with valid UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX ("cups", "http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2", "https://github.com/apple/cups/releases", "(?P<name>cups\-)(?P<pver>((\d+[\.\-_]*)+))\-source\.tar\.gz") : "2.0.0", - ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html", "http://download.oracle.com/otn/berkeley-db/(?P<name>db-)(?P<pver>((\d+[\.\-_]*)+))\.tar\.gz") - : "6.1.19", + ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://ftp.debian.org/debian/pool/main/d/db5.3/", "(?P<name>db5\.3_)(?P<pver>\d+(\.\d+)+).+\.orig\.tar\.xz") + : "5.3.10", } @skipIfNoNetwork() diff --git a/lib/bb/utils.py b/lib/bb/utils.py index c540b49cf..f75312399 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -523,12 +523,17 @@ def md5_file(filename): """ Return the hex string representation of the MD5 checksum of filename. """ - import hashlib - m = hashlib.md5() + import hashlib, mmap with open(filename, "rb") as f: - for line in f: - m.update(line) + m = hashlib.md5() + try: + with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as mm: + for chunk in iter(lambda: mm.read(8192), b''): + m.update(chunk) + except ValueError: + # You can't mmap() an empty file so silence this exception + pass return m.hexdigest() def sha256_file(filename): diff --git a/lib/toaster/bldcontrol/management/commands/checksettings.py b/lib/toaster/bldcontrol/management/commands/checksettings.py index 582114ac9..823c6f154 100644 --- a/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -107,7 +107,10 @@ class Command(BaseCommand): action="ignore", message="^.*No fixture named.*$") print("Importing custom settings if present") - call_command("loaddata", "custom") + try: + call_command("loaddata", "custom") + except: + print("NOTE: optional fixture 'custom' not found") # we run lsupdates after config update print("\nFetching information from the layer index, " |