| |
@@ -221,6 +221,16 @@
|
| |
return None
|
| |
else:
|
| |
return normalize_description(jsonresp['description'])
|
| |
+ elif 'pagure.io' in forge:
|
| |
+ repo = '/'.join(forge.split('/')[3:])
|
| |
+ async with aiohttp.ClientSession() as session:
|
| |
+ url = f'https://pagure.io/api/0/{repo}'
|
| |
+ async with session.get(url) as resp:
|
| |
+ jsonresp = await resp.json()
|
| |
+ if 'error' in jsonresp:
|
| |
+ return None
|
| |
+ else:
|
| |
+ return normalize_description(jsonresp['description'])
|
| |
else:
|
| |
return None
|
| |
|
| |
@@ -422,10 +432,13 @@
|
| |
goipath = re.sub(r"^http(s?)://", r"", args.goipath)
|
| |
goipath = goipath.strip('/')
|
| |
|
| |
- if (not re.search(r"^(github.com|gitlab.com|bitbucket.org)", goipath)
|
| |
- and args.forge is None):
|
| |
+ known_forge = ('github.com', 'gitlab.com', 'bitbucket.org', 'pagure.io')
|
| |
+ known_forge_re = (r'^(' +
|
| |
+ r'|'.join(re.escape(url) for url in known_forge) +
|
| |
+ r')')
|
| |
+ if not re.search(known_forge_re, goipath) and args.forge is None:
|
| |
parser.error(
|
| |
- "forge URL is required for import path other than github, gitlab and bitbucket"
|
| |
+ f"forge URL is required for import path other than {known_forge}"
|
| |
)
|
| |
|
| |
if args.forge is None:
|
| |