Beispiel #1
0
                      dest="dry",
                      action="store_true",
                      default=False,
                      help="run the command in dry mode")

    parser.add_option("",
                      "",
                      "--verbose",
                      dest="debug",
                      action="store_true",
                      default=False,
                      help="be more verbose ")

    options, args = parser.parse_args()

    fp_obj = FormatedPrint(formated=False)

    branches = Config().getBranches()
    if options.branches != "":
        bs = filter(lambda b: b != "", options.branches.split(","))
        for branch in bs:
            if branch in branches:
                continue

            print "%s branch not in a list of all branches" % branch
            exit(1)

        branches = bs

    if options.ebranches != "":
        ebs = filter(lambda b: b != "", options.ebranches.split(","))
Beispiel #2
0
def printBasicInfo(url, commit, name, formated=True):
	fmt_obj = FormatedPrint(formated)
	fmt_obj.printInfo("Repo URL: %s" % url)
	fmt_obj.printInfo("Commit: %s" % commit)
	fmt_obj.printInfo("Name: %s" % name)
Beispiel #3
0
	os.chdir("%s/fedora/%s" % (name, name))

def downloadTarball(archive_url):
	so, se, rc = runCommand("wget -nv %s --no-check-certificate" % archive_url)
	if rc != 0:		
		print "%sUnable to download tarball:\n%s%s" % (RED, se, ENDC)
		exit(1)

if __name__ == "__main__":

	options, args = setOptions()

	if checkOptions(options):
		exit(1)

	fmt_obj = FormatedPrint(options.format)

	if not options.format:
		ENDC = ""
		RED = ""
		GREEN = ""

	if options.detect == "":
		# collect spec file information
		project = options.project
		repo = options.repo
		if project == "":
			fmt_obj.printError("Project missing")
			exit(1)

		if repo == "":
Beispiel #4
0
        "",
        "--show-main",
        dest="showmain",
        action="store_true",
        default=False,
        help=
        "Show occurence of import paths in main packages only (+means not just main)."
    )

    options, args = parser.parse_args()

    path = "."
    if len(args):
        path = args[0]

    fmt_obj = FormatedPrint()

    if not options.scanalldirs:
        noGodeps = Config().getSkippedDirectories()
    else:
        noGodeps = []

    if options.skipdirs:
        for dir in options.skipdirs.split(','):
            dir = dir.strip()
            if dir == "":
                continue
            noGodeps.append(dir)

    gse_obj = GoSymbolsExtractor(path,
                                 imports_only=True,
Beispiel #5
0
    if len(args) > 0:
        pkg_name = args[0]

    if not options.scanalldirs:
        noGodeps = Config().getSkippedDirectories()
    else:
        noGodeps = []

    if options.skipdirs:
        for dir in options.skipdirs.split(','):
            dir = dir.strip()
            if dir == "":
                continue
            noGodeps.append(dir)

    fp = FormatedPrint()

    scan_time_start = time()
    if not options.cyclic and not options.leaves and not options.roots and not options.graphviz:
        print "Synopsis: prog [-d --from-dir|--from-xml] -c|-l|-r|-g [-v] [PACKAGE]"
        exit(1)

    if options.decompose != "":
        gb = ProjectDecompositionGraphBuilder(options.decompose,
                                              skip_errors=options.skiperrors,
                                              noGodeps=noGodeps)
        if options.fromxml != "":
            if not gb.buildFromXml(options.fromxml):
                fp.printError(gb.getError())
                exit(1)
        elif options.fromdir != "":
Beispiel #6
0
    archive = fd.getArchive()

    # if options only files detection
    if options.info:
        exit(0)

    if options.archive:
        archive = options.archive

    if options.spec:
        specfile = options.spec

    if options.sources:
        sources = options.sources

    fp_obj = FormatedPrint(formated=True)

    if archive == "":
        fp_obj.printError("archive not set")
        exit(1)

    if specfile == "":
        fp_obj.printError("specfile not set")
        exit(1)

    if not options.scanalldirs:
        noGodeps = Config().getSkippedDirectories()
    else:
        noGodeps = []

    if options.skipdirs: