diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-01-11 00:35:59 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-01-11 00:35:59 +0000 |
commit | ad7fb7807ceaee96521d779993a5e1b28650723f (patch) | |
tree | 2ece42aa7e83b7fdb51702b298aa3eec95da3573 /RepSys/commands/markrelease.py | |
parent | 715e125cc8d0b3fc4a79752e28a8b76a4ce97d5a (diff) | |
download | mgarepo-ad7fb7807ceaee96521d779993a5e1b28650723f.tar mgarepo-ad7fb7807ceaee96521d779993a5e1b28650723f.tar.gz mgarepo-ad7fb7807ceaee96521d779993a5e1b28650723f.tar.bz2 mgarepo-ad7fb7807ceaee96521d779993a5e1b28650723f.tar.xz mgarepo-ad7fb7807ceaee96521d779993a5e1b28650723f.zip |
rename repsys to mgarepo, RepSys to MgaRepo, and update docs and examples for Mageia
Diffstat (limited to 'RepSys/commands/markrelease.py')
-rw-r--r-- | RepSys/commands/markrelease.py | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/RepSys/commands/markrelease.py b/RepSys/commands/markrelease.py deleted file mode 100644 index 057cf1d..0000000 --- a/RepSys/commands/markrelease.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/python -# -# This program will append a release to the Conectiva Linux package -# repository system. It's meant to be a startup system to include -# pre-packaged SRPMS in the repository, thus, you should not commit -# packages over an ongoing package structure (with changes in current/ -# directory and etc). Also, notice that packages must be included in -# cronological order. -# -from RepSys import Error -from RepSys.command import * -from RepSys.layout import package_url -from RepSys.simplerpm import SRPM -from RepSys.rpmutil import mark_release -from RepSys.util import get_auth -import getopt -import sys -import os - -HELP = """\ -*** WARNING --- You probably SHOULD NOT use this program! --- WARNING *** - -Usage: repsys markrelease [OPTIONS] REPPKGURL - -This subcommand creates a 'tag' for a given revision of a given package. - -The tag will be stored in the directory releases/ inside the package -structure. - -Options: - -f FILE Try to extract information from given file - -r REV Revision which will be used to make the release copy tag - -v VER Version which will be used to make the release copy tag - -n Append package name to provided URL - -h Show this message - -Examples: - repsys markrelease -r 68 -v 1.0-1 file://svn/cnc/snapshot/foo - repsys markrelease -f @68:foo-1.0-1.src.rpm file://svn/cnc/snapshot/foo - repsys markrelease -r 68 -f foo-1.0.src.rpm file://svn/cnc/snapshot/foo -""" - -def version_callback(option, opt, val, parser): - opts = parser.values - try: - opts.version, opts.release = val.split("-", 1) - except ValueError: - raise Error, "wrong version, use something like 1:2.2-1mdk" - -def parse_options(): - parser = OptionParser(help=HELP) - parser.defaults["version"] = None - parser.defaults["release"] = None - parser.add_option("-v", action="callback", callback=version_callback, - nargs=1, type="string", dest="__ignore") - parser.add_option("-r", dest="revision") - parser.add_option("-f", dest="filename") - parser.add_option("-n", dest="appendname", action="store_true") - opts, args = parser.parse_args() - - if len(args) != 1: - raise Error, "invalid arguments" - - opts.pkgdirurl = package_url(args[0], mirrored=False) - - filename = opts.filename - appendname = opts.appendname - del opts.filename, opts.appendname, opts.__ignore - - if filename: - if not os.path.isfile(filename): - raise Error, "file not found: "+filename - if not opts.revision: - basename = os.path.basename(filename) - end = basename.find(":") - if basename[0] != "@" or end == -1: - raise Error, "couldn't guess revision from filename" - opts.revision = basename[1:end] - srpm = None - if not opts.version: - srpm = SRPM(filename) - if srpm.epoch: - opts.version = "%s:%s" % (srpm.epoch, srpm.version) - else: - opts.version = srpm.version - opts.release = srpm.release - if appendname: - if not srpm: - srpm = SRPM(filename) - opts.pkgdirurl = "/".join([opts.pkgdirurl, srpm.name]) - elif appendname: - raise Error, "option -n requires option -f" - elif not opts.revision: - raise Error, "no revision provided" - elif not opts.version: - raise Error, "no version provided" - #get_auth() - return opts - -def main(): - do_command(parse_options, mark_release) - -# vim:et:ts=4:sw=4 |