コード例 #1
0
ファイル: numenta_rpm.py プロジェクト: bopopescu/what
    def constructPreBuiltYOMPFakeroot(self):
        """
    Construct fakeroot from prebuilt YOMP

    :returns: SHA of the products repo in the fakeroot
    :rtype: tuple
    """

        config = self.config
        logger = self.logger
        productsDirectory = self.productsDirectory
        logger.debug("Creating %s", productsDirectory)
        mkpath(productsDirectory)
        copy_tree(config.productsDir, productsDirectory)
        iteration = YOMP.getCommitCount(productsDirectory)

        with changeToWorkingDir(productsDirectory):
            actualSHA = YOMP.getCurrentSha()

        # Set extra python path
        self.setPythonPath()

        # Clean YOMP Scripts
        self.cleanScripts()

        # Purge anything not whitelisted
        self.purgeBlacklistedStuff()

        return (iteration, actualSHA)
コード例 #2
0
ファイル: numenta_rpm.py プロジェクト: darian19/what
  def constructPreBuiltYOMPFakeroot(self):
    """
    Construct fakeroot from prebuilt YOMP

    :returns: SHA of the products repo in the fakeroot
    :rtype: tuple
    """

    config = self.config
    logger = self.logger
    productsDirectory = self.productsDirectory
    logger.debug("Creating %s", productsDirectory)
    mkpath(productsDirectory)
    copy_tree(config.productsDir, productsDirectory)
    iteration = YOMP.getCommitCount(productsDirectory)

    with changeToWorkingDir(productsDirectory):
      actualSHA = YOMP.getCurrentSha()

    # Set extra python path
    self.setPythonPath()

    # Clean YOMP Scripts
    self.cleanScripts()

    # Purge anything not whitelisted
    self.purgeBlacklistedStuff()

    return (iteration, actualSHA)
コード例 #3
0
ファイル: rpm.py プロジェクト: darian19/what
def YOMPCloneIntoFakeroot(fakeroot,
                         installDirectory,
                         repoDirectory,
                         YOMPURL,
                         sha=None,
                         logger=None):
  """
  Clone a YOMP repository into a specific path in a fakeroot

  @param fakeroot: path to the directory to use as the root of the RPM's
    install tree

  @param installDirectory: Where to put the new YOMP clone

  @param repoDirectory: what to name the cloned directory

  @param YOMPURL: YOMP URL used to clone

  @param sha (optional): SHA to checkout once we've cloned the repository

  @param logger - Optional logger object, will be used to output more
  debugging information.

  @returns the SHA of the resulting YOMP clone. We may not have been invoked
  with a specific SHA (we normally build tip of master, for example), but we
  always want to include the exact SHA packaged in our RPM descriptions.
  """
  if logger:
    logger.debug("Prepping fakeroot in %s", fakeroot)
  installPath = "%s/%s" % (fakeroot, installDirectory)
  with changeToWorkingDir(installPath):
    if logger:
      logger.debug("Cloning %s into %s/%s/%s",
                   YOMPURL,
                   fakeroot,
                   installDirectory,
                   repoDirectory)
    YOMP.clone(YOMPURL, directory=repoDirectory)
    workDirectory = "%s/%s/%s" % (fakeroot, installDirectory, repoDirectory)
    with changeToWorkingDir(workDirectory):
      if sha:
        YOMP.resetHard()
        logger.debug("Checking out SHA %s in %s", sha, workDirectory)
        YOMP.checkout(sha)
      else:
        logger.debug("No SHA specified, using head of master")
      return YOMP.getCurrentSha()
コード例 #4
0
def YOMPCloneIntoFakeroot(fakeroot,
                          installDirectory,
                          repoDirectory,
                          YOMPURL,
                          sha=None,
                          logger=None):
    """
  Clone a YOMP repository into a specific path in a fakeroot

  @param fakeroot: path to the directory to use as the root of the RPM's
    install tree

  @param installDirectory: Where to put the new YOMP clone

  @param repoDirectory: what to name the cloned directory

  @param YOMPURL: YOMP URL used to clone

  @param sha (optional): SHA to checkout once we've cloned the repository

  @param logger - Optional logger object, will be used to output more
  debugging information.

  @returns the SHA of the resulting YOMP clone. We may not have been invoked
  with a specific SHA (we normally build tip of master, for example), but we
  always want to include the exact SHA packaged in our RPM descriptions.
  """
    if logger:
        logger.debug("Prepping fakeroot in %s", fakeroot)
    installPath = "%s/%s" % (fakeroot, installDirectory)
    with changeToWorkingDir(installPath):
        if logger:
            logger.debug("Cloning %s into %s/%s/%s", YOMPURL, fakeroot,
                         installDirectory, repoDirectory)
        YOMP.clone(YOMPURL, directory=repoDirectory)
        workDirectory = "%s/%s/%s" % (fakeroot, installDirectory,
                                      repoDirectory)
        with changeToWorkingDir(workDirectory):
            if sha:
                YOMP.resetHard()
                logger.debug("Checking out SHA %s in %s", sha, workDirectory)
                YOMP.checkout(sha)
            else:
                logger.debug("No SHA specified, using head of master")
            return YOMP.getCurrentSha()