diff options
author | 2020-06-07 01:15:09 +0000 | |
---|---|---|
committer | 2020-09-10 19:07:29 +0000 | |
commit | 042010b840bd920cece9ef00d06db392f142a7b3 (patch) | |
tree | 445a86445f5e50390fe85c08e4c8802ee5055872 /scripts | |
parent | package lists: Use nattka to parse keywording bugs (diff) | |
download | tatt-042010b840bd920cece9ef00d06db392f142a7b3.tar.gz tatt-042010b840bd920cece9ef00d06db392f142a7b3.tar.bz2 tatt-042010b840bd920cece9ef00d06db392f142a7b3.zip |
tool: Refactor repodir handling
* Use given repodir in config if not blank
* Ditch ~/gentoo-x86 default (it's ancient)
and error out if it doesn't exist
* If no repodir given, guess:
* /var/db/repos/gentoo, and then
* /usr/portage
Now that we use nattka, we need a working repodir.
Try some sensible defaults if the given one doesn't
work.
tatt: Support file-only jobs via Nattka
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/tatt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/tatt b/scripts/tatt index 9936006..27e9b61 100755 --- a/scripts/tatt +++ b/scripts/tatt @@ -19,6 +19,7 @@ from tatt.scriptwriter import writecommitscript as writeCommit from tatt.scriptwriter import writeCleanUpScript as writeCleanup from tatt.tattConfig import tattConfig as tattConfig from tatt.job import job as job +from tatt.tool import get_repo_dir ##### Generate a global config obj, reading from ~/.tatt ##### config = tattConfig() @@ -142,7 +143,6 @@ if options.infile: myJob.type="stable" myJob.packageList = packageFinder.findPackages(packraw, targetarch) - ## -b and a bugnumber was given ? if options.bugnum: print("Bugnumber: " + options.bugnum) @@ -166,9 +166,9 @@ if options.bugnum: sys.exit(1) if myJob.packageList==None: if response["cf_stabilisation_atoms"]: - myJob.packageList = packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], config['repodir'], options.bugnum) + myJob.packageList = packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], get_repo_dir(config['repodir']), options.bugnum) if len(myJob.packageList) == 0 and ("KEYWORDREQ" in response["keywords"] or response["component"] == "Keywording"): - myJob.packageList = packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + config['arch'], config['repodir'], options.bugnum) + myJob.packageList = packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + config['arch'], get_repo_dir(config['repodir']), options.bugnum) else: response = session.get(config["bugzilla-url"] + "/rest/bug/{}/attachment".format(options.bugnum), params=params).json()["bugs"][str(options.bugnum)] for attachment in response: @@ -176,7 +176,7 @@ if options.bugnum: continue for flag in attachment['flags']: if flag["name"] == "stabilization-list" and flag["status"] == '+': - myJob.packageList = packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), config['arch'], config['repodir'], options.bugnum) + myJob.packageList = packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), config['arch'], get_repo_dir(config['repodir']), options.bugnum) # joint code for -f and -b |