@@ -425,11 +425,11 @@ def __init__(
425
425
proj_dict ["tested source" ] = _remove_quotes (proj_dict ["tested source" ])
426
426
if "repo loc" in proj_dict :
427
427
proj_dict ["repo loc" ] = self .convert_to_srs (
428
- proj_dict ["repo loc" ], self .projects
428
+ proj_dict ["repo loc" ], self .projects , fcm_exec
429
429
)
430
430
else :
431
431
proj_dict ["repo loc" ] = self .convert_to_srs (
432
- proj_dict ["tested source" ], self .projects
432
+ proj_dict ["tested source" ], self .projects , fcm_exec
433
433
)
434
434
435
435
proj_dict ["repo mirror" ] = self .convert_to_mirror (
@@ -445,7 +445,7 @@ def __init__(
445
445
)
446
446
447
447
proj_dict ["parent loc" ] = self .convert_to_srs (
448
- proj_dict ["parent mirror" ], self .projects
448
+ proj_dict ["parent mirror" ], self .projects , fcm_exec
449
449
)
450
450
# Check "repo loc" and "parent loc" have revisions,
451
451
# and if not, try to get a head of 'trunk' one for them.
@@ -1484,10 +1484,12 @@ def convert_to_mirror(url, projects_dict):
1484
1484
return mirror_url
1485
1485
1486
1486
@staticmethod
1487
- def convert_to_srs (url , projects_dict ):
1487
+ def convert_to_srs (url , projects_dict , fcm_exec ):
1488
1488
"""Take a URL as a string, and a dictionary of {project : url, ...}
1489
1489
If url is a mirror repository URL in the projects dictionary convert
1490
1490
to an SRS URL if also availble.
1491
+ If this doesn't look like an "fcm" link then try running "fcm info"
1492
+ to get the repo location.
1491
1493
Otherwise return the original URL
1492
1494
"""
1493
1495
if url is None :
@@ -1528,6 +1530,15 @@ def convert_to_srs(url, projects_dict):
1528
1530
else :
1529
1531
srs_url = re .sub (proj , shared_project , url , count = 1 )
1530
1532
break
1533
+ else :
1534
+ command = [fcm_exec , "info" , url ]
1535
+ _ , stdout , _ = _run_command (command , ignore_fail = True )
1536
+ find_url = re .compile (r"URL:\s*(.*)" )
1537
+ for line in stdout :
1538
+ result = find_url .search (line )
1539
+ if result :
1540
+ srs_url = result .group (1 ).rstrip ()
1541
+ break
1531
1542
return srs_url
1532
1543
1533
1544
@staticmethod
0 commit comments