@@ -1273,30 +1273,34 @@ func fileHelperNoManifest(versionedFlatPath string, versionedDropPath string, pa
1273
1273
return checksums
1274
1274
}
1275
1275
1276
- func getComponentVersion (componentName string , requiredPackage string , componentProject tools.Project , agentComponents map [string ]string ) string {
1276
+ func getComponentVersion (componentName string , requiredPackage string , componentProject tools.Project , externalBinaries map [string ]string ) string {
1277
1277
var componentVersion string
1278
1278
for pkgName , _ := range componentProject .Packages {
1279
1279
log .Printf (">>>>>>>>>>> XXX getComponentVersion Package: %s <<<<" , pkgName )
1280
- pkgPrefix := agentComponents [componentName ]
1281
- firstSplit := strings .Split (pkgName , pkgPrefix + "-" )
1282
- if len (firstSplit ) < 2 {
1283
- continue
1284
- }
1285
- secondHalf := firstSplit [1 ]
1286
- if len (secondHalf ) < 2 {
1287
- continue
1288
- }
1289
- if strings .Contains (secondHalf , requiredPackage ) {
1290
- log .Printf (">>>>>>>>>>> XXX Second Half: %s <<<<" , secondHalf )
1291
- if strings .Contains (secondHalf , "docker-image" ) {
1280
+ for binaryPrefix , binaryComponent := range externalBinaries {
1281
+ if componentName != binaryComponent {
1292
1282
continue
1293
1283
}
1294
- if strings .Contains (secondHalf , "oss-" ) {
1284
+ firstSplit := strings .Split (pkgName , binaryPrefix + "-" )
1285
+ if len (firstSplit ) < 2 {
1295
1286
continue
1296
1287
}
1297
- componentVersion = strings .Split (secondHalf , "-" + requiredPackage )[0 ]
1298
- log .Printf (">>>>>>>>>>> XXX Got Version: %s <<<<" , componentVersion )
1299
- break
1288
+ secondHalf := firstSplit [1 ]
1289
+ if len (secondHalf ) < 2 {
1290
+ continue
1291
+ }
1292
+ if strings .Contains (secondHalf , requiredPackage ) {
1293
+ log .Printf (">>>>>>>>>>> XXX Second Half: %s <<<<" , secondHalf )
1294
+ if strings .Contains (secondHalf , "docker-image" ) {
1295
+ continue
1296
+ }
1297
+ if strings .Contains (secondHalf , "oss-" ) {
1298
+ continue
1299
+ }
1300
+ componentVersion = strings .Split (secondHalf , "-" + requiredPackage )[0 ]
1301
+ log .Printf (">>>>>>>>>>> XXX Got Version: %s <<<<" , componentVersion )
1302
+ break
1303
+ }
1300
1304
}
1301
1305
}
1302
1306
@@ -1347,7 +1351,7 @@ func fileHelperWithManifest(requiredPackage string, versionedFlatPath string, ve
1347
1351
}
1348
1352
log .Printf (">>>>>>> XXX Pkg [%s] matches requiredPackage [%s]" , pkgName , requiredPackage )
1349
1353
1350
- componentVersion := getComponentVersion (componentName , requiredPackage , projects [componentName ], agentComponents )
1354
+ componentVersion := getComponentVersion (componentName , requiredPackage , projects [componentName ], externalBinaries )
1351
1355
log .Printf (">>>>>>> XXX [%s] [%s] version is [%s]" , componentName , requiredPackage , componentVersion )
1352
1356
1353
1357
fullPath := filepath .Join (versionedFlatPath , pkgName )
@@ -1479,10 +1483,6 @@ func flattenDependencies(requiredPackages []string, packageVersion, archivePath,
1479
1483
panic (err )
1480
1484
}
1481
1485
}
1482
-
1483
- log .Printf (">>>> XXX Sleeping...." )
1484
- time .Sleep (60 * time .Second )
1485
- log .Printf (">>>> XXX Done Sleeping...." )
1486
1486
}
1487
1487
1488
1488
// simple struct to deserialize branch information.
0 commit comments