diff --git a/autodist-repository b/autodist-repository index 53a0b68..66e0280 100755 --- a/autodist-repository +++ b/autodist-repository @@ -426,19 +426,29 @@ function import_package() { # check release in dest repository get_pkg_buildinfo $destrepository $a $import_pkg [ "$pkg_name" ] && { -# IMPORT_ORIG_ARCHS=(${IMPORT_ORIG_ARCHS[*]} $a) + dest_ver=$pkg_version + dest_rel=$pkg_release get_pkg_buildinfo $origrepository $a $import_pkg [ "$pkg_name" ] || { - [ "$a" == "$basearch" ] && { - echo "Error: package $import_pkg does not exist in $origrepository($a); skipping." - return - } - if [ "$force" = "1" ]; then - echo "Warning: package $import_pkg is missing in $origrepository($a) but present in $destrepository($a)." - echo "Import forced. You will need to port package to the missing arch." - else - echo "Error: package $import_pkg is missing in $origrepository($a). This would break package in $destrepository($a) repository." - return 255 + for b in ${AUTODIST_ARCHS[*]}; do + if [ "$b" != "$a" ]; then + # Get upstream version in other architecture, then if same version -> merge + get_pkg_buildinfo $origrepository $b $import_pkg + fi + [ "$pkg_name" ] && break + done + if [ "$dest_ver-$dest_rel" != "$pkg_version-$pkg_release" ]; then + [ "$a" == "$basearch" -a "$force" != "1" ] && { + echo "Error: package $import_pkg for $a does not exist in $origrepository and can't merge due to different versions; skipping." + return 255 + } + if [ "$force" = "1" ]; then + echo "Warning: package $import_pkg for $a is missing in $origrepository but present in $destrepository." + echo "Import forced. You will need to port package to the missing arch." + else + echo "Error: package $import_pkg for $a is missing in $origrepository. This would break package in $destrepository($a) repository." + return 255 + fi fi } }