Skip to content

Commit

Permalink
slfo-packagelist-uploader: add a 'branch' argument and use 1.1 branch…
Browse files Browse the repository at this point in the history
… for Leap 16.0
  • Loading branch information
nilxam committed Oct 7, 2024
1 parent 96def08 commit 50ad597
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gocd/checkers.opensuse.gocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ pipelines:
resources:
- repo-checker
tasks:
- script: ./slfo-packagelist-uploader.py --project openSUSE:Leap:16.0
- script: ./slfo-packagelist-uploader.py --project openSUSE:Leap:16.0 --branch 1.1
10 changes: 7 additions & 3 deletions slfo-packagelist-uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@


class PackagelistUploader(object):
def __init__(self, project, print_only, verbose):
def __init__(self, project, branch, print_only, verbose):
self.project = project
# Use default branch if there is no specify branch given
self.branch = branch if branch else 'main'
self.print_only = print_only
self.verbose = verbose
self.apiurl = osc.conf.config['apiurl']
Expand All @@ -41,7 +43,7 @@ def crawl(self):
if os.path.isdir(filepath):
shutil.rmtree(filepath)
gitpath = 'https://src.opensuse.org/products/SLFO_main.git'
git.Repo.clone_from(gitpath, filepath, branch='main')
git.Repo.clone_from(gitpath, filepath, branch=self.branch)
packages = []
files = os.listdir(filepath)
for f in files:
Expand All @@ -68,7 +70,7 @@ def main(args):
print("Please pass --project argument. See usage with --help.")
quit()

uc = PackagelistUploader(args.project, args.print_only, args.verbose)
uc = PackagelistUploader(args.project, args.branch, args.print_only, args.verbose)
uc.crawl()


Expand All @@ -80,6 +82,8 @@ def main(args):
help='print info useful for debuging')
parser.add_argument('-p', '--project', dest='project', metavar='PROJECT',
help='Target project on buildservice')
parser.add_argument('-b', '--branch', dest='branch', metavar='BRANCH',
help='Git tree branch name')
parser.add_argument('-o', '--print-only', action='store_true',
help='show the result instead of the uploading')
parser.add_argument('-v', '--verbose', action='store_true',
Expand Down

0 comments on commit 50ad597

Please sign in to comment.