Пример #1
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """

    parser = argparse.ArgumentParser(
        description="Create a .pin file for PACKAGE. "
                    "Needs to run from the root of a spec repository. "
                    "Note that when URL is an ssh url to a git repository, "
                    "planex will first look for a repository with the "
                    "same name cloned in the $CWD/repos folder.",
        parents=[common_base_parser()])
    parser.add_argument("package", metavar="PACKAGE", help="package name")

    write = parser.add_mutually_exclusive_group()
    write.add_argument("-w", "--write", action="store_true",
                       help="Write pin file in PINS/PACKAGE.pin. "
                            "It overwrites the file if present.")
    write.add_argument("-o", "--output", default=None,
                       help="Path of the pinfile to write. "
                            "It overwrites the file if present.")

    parser.add_argument("--url",
                        help="Replace the URL of the final resource")
    parser.add_argument("--commitish",
                        help="Replace the commitish of the final resource")

    return parser.parse_args(argv)
Пример #2
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(
        description="Generate Makefile dependencies from RPM Spec files",
        parents=[common_base_parser(),
                 rpm_define_parser()])
    parser.add_argument("specs", metavar="SPEC", nargs="+", help="spec file")
    parser.add_argument(
        "--no-package-name-check",
        dest="check_package_names",
        action="store_false",
        default=True,
        help="Don't check that package name matches spec file name")
    parser.add_argument(
        "--no-buildrequires",
        dest="buildrequires",
        action="store_false",
        default=True,
        help="Don't generate dependency rules for BuildRequires")
    parser.add_argument("--no-requires",
                        dest="requires",
                        action="store_false",
                        default=True,
                        help="Don't generate dependency rules for Requires")
    parser.add_argument("--json",
                        action="store_true",
                        help="Output the dependency rules as a json object")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #3
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(
        description="Generate Makefile dependencies from RPM Spec files",
        parents=[common_base_parser(), rpm_define_parser()])
    parser.add_argument("specs", metavar="SPEC", nargs="+", help="spec file")
    parser.add_argument(
        "--no-package-name-check", dest="check_package_names",
        action="store_false", default=True,
        help="Don't check that package name matches spec file name")
    parser.add_argument(
        "--no-buildrequires", dest="buildrequires",
        action="store_false", default=True,
        help="Don't generate dependency rules for BuildRequires")
    parser.add_argument(
        "--no-requires", dest="requires",
        action="store_false", default=True,
        help="Don't generate dependency rules for Requires")
    parser.add_argument(
        "--json", action="store_true",
        help="Output the dependency rules as a json object"
    )
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #4
0
def parse_args_or_exit(argv=None):
    """Parse command line options"""

    parser = argparse.ArgumentParser(
        description='Generate manifest in JSON format from spec/link files',
        parents=[common_base_parser()]
    )

    parser.add_argument(
        'specfile_path',
        metavar='SPEC',
        help='path/to/<spec_file>'
    )

    parser.add_argument(
        'lnkfile_path',
        metavar='LNK',
        nargs='?',
        default=None,
        help='path/to/<lnk_file>'
    )

    parser.add_argument(
        '--pins-dir',
        dest='pinsdir',
        default="PINS",
        help='path/to/pins'
    )

    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #5
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(
        description='Download package sources',
        parents=[common_base_parser(),
                 rpm_define_parser()])
    parser.add_argument('spec', help='RPM Spec')
    parser.add_argument('link', help='Link file', nargs="?")
    parser.add_argument("source",
                        metavar="SOURCE",
                        help="Source file to fetch")
    parser.add_argument('--retries',
                        '-r',
                        help='Number of times to retry a failed download',
                        type=int,
                        default=5)
    parser.add_argument('--no-package-name-check',
                        dest="check_package_names",
                        action="store_false",
                        default=True,
                        help="Don't check that package name matches spec "
                        "file name")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #6
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """

    parser = argparse.ArgumentParser(
        description="Create a .pin file pointing to a repository "
                    "in $CWD/repos. You must run "
                    "this tool from the root of a spec repository.",
        parents=[common_base_parser()])
    parser.add_argument("package", help="package name")
    parser.add_argument("--url", metavar="URL", default=None,
                        help="Source repository URL."
                             "It can be local e.g. repos/package.")
    parser.add_argument("--commitish", default=None,
                        help="Source repository commitish, tag or branch)."
                             "Defaults to the one inferred from the SPEC "
                             "or link file.")
    parser.add_argument("--base", metavar="URL", default=None,
                        help="Base repository URL. "
                             "It can be local e.g. repos/package. "
                             "This is used only for lnk packages.")
    parser.add_argument("--base_commitish", metavar="COMMITISH",
                        default=None,
                        help="Base repository commitish, tag or branch. "
                             "This is required when using --base. "
                             "This is used only for lnk packages.")
    parser.add_argument("--patchqueue", default="master",
                        help="Value for the patchqueue field of the pin file. "
                             "Defaults to master. ")
    parser.add_argument("-o", "--output", default=None,
                        help="Path of the pinfile to write. "
                             "When used, it overwrites the file "
                             "if present.")
    return parser.parse_args(argv)
