proxies to work better. (from Poky)
- Also allow user and pswd options in SRC_URIs globally (from Poky)
- Improve proxy handling when using mirrors (from Poky)
+ - Add bb.utils.prune_suffix function
+ - Fix hg checkouts of specific revisions (from Poky)
+ - Fix wget fetching of urls with parameters specified (from Poky)
+ - Add username handling to git fetcher (from Poky)
+ - Set HOME environmental variable when running fetcher commands (from Poky)
+ - Make sure allowed variables inherited from the environment are exported again (from Poky)
+ - When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
Changes in Bitbake 1.8.0:
- Release 1.7.x as a stable series
# Assign a file to __warn__ to get warnings about slow operations.
#
-from inspect import getmro
-
import copy
-import types, sets
+import types
types.ImmutableTypes = tuple([ \
types.BooleanType, \
types.ComplexType, \
types.LongType, \
types.NoneType, \
types.TupleType, \
- sets.ImmutableSet] + \
+ frozenset] + \
list(types.StringTypes))
MUTABLE = "__mutable__"
if __name__ == "__main__":
import doctest, bb
+ bb.msg.set_debug_level(0)
doctest.testmod(bb)
import os, re
import bb.data
import bb.utils
-from sets import Set
try:
import cPickle as pickle
(set elsewhere)
"""
self.ignored_dependencies = []
- self.world_target = Set()
+ self.world_target = set()
self.bbfile_priority = {}
self.bbfile_config_priorities = []
import bb
from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
from bb import xmlrpcserver, command
-from sets import Set
import itertools, sre_constants
class MultipleMatches(Exception):
self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build"
bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True)
- if bbpkgs:
+ if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
self.configuration.pkgs_to_build.extend(bbpkgs.split())
#
# Tweak some variables
item = self.bb_cache.getVar('PN', fn, True)
- self.status.ignored_dependencies = Set()
+ self.status.ignored_dependencies = set()
self.status.bbfile_priority[fn] = 1
# Remove external dependencies
self.status = bb.cache.CacheData()
ignore = bb.data.getVar("ASSUME_PROVIDED", self.configuration.data, 1) or ""
- self.status.ignored_dependencies = Set(ignore.split())
+ self.status.ignored_dependencies = set(ignore.split())
for dep in self.configuration.extra_assume_provided:
self.status.ignored_dependencies.add(dep)
if dirfiles:
newfiles += dirfiles
continue
- newfiles += glob.glob(f) or [ f ]
+ else:
+ globbed = glob.glob(f)
+ if not globbed and os.path.exists(f):
+ globbed = [f]
+ newfiles += globbed
bbmask = bb.data.getVar('BBMASK', self.configuration.data, 1)
bb.msg.fatal(bb.msg.domain.Collection, "BBMASK is not a valid regular expression.")
finalfiles = []
- for i in xrange( len( newfiles ) ):
- f = newfiles[i]
- if bbmask and bbmask_compiled.search(f):
+ for f in newfiles:
+ if bbmask_compiled.search(f):
bb.msg.debug(1, bb.msg.domain.Collection, "skipping masked file %s" % f)
masked += 1
continue
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import sys, os, re, time, types
+import sys, os, re, types
if sys.argv[0][-5:] == "pydoc":
path = os.path.dirname(os.path.dirname(sys.argv[1]))
else:
def _test():
"""Start a doctest run on this module"""
import doctest
+ import bb
from bb import data
+ bb.msg.set_debug_level(0)
doctest.testmod(data)
if __name__ == "__main__":
import bb
from bb import utils, methodpool
from COW import COWDictBase
-from sets import Set
from new import classobj
try:
self._special_values[keyword].add( base )
except:
- self._special_values[keyword] = Set()
+ self._special_values[keyword] = set()
self._special_values[keyword].add( base )
return
if '_' in var:
override = var[var.rfind('_')+1:]
if not self._seen_overrides.has_key(override):
- self._seen_overrides[override] = Set()
+ self._seen_overrides[override] = set()
self._seen_overrides[override].add( var )
# setting var
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re, fcntl
+import os, re
import bb
from bb import data
from bb import persist_data
-try:
- import cPickle as pickle
-except ImportError:
- import pickle
-
class FetchError(Exception):
"""Exception raised when a download fails"""
result_decoded[loc] = uri_decoded[loc]
import types
if type(i) == types.StringType:
- import re
if (re.match(i, uri_decoded[loc])):
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
if uri_find_decoded.index(i) == 2:
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
-from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Bzr(Fetch):
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
#
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
-from bb.fetch import FetchError
from bb.fetch import runfetchcmd
class Git(Fetch):
def localpath(self, url, ud, d):
- ud.proto = "rsync"
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
+ elif not ud.host:
+ ud.proto = 'file'
+ else:
+ ud.proto = "rsync"
ud.branch = ud.parm.get("branch", "master")
elif tag:
ud.tag = tag
- if not ud.tag:
+ if not ud.tag or ud.tag == "master":
ud.tag = self.latest_revision(url, ud, d)
- if ud.tag == "master":
- ud.tag = self.latest_revision(url, ud, d)
-
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
os.chdir(repodir)
# Remove all but the .git directory
- runfetchcmd("rm * -Rf", d)
- runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d)
- runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, ud.host, ud.path), d)
- runfetchcmd("git prune-packed", d)
- runfetchcmd("git pack-redundant --all | xargs -r rm", d)
+ if not self._contains_ref(ud.tag, d):
+ runfetchcmd("rm * -Rf", d)
+ runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d)
+ runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, ud.host, ud.path), d)
+ runfetchcmd("git prune-packed", d)
+ runfetchcmd("git pack-redundant --all | xargs -r rm", d)
os.chdir(repodir)
mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
def suppports_srcrev(self):
return True
+ def _contains_ref(self, tag, d):
+ output = runfetchcmd("git log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % tag, d, quiet=True)
+ return output.split()[0] != "0"
+
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import sys
import bb
from bb import data
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
runfetchcmd(updatecmd, d)
- updatecmd = self._buildhgcommand(ud, d, "update")
- bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
- runfetchcmd(updatecmd, d)
else:
fetchcmd = self._buildhgcommand(ud, d, "fetch")
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
os.chdir(ud.pkgdir)
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % fetchcmd)
runfetchcmd(fetchcmd, d)
+
+ # Even when we clone (fetch), we still need to update as hg's clone
+ # won't checkout the specified revision if its on a branch
+ updatecmd = self._buildhgcommand(ud, d, "update")
+ bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % updatecmd)
+ runfetchcmd(updatecmd, d)
os.chdir(ud.pkgdir)
try:
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
-from bb.fetch import MissingParameterError
class Perforce(Fetch):
def supports(self, url, ud, d):
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, os
-import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
-from bb.fetch import MissingParameterError
__pattern__ = re.compile(r'''
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
svkroot = ud.host + ud.path
+ # pyflakes claims date is not known... it looks right
svkcmd = "svk co -r {%s} %s/%s" % (date, svkroot, ud.module)
if ud.revision:
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import sys
import bb
from bb import data
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os
import bb
from bb import data
from bb.fetch import Fetch
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import sys, os, re, bb
-from bb import utils, event
+import sys, bb
+from bb import event
debug_level = {}
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import os, re
+import re
from bb import data, utils
import bb
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from bb import msg, data, event, mkdirhier, utils
-from sets import Set
import bb, os, sys
import signal
import stat
self.runq_fnid.append(taskData.tasks_fnid[task])
self.runq_task.append(taskData.tasks_name[task])
- self.runq_depends.append(Set(depends))
- self.runq_revdeps.append(Set())
+ self.runq_depends.append(set(depends))
+ self.runq_revdeps.append(set())
runq_build.append(0)
if maps[origdep] == -1:
bb.msg.fatal(bb.msg.domain.RunQueue, "Invalid mapping - Should never happen!")
newdeps.append(maps[origdep])
- self.runq_depends[listid] = Set(newdeps)
+ self.runq_depends[listid] = set(newdeps)
bb.msg.note(2, bb.msg.domain.RunQueue, "Assign Weightings")
def stage( self, params ):
"""Execute 'stage' on a providee"""
- self.build( params, "stage" )
+ self.build( params, "populate_staging" )
stage.usage = "<providee>"
def status( self, params ):
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-from bb import data, event, mkdirhier, utils
-import bb, os
+import bb
class TaskData:
"""
import gtk
import gobject
-import gtk.glade
import threading
-import urllib2
import os
import datetime
import time
import gtk
import gobject
-import gtk.glade
class RunningBuildModel (gtk.TreeStore):
(COL_TYPE, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_ACTIVE) = (0, 1, 2, 3, 4, 5)
import gobject
import gtk
import threading
+import xmlrpclib
# Package Model
(COL_PKG_NAME) = (0)
import gobject
import gtk
-import threading
-import bb.ui.uihelper
+import xmlrpclib
from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild
def event_handle_idle_func (eventHandler, build):
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
-import bb
-from bb import cooker
import sys
-import time
import itertools
import xmlrpclib
"""
-import os, sys, curses, time, random, threading, itertools, time
-from curses.textpad import Textbox
+import os, sys, curses, itertools, time
import bb
+import xmlrpclib
from bb import ui
from bb.ui import uihelper
def __init__( self, x, y, width, height ):
NCursesUI.Window.__init__( self, x, y, width, height )
+# put that to the top again from curses.textpad import Textbox
# self.textbox = Textbox( self.win )
# t = threading.Thread()
# t.run = self.textbox.edit
import threading
import urllib2
import os
-import datetime
from bb.ui.crumbs.buildmanager import BuildManager, BuildConfiguration
from bb.ui.crumbs.buildmanager import BuildManagerTreeView
client/server deadlocks.
"""
-import sys, socket, threading
+import socket, threading
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
class BBUIEventQueue:
self.BBServer = BBServer
self.t = threading.Thread()
- self.t.setDaemon(True)\r
- self.t.run = self.startCallbackHandler\r
+ self.t.setDaemon(True)
+ self.t.run = self.startCallbackHandler
self.t.start()
def getEvent(self):
def startCallbackHandler(self):
server = UIXMLRPCServer()
- self.host, self.port = server.socket.getsockname()\r
+ self.host, self.port = server.socket.getsockname()
server.register_function( self.system_quit, "event.quit" )
server.register_function( self.queue_event, "event.send" )
server.handle_request()
server.server_close()
- def system_quit( self ):\r
+ def system_quit( self ):
"""
Shut down the callback thread
"""
class UIXMLRPCServer (SimpleXMLRPCServer):
- def __init__( self, interface = ("localhost", 0) ):\r
+ def __init__( self, interface = ("localhost", 0) ):
self.quit = False
- SimpleXMLRPCServer.__init__( self,\r
- interface,\r
- requestHandler=SimpleXMLRPCRequestHandler,\r
+ SimpleXMLRPCServer.__init__( self,
+ interface,
+ requestHandler=SimpleXMLRPCRequestHandler,
logRequests=False, allow_none=True)
def get_request(self):
if request is None:
return
SimpleXMLRPCServer.process_request(self, request, client_address)
-\r
+
DEBUG = False
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
-import os, sys, inspect, select
+import inspect, select
class BitBakeServerCommands():
def __init__(self, server, cooker):