summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/fedpkg.py6
-rw-r--r--src/pyfedpkg/__init__.py6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index ba36f26..edc7bb2 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -394,7 +394,7 @@ def clog(args):
sys.exit(1)
def clone(args):
- if not args.user:
+ if not args.user and not args.anonymous:
# Doing a try doesn't really work since the fedora_cert library just
# exits on error, but if that gets fixed this will work better.
try:
@@ -738,6 +738,10 @@ packages will be built sequentially.
# provide a convenient way to get to a specific branch
parser_clone.add_argument('--branch', '-b',
help = 'Check out a specific branch')
+ # allow to clone without needing a account on the fedora buildsystem
+ parser_clone.add_argument('--anonymous', '-a',
+ action = 'store_true',
+ help = 'Check out a branch anonymously')
# store the module to be cloned
parser_clone.add_argument('module', nargs = 1,
help = 'Name of the module to clone')
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 2fd1e6f..61991e2 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -270,7 +270,11 @@ def clone(module, user, path=os.getcwd(), branch=None, bare_dir=None):
"""
# construct the git url
- giturl = GITBASEURL % {'user': user, 'module': module}
+ if user:
+ giturl = GITBASEURL % {'user': user, 'module': module}
+ else:
+ giturl = ANONGITURL % {'module': module}
+
# Create the command
cmd = ['git', 'clone']
# do the clone