Пример #7
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(description='Clone package sources',
                                     parents=[common_base_parser()])
    parser.add_argument("--jenkins",
                        action="store_true",
                        help="Print Jenkinsfile fragment")
    parser.add_argument("--clone",
                        action="store_true",
                        help="Only clone repositories, do not apply patches")
    parser.add_argument("--output",
                        "-o",
                        default=join(getcwd(), "clone_sources.json"),
                        help="Choose output name for clone sources JSON file")
    parser.add_argument("-r",
                        "--repos",
                        metavar="DIR",
                        default="repos",
                        help='Local path to the repositories')
    parser.add_argument("pins", metavar="PINS", nargs="*", help="pin file")
    parser.add_argument("--credentials",
                        metavar="CREDS",
                        default=None,
                        help="Credentials")
    return parser.parse_args(argv)
Пример #8
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(description='Create mock config',
                                     parents=[common_base_parser()])
    parser.add_argument("mockconfig", metavar="OUTCFG",
                        help="output file")
    parser.add_argument("--configdir", metavar="CONFIGDIR", required=True,
                        help="mock config directory")
    parser.add_argument("-r", "--root", metavar="INCFG", required=True,
                        help="reference chroot config")
    parser.add_argument("--enablerepo", action=EnableRepoAction, default=[],
                        help="Repository to include")
    parser.add_argument("--disablerepo", action=DisableRepoAction, default=[],
                        help="Repository to exclude")
    parser.add_argument("--config_opt", action=DictAction, metavar="OPT=VALUE",
                        help="Define mock configuration settings")
    parser.add_argument("--yum-config_opt", action=DictAction,
                        metavar="OPT=VALUE",
                        help="Define yum/dnf configuration settings")
    parser.add_argument("--environment", action=DictAction,
                        metavar="OPT=VALUE",
                        help="Define chroot environment variables")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #9
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(description='Download package sources',
                                     parents=[common_base_parser()])
    parser.add_argument('--rules', dest="rules",
                        action="store_true", default=False,
                        help="Print the full path to Makefile.rules")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #10
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """

    parser = argparse.ArgumentParser(
        description="Create a .pin file for PACKAGE. "
        "Needs to run from the root of a spec repository. "
        "Note that when URL is an ssh url to a git repository, "
        "planex will first look for a repository with the "
        "same name cloned in the $CWD/repos folder.",
        parents=[common_base_parser()])
    parser.add_argument("package", metavar="PACKAGE", help="package name")

    write = parser.add_mutually_exclusive_group()
    write.add_argument("-w",
                       "--write",
                       action="store_true",
                       help="Write pin file in PINS/PACKAGE.pin. "
                       "It overwrites the file if present.")
    write.add_argument("-o",
                       "--output",
                       default=None,
                       help="Path of the pinfile to write. "
                       "It overwrites the file if present.")

    parser.add_argument("--override-source",
                        dest="source",
                        default=None,
                        help="Path to a tarball or url of a git "
                        "repository in the form ssh://GitURL#commitish. "
                        "When used the pin will get rid of any "
                        "pre-existing source, archive or patchqueue "
                        "and use the provided path as Source0.")
    parser.add_argument("--override-patchqueue",
                        dest="patchqueue",
                        default=None,
                        help="Path to a tarball or url of a git "
                        "repository in the form ssh://GitURL#commitish. "
                        "When used the pin will get rid of any "
                        "pre-existing patchqueue and use the provided "
                        "path as PatchQueue0.")

    return parser.parse_args(argv)
Пример #11
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(description='Download package sources',
                                     parents=[common_base_parser(),
                                              rpm_define_parser()])
    parser.add_argument('spec_or_link', help='RPM Spec or link file')
    parser.add_argument("source", metavar="SOURCE",
                        help="Source file to fetch")
    parser.add_argument('--retries', '-r',
                        help='Number of times to retry a failed download',
                        type=int, default=5)
    parser.add_argument('--no-package-name-check', dest="check_package_names",
                        action="store_false", default=True,
                        help="Don't check that package name matches spec "
                        "file name")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)
Пример #12
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """

    parser = argparse.ArgumentParser(
        description="Create a .pin file for PACKAGE. "
        "Needs to run from the root of a spec repository. "
        "Note that when URL is an ssh url to a git repository, "
        "planex will first look for a repository with the "
        "same name cloned in the $CWD/repos folder.",
        parents=[common_base_parser()])
    parser.add_argument("package", metavar="PACKAGE", help="package name")

    write = parser.add_mutually_exclusive_group()
    write.add_argument("-w",
                       "--write",
                       action="store_true",
                       help="Write pin file in PINS/PACKAGE.pin. "
                       "It overwrites the file if present.")
    write.add_argument("-o",
                       "--output",
                       default=None,
                       help="Path of the pinfile to write. "
                       "It overwrites the file if present.")
    write.add_argument("-s",
                       "--show",
                       action="store_true",
                       dest="show",
                       help="Show the current state of the PIN for"
                       "the given package.")
    write.add_argument("-u",
                       "--unpin",
                       action="store_true",
                       dest="unpin",
                       help="Remove the PIN for the given package.")

    parser.add_argument("--url", help="Replace the URL of the final resource")
    parser.add_argument("--commitish",
                        help="Replace the commitish of the final resource")

    return parser.parse_args(argv)
