from bb import data, event, mkdirhier, utils
import bb, os, sys
+import bb.utils
# When we execute a python function we'd like certain things
# in all namespaces, hence we add them to __builtins__
else:
dirs = (data.expand(flags['dirs'], d) or "").split()
for adir in dirs:
- mkdirhier(adir)
+ bb.utils.mkdirhier(adir)
if len(dirs) > 0:
adir = dirs[-1]
t = data.getVar('T', d, 1)
if not t:
bb.msg.fatal(bb.msg.domain.Build, "T not set")
- mkdirhier(t)
+ bb.utils.mkdirhier(t)
logfile = "%s/log.%s.%s" % (t, func, str(os.getpid()))
runfile = "%s/run.%s.%s" % (t, func, str(os.getpid()))
if not stamp:
return
stamp = "%s.%s" % (stamp, task)
- mkdirhier(os.path.dirname(stamp))
+ bb.utils.mkdirhier(os.path.dirname(stamp))
# Remove the file and recreate to force timestamp
# change on broken NFS filesystems
if os.access(stamp, os.F_OK):
import os
import bb
+import bb.utils
from bb import data
from bb.fetch import Fetch
if path[0] != "/":
filespath = data.getVar('FILESPATH', d, 1)
if filespath:
- newpath = bb.which(filespath, path)
+ newpath = bb.utils.which(filespath, path)
if not newpath:
filesdir = data.getVar('FILESDIR', d, 1)
if filesdir:
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
+from bb.fetch import encodeurl, decodeurl
class Wget(Fetch):
"""Class to fetch urls via 'wget'"""
def localpath(self, url, ud, d):
- url = bb.encodeurl([ud.type, ud.host, ud.path, ud.user, ud.pswd, {}])
+ url = encodeurl([ud.type, ud.host, ud.path, ud.user, ud.pswd, {}])
ud.basename = os.path.basename(ud.path)
ud.localfile = data.expand(os.path.basename(url), d)
fetchcmd = data.getVar("FETCHCOMMAND", d, 1)
uri = uri.split(";")[0]
- uri_decoded = list(bb.decodeurl(uri))
+ uri_decoded = list(decodeurl(uri))
uri_type = uri_decoded[0]
uri_host = uri_decoded[1]
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb, os
+import bb.utils
try:
import sqlite3
try:
os.stat(self.cachedir)
except OSError:
- bb.mkdirhier(self.cachedir)
+ bb.utils.mkdirhier(self.cachedir)
self.cachefile = os.path.join(self.cachedir,"bb_persist_data.sqlite3")
bb.msg.debug(1, bb.msg.domain.PersistData, "Using '%s' as the persistent data cache" % self.cachefile)