Ejemplo n.º 1
0
 def run(self, mani, commandLine):
     git = gitwrapper.GitWrapper(".")
     sys.stdout.write('#upseto %s\n' % git.directory())
     sys.stdout.write(git.run(commandLine))
     for dependency in self._traverse.traverse(mani):
         git = gitwrapper.GitWrapper(dependency.projectDir)
         sys.stdout.write('#upseto %s\n' % git.directory())
         sys.stdout.write(git.run(commandLine))
Ejemplo n.º 2
0
 def __init__(self, rootfs, product="rootfs"):
     self._rootfs = rootfs
     self._product = product
     if rootfs == "THIS":
         self._label = run.run([
             "solvent", "printlabel", "--thisProject",
             "--product=%s" % (self._product, )
         ]).strip()
         wrapper = gitwrapper.GitWrapper(".")
         self._hint = wrapper.originURLBasename()
     elif self._labelExists(self._rootfs):
         self._label = self._rootfs
         self._hint = self._rootfs
     elif "__" in self._rootfs:
         repository, product = self._rootfs.split("__")
         self._label = run.run([
             "solvent", "printlabel", "--repositoryBasename", repository,
             "--product", product
         ]).strip()
         self._hint = repository
     else:
         self._label = run.run([
             "solvent", "printlabel", "--repositoryBasename", rootfs,
             "--product=%s" % (self._product, )
         ]).strip()
         self._hint = rootfs
Ejemplo n.º 3
0
 def __init__(self):
     git = gitwrapper.GitWrapper(os.getcwd())
     self._basename = git.originURLBasename()
     if config.OFFICIAL_BUILD:
         self._state = 'officialcandidate'
     elif config.CLEAN:
         self._state = 'cleancandidate'
     else:
         self._state = 'dirty'
     self._labelExpression = label.label(basename=self._basename,
                                         product=".*",
                                         hash=git.hash(),
                                         state=self._state)
Ejemplo n.º 4
0
    def __init__(self, product):
        gitWrapper = gitwrapper.GitWrapper('.')
        hash = gitWrapper.hash()
        basename = gitWrapper.originURLBasename()

        if config.OFFICIAL_BUILD:
            state = 'officialcandidate'
        elif config.CLEAN:
            state = 'cleancandidate'
        else:
            state = 'dirty'

        self._label = label.label(basename, product, hash, state)
        self._makeSureExists()
Ejemplo n.º 5
0
 def __init__(self, rootfs):
     self._rootfs = rootfs
     if rootfs == "THIS":
         self._label = run.run(
             ["solvent", "printlabel", "--thisProject",
              "--product=rootfs"]).strip()
         wrapper = gitwrapper.GitWrapper(".")
         self._hint = wrapper.originURLBasename()
     elif self._labelExists(self._rootfs):
         self._label = self._rootfs
         self._hint = self._rootfs
     else:
         self._label = run.run([
             "solvent", "printlabel", "--repositoryBasename", rootfs,
             "--product=rootfs"
         ]).strip()
         self._hint = rootfs
Ejemplo n.º 6
0
 def __init__(self, product, ignoreFailureOnLocalObjectStore=False):
     self._product = product
     self._ignoreFailureOnLocalObjectStore = ignoreFailureOnLocalObjectStore
     git = gitwrapper.GitWrapper(os.getcwd())
     self._basename = git.originURLBasename()
     if config.OFFICIAL_BUILD:
         self._fromState = "officialcandidate"
         self._toState = "official"
     elif config.CLEAN:
         self._fromState = "cleancandidate"
         self._toState = "clean"
     else:
         raise AssertionError("Must be a clean or official build to use approve")
     hash = git.hash()
     self._fromLabel = label.label(
         basename=self._basename, product=product, hash=hash, state=self._fromState)
     self._toLabel = label.label(
         basename=self._basename, product=product, hash=hash, state=self._toState)
Ejemplo n.º 7
0
 def __init__(self, product, directory):
     self._product = product
     self._directory = directory
     git = gitwrapper.GitWrapper(os.getcwd())
     self._basename = git.originURLBasename()
     if config.OFFICIAL_BUILD:
         self._state = 'officialcandidate'
     elif config.CLEAN:
         self._state = 'cleancandidate'
     else:
         self._state = 'dirty'
     self._label = label.label(basename=self._basename,
                               product=self._product,
                               hash=git.hash(),
                               state=self._state)
     if config.OFFICIAL_BUILD or config.CLEAN:
         run.run([
             "python", "-m", "upseto.main", "checkRequirements",
             "--allowNoManifest", "--unsullied", "--gitClean"
         ])
Ejemplo n.º 8
0
 def _originURL(self, directory):
     return gitwrapper.GitWrapper(directory).originURL()
Ejemplo n.º 9
0
    help="if this project does not contain an upseto.manifest file "
    "consider as if it has an empty one. Allows checking gitClean "
    "and unsullied uniformly in projects")
git = subparsers.add_parser(
    "git",
    help="Run a git command recursively on all dependencies. E.g., "
    "'upseto git status -s' will show status of all dependant "
    "projects")
args = parser.parse_args(commandLine)

baseDir = ".."
if args.cmd == "addRequirement":
    mani = manifest.Manifest.fromLocalDirOrNew()
    for project in args.project:
        projectDirectory = os.path.join(baseDir, project)
        git = gitwrapper.GitWrapper(projectDirectory)
        mani.addRequirement(originURL=git.originURL(), hash=git.hash())
        logging.info(
            "Adding the origin URL '%(originURL)s' at hash '%(hash)s' as a requirement",
            dict(originURL=git.originURL(), hash=git.hash()))
    mani.clearAllDirtyParadoxResolution()
    for dirtyParadoxResolution in args.dirtyParadoxResolution:
        mani.setDirtyParadoxResolution(dirtyParadoxResolution)
    check = checkfulfilled.CheckFulfilled(baseDir)
    check.check(mani)
    mani.save()
    logging.info("Requirements successfully added")
elif args.cmd == "delRequirement":
    mani = manifest.Manifest.fromLocalDir()
    originURL = mani.delRequirementByBasename(args.project)
    mani.save()