@@ -338,6 +338,22 @@ def get_artifacts(release):
338
338
raise RuntimeError ('Could not find required artifact at %s' % rpm )
339
339
return common_artifacts
340
340
341
+ # Checks the jar files in each package
342
+ # Barfs if any of the package jar files differ
343
+ def check_artifacts_for_same_jars (artifacts ):
344
+ jars = []
345
+ for file in artifacts :
346
+ if file .endswith ('.zip' ):
347
+ jars .append (subprocess .check_output ("unzip -l %s | grep '\.jar$' | awk -F '/' '{ print $NF }' | sort" % file , shell = True ))
348
+ if file .endswith ('.tar.gz' ):
349
+ jars .append (subprocess .check_output ("tar tzvf %s | grep '\.jar$' | awk -F '/' '{ print $NF }' | sort" % file , shell = True ))
350
+ if file .endswith ('.rpm' ):
351
+ jars .append (subprocess .check_output ("rpm -pqli %s | grep '\.jar$' | awk -F '/' '{ print $NF }' | sort" % file , shell = True ))
352
+ if file .endswith ('.deb' ):
353
+ jars .append (subprocess .check_output ("dpkg -c %s | grep '\.jar$' | awk -F '/' '{ print $NF }' | sort" % file , shell = True ))
354
+ if len (set (jars )) != 1 :
355
+ raise RuntimeError ('JAR contents of packages are not the same, please check the package contents. Use [unzip -l], [tar tzvf], [dpkg -c], [rpm -pqli] to inspect' )
356
+
341
357
# Generates sha1 checsums for all files
342
358
# and returns the checksum files as well
343
359
# as the given files in a list
@@ -625,6 +641,8 @@ def ensure_checkout_is_clean(branchName):
625
641
print (' Running maven builds now run-tests [%s]' % run_tests )
626
642
build_release (run_tests = run_tests , dry_run = dry_run , cpus = cpus , bwc_version = find_bwc_version (release_version , bwc_path ))
627
643
artifacts = get_artifacts (release_version )
644
+ print ('Checking if all artifacts contain the same jars' )
645
+ check_artifacts_for_same_jars (artifacts )
628
646
artifacts_and_checksum = generate_checksums (artifacts )
629
647
smoke_test_release (release_version , artifacts , get_head_hash (), PLUGINS )
630
648
print ('' .join (['-' for _ in range (80 )]))
0 commit comments