16
16
from .distro import Distro
17
17
18
18
from vinca import config
19
- from vinca .utils import get_repodata
19
+ from vinca .utils import get_repodata , get_pkg_build_number
20
20
21
21
unsatisfied_deps = set ()
22
22
distro = None
@@ -218,6 +218,11 @@ def read_vinca_yaml(filepath):
218
218
219
219
vinca_conf ["trigger_new_versions" ] = vinca_conf .get ("trigger_new_versions" , False )
220
220
221
+ if (Path (filepath ).parent / "pkg_additional_info.yaml" ).exists ():
222
+ vinca_conf ["_pkg_additional_info" ] = yaml .load (open (Path (filepath ).parent / "pkg_additional_info.yaml" ))
223
+ else :
224
+ vinca_conf ["_pkg_additional_info" ] = {}
225
+
221
226
return vinca_conf
222
227
223
228
@@ -671,17 +676,16 @@ def get_selected_packages(distro, vinca_conf):
671
676
for i in vinca_conf ["packages_select_by_deps" ]:
672
677
i = i .replace ("-" , "_" )
673
678
selected_packages = selected_packages .union ([i ])
674
- if "skip_all_deps" not in vinca_conf or not vinca_conf ["skip_all_deps" ]:
675
- if i in skipped_packages :
676
- continue
677
- try :
678
- pkgs = distro .get_depends (i , ignore_pkgs = skipped_packages )
679
- except KeyError :
680
- # handle (rare) package names that use "-" as separator
681
- pkgs = distro .get_depends (i .replace ("_" , "-" ))
682
- selected_packages .remove (i )
683
- selected_packages .add (i .replace ("_" , "-" ))
684
- selected_packages = selected_packages .union (pkgs )
679
+ if i in skipped_packages :
680
+ continue
681
+ try :
682
+ pkgs = distro .get_depends (i , ignore_pkgs = skipped_packages )
683
+ except KeyError :
684
+ # handle (rare) package names that use "-" as separator
685
+ pkgs = distro .get_depends (i .replace ("_" , "-" ))
686
+ selected_packages .remove (i )
687
+ selected_packages .add (i .replace ("_" , "-" ))
688
+ selected_packages = selected_packages .union (pkgs )
685
689
686
690
result = sorted (list (selected_packages ))
687
691
return result
@@ -864,6 +868,7 @@ def main():
864
868
base_dir = os .path .abspath (arguments .dir )
865
869
vinca_yaml = os .path .join (base_dir , "vinca.yaml" )
866
870
vinca_conf = read_vinca_yaml (vinca_yaml )
871
+
867
872
snapshot = read_snapshot (arguments .snapshot )
868
873
869
874
from .template import generate_bld_ament_cmake
@@ -946,19 +951,19 @@ def main():
946
951
# only URLs
947
952
if "://" in fn :
948
953
selected_bn = vinca_conf .get ("build_number" , 0 )
949
- distro = vinca_conf [ "ros_distro" ]
950
- all_pkgs = repodata . get ( "packages" , {})
951
- all_pkgs . update ( repodata .get ("packages.conda " , {}) )
952
- for pkg_name , pkg in all_pkgs .items ():
953
- if pkg_name . startswith ( f"ros- { distro } " ):
954
- if pkg_name .rsplit ( "-" , 2 )[ 0 ] in additional_recipe_names :
955
- print (
956
- f"Skipping additional recipe for build number computation { pkg_name } "
957
- )
958
- continue
959
- selected_bn = max ( selected_bn , pkg [ "build_number" ])
960
-
961
- print ( f"Selected build number: { selected_bn } " )
954
+ if not vinca_conf . get ( "use_explicit_build_number" , True ):
955
+ distro = vinca_conf [ "ros_distro" ]
956
+ all_pkgs = repodata .get ("packages" , {})
957
+ all_pkgs .update ( repodata . get ( "packages.conda" , {}))
958
+ for pkg_name , pkg in all_pkgs . items ( ):
959
+ if pkg_name .startswith ( f"ros- { distro } " ) :
960
+ if pkg_name . rsplit ( "-" , 2 )[ 0 ] in additional_recipe_names :
961
+ print (
962
+ f"Skipping additional recipe for build number computation { pkg_name } "
963
+ )
964
+ continue
965
+ selected_bn = max ( selected_bn , pkg [ "build_number" ])
966
+
962
967
963
968
explicitly_selected_pkgs = [
964
969
f"ros-{ distro } -{ pkg .replace ('_' , '-' )} "
@@ -969,16 +974,9 @@ def main():
969
974
for _ , pkg in all_pkgs .items ():
970
975
is_built = False
971
976
if selected_bn is not None :
972
- if vinca_conf .get ("full_rebuild" , True ):
973
- if pkg ["build_number" ] == selected_bn :
974
- is_built = True
975
- else :
976
- # remove all packages except explicitly selected ones
977
- if (
978
- pkg ["name" ] not in explicitly_selected_pkgs
979
- or pkg ["build_number" ] == selected_bn
980
- ):
981
- is_built = True
977
+ pkg_build_number = get_pkg_build_number (selected_bn , pkg ["name" ], vinca_conf )
978
+ if pkg ["build_number" ] == pkg_build_number :
979
+ is_built = True
982
980
else :
983
981
is_built = True
984
982
0 commit comments