Пример #13
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(
        description='Clone package sources',
        parents=[common_base_parser()])
    parser.add_argument("--jenkins", action="store_true",
                        help="Print Jenkinsfile fragment")
    parser.add_argument("--clone", action="store_true",
                        help="Only clone repositories, do not apply patches")
    parser.add_argument("--output", "-o",
                        default=join(getcwd(), "clone_sources.json"),
                        help="Choose output name for clone sources JSON file")
    parser.add_argument("-r", "--repos", metavar="DIR", default="repos",
                        help='Local path to the repositories')
    parser.add_argument("pins", metavar="PINS", nargs="*", help="pin file")
    parser.add_argument("--credentials", metavar="CREDS", default=None,
                        help="Credentials")
    return parser.parse_args(argv)
Пример #14
0
def parse_args_or_exit(argv=None):
    """
    Parse command line options
    """
    parser = argparse.ArgumentParser(description='Create mock config',
                                     parents=[common_base_parser()])
    parser.add_argument("mockconfig", metavar="OUTCFG", help="output file")
    parser.add_argument("--configdir",
                        metavar="CONFIGDIR",
                        required=True,
                        help="mock config directory")
    parser.add_argument("-r",
                        "--root",
                        metavar="INCFG",
                        required=True,
                        help="reference chroot config")
    parser.add_argument("--enablerepo",
                        action=EnableRepoAction,
                        default=[],
                        help="Repository to include")
    parser.add_argument("--disablerepo",
                        action=DisableRepoAction,
                        default=[],
                        help="Repository to exclude")
    parser.add_argument("--config_opt",
                        action=DictAction,
                        metavar="OPT=VALUE",
                        help="Define mock configuration settings")
    parser.add_argument("--yum-config_opt",
                        action=DictAction,
                        metavar="OPT=VALUE",
                        help="Define yum/dnf configuration settings")
    parser.add_argument("--environment",
                        action=DictAction,
                        metavar="OPT=VALUE",
                        help="Define chroot environment variables")
    argcomplete.autocomplete(parser)
    return parser.parse_args(argv)