Beispiel #1
0
def updateLibs(trunkdir):
    if verbose:
        log.info("Running updateLibs")

    # This can only be run on unix systems
    # We can skip it on win32 because it doesn't actually create
    # build files.
    if sys.platform == "win32":
        return

    arch = getArch()
    c = 0
    for (path, dirs,
         files) in os.walk(os.path.join(trunkdir, "external", arch, "lib")):
        if ".svn" in dirs:
            dirs.remove(".svn")
        # performance optimization
        if "site-packages" in dirs:
            dirs.remove("site-packages")
        for file in files:
            if file.endswith(".a"):
                os.system('touch -t 199901011201 %s' %
                          os.path.join(path, file))
                c = c + 1
    log.info("Updated %d libraries in arch %s" % (c, arch))
Beispiel #2
0
def mailResults(recipients, comment, failureSetDiff, svnlog, date, revision,
                shortlog):
    """
  Mail results to a set of recipients, including the contents of the shortlog
  in the message. 
  """

    global overallStatus, currentOperation, config

    subject = "%s on %s/r%s  %s on %s" % (config["autobuildName"], getArch(),
                                          revision, overallStatus, date)
    messageText = "\nResults from autobuild of revision %s for %s on %s:\n\n" % \
        (revision, getArch(), date)

    if comment:
        messageText = messageText + "\n%s\n" % comment

    if failureSetDiff:
        messageText = messageText + "\n%s\n" % failureSetDiff

    if svnlog:
        messageText = messageText + "\n%s\n" % svnlog

    if shortlog is not None:
        messageText = messageText + \
            "\n\n------------------------------- Log -------------------\n"
        try:
            f = open(shortlog)
            for line in f.readlines():
                messageText = messageText + line
        except:
            messageText = messageText + "Unable to read log file '%s'\n" % shortlog

        messageText = messageText+ \
              "\n\n------------------------------- End of Log -------------------\n"
    mail.mail(config["sender"],
              recipients,
              subject,
              messageText,
              debug=(not haveNetwork))
Beispiel #3
0
def updateLibs(trunkdir):
    if verbose:
        log.info("Running updateLibs")

    # This can only be run on unix systems
    # We can skip it on win32 because it doesn't actually create
    # build files.
    if sys.platform == "win32":
        return

    arch = getArch()
    c = 0
    for (path, dirs, files) in os.walk(os.path.join(trunkdir, "external", arch, "lib")):
        if ".svn" in dirs:
            dirs.remove(".svn")
        # performance optimization
        if "site-packages" in dirs:
            dirs.remove("site-packages")
        for file in files:
            if file.endswith(".a"):
                os.system("touch -t 199901011201 %s" % os.path.join(path, file))
                c = c + 1
    log.info("Updated %d libraries in arch %s" % (c, arch))
Beispiel #4
0
    date = "Unknown date"
    buildRevision = 0
    stamp = "unknownRevision"

    # TODO: replace by socket.gethostname()?
    hostname = platform.node()
    hostname = hostname.replace(".numenta.com", "")
    hostname = hostname.replace(".local", "")
    hostname = hostname.lower()

    if hostname in config["nprocs"]:
        nprocs = config["nprocs"][hostname]
    else:
        nprocs = 1

    arch = getArch()
    rootdir = os.path.expanduser(os.path.join("~", "autobuild"))
    srcdir = os.path.join(rootdir, "src")
    statusdir = os.path.join(rootdir, "status")
    utils.createDir(statusdir, quiet=True)
    syslogFile = os.path.join(statusdir, "syslog")

    autobuildFailures = list()
    #
    # Grab the lock. Exit if we can't get it
    #
    lockfile = os.path.join(statusdir, "lock")
    try:
        lock = utils.getLock(lockfile, config["maxBuildTime"])
        if lock == True:
            syslog(syslogFile,
            delete_manifest_file = False
        g.saveProjects(save_project_files, delete_manifest_file)
        g.postGeneration()

    log.info('Done generating build files for %s' % helper.name)


if __name__ == '__main__':
    import getopt
    optionSpec = [
        "rootdir=", "platform=", "save", "testlist=", "win32BuildDir=",
        "win32InstallDir=", "win32PythonDir="
    ]

    rootdir = None
    platform = getArch()
    extraSubstitutions = dict()

    try:
        (opts, args) = getopt.gnu_getopt(sys.argv[1:], "", optionSpec)
    except Exception, e:
        print "Error parsing command line: %s" % e
        usage()

    if len(args) > 0:
        usage()

    save_project_files = True
    for (option, val) in opts:
        if option == '--rootdir':
            rootdir = val
    g.generateProjects()
    if helper_name == "vcproj_helper":
      delete_manifest_file = True
    else:
      delete_manifest_file = False
    g.saveProjects(save_project_files, delete_manifest_file)
    g.postGeneration()

  log.info('Done generating build files for %s' % helper.name)

if __name__=='__main__':
  import getopt
  optionSpec = ["rootdir=", "platform=", "save", "testlist=", "win32BuildDir=", "win32InstallDir=", "win32PythonDir="]

  rootdir = None
  platform = getArch()
  extraSubstitutions = dict()

  try:
    (opts, args) = getopt.gnu_getopt(sys.argv[1:], "", optionSpec)
  except Exception, e:
    print "Error parsing command line: %s" % e
    usage()

  if len(args) > 0:
    usage()

  save_project_files = True
  for (option, val) in opts:
    if option == '--rootdir':
      rootdir = val