@@ -278,8 +278,12 @@ def livecheck_result(formula_or_cask)
278278 )
279279
280280 if skip_info . present?
281- return "#{ skip_info [ :status ] } " \
282- "#{ " - #{ skip_info [ :messages ] . join ( "; " ) } " if skip_info [ :messages ] . present? } "
281+ skip_status = skip_info [ :status ]
282+ skip_messages = skip_info [ :messages ]
283+ skip_message = skip_messages . join ( "; " ) if skip_messages . present?
284+ return "error: #{ skip_message } " if skip_status == "error" && skip_message
285+
286+ return "skipped - #{ skip_message || skip_status } "
283287 end
284288
285289 version_info = Livecheck . latest_version (
@@ -369,10 +373,9 @@ def retrieve_versions_by_arch(formula_or_cask:, repositories:, name:)
369373 new_version_value = if ( livecheck_latest_is_a_version &&
370374 Livecheck ::LivecheckVersion . create ( formula_or_cask , livecheck_latest ) >=
371375 Livecheck ::LivecheckVersion . create ( formula_or_cask , current_version_value ) ) ||
372- current_version_value == "latest"
376+ current_version_value == "latest" ||
377+ message? ( livecheck_latest )
373378 livecheck_latest
374- elsif livecheck_latest . is_a? ( String ) && livecheck_latest . start_with? ( "skipped" )
375- "skipped"
376379 elsif repology_latest_is_a_version &&
377380 !formula_or_cask_has_livecheck &&
378381 repology_latest > current_version_value &&
@@ -433,21 +436,18 @@ def retrieve_versions_by_arch(formula_or_cask:, repositories:, name:)
433436 !newer_than_upstream . all? { |_k , v | v == true }
434437 pull_request_version = nil
435438 if ( new_version_arm = new_version . arm ) &&
436- ( new_version_arm != "unable to get versions" ) &&
437- ( new_version_arm != "skipped" ) &&
439+ !message? ( new_version_arm ) &&
438440 ( new_version_arm != current_version . arm )
439441 # We use the ARM version for the pull request version even if there
440442 # are multiple arch versions to be consistent with the behavior of
441443 # bump-cask-pr.
442444 pull_request_version = new_version_arm . to_s
443445 elsif ( new_version_intel = new_version . intel ) &&
444- ( new_version_intel != "unable to get versions" ) &&
445- ( new_version_intel != "skipped" ) &&
446+ !message? ( new_version_intel ) &&
446447 ( new_version_intel != current_version . intel )
447448 pull_request_version = new_version_intel . to_s
448449 elsif ( new_version_general = new_version . general ) &&
449- ( new_version_general != "unable to get versions" ) &&
450- ( new_version_general != "skipped" ) &&
450+ !message? ( new_version_general ) &&
451451 ( new_version_general != current_version . general )
452452 pull_request_version = new_version_general . to_s
453453 end
@@ -631,8 +631,7 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
631631 end
632632
633633 if !args . no_pull_requests? &&
634- ( new_version . general != "unable to get versions" ) &&
635- ( new_version . general != "skipped" ) &&
634+ !message? ( new_version . general ) &&
636635 !versions_equal &&
637636 !all_newer_than_upstream
638637 if duplicate_pull_requests
@@ -652,8 +651,7 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
652651 end
653652
654653 if !args . open_pr? ||
655- ( new_version . general == "unable to get versions" ) ||
656- ( new_version . general == "skipped" ) ||
654+ message? ( new_version . general ) ||
657655 all_newer_than_upstream
658656 return
659657 end
@@ -678,15 +676,13 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
678676 version_args = [ ]
679677 if multiple_versions [ :current ] && multiple_versions [ :new ]
680678 if ( new_version_arm = new_version . arm ) &&
681- new_version_arm != "unable to get versions" &&
682- new_version_arm != "skipped" &&
679+ !message? ( new_version_arm ) &&
683680 current_version . arm &&
684681 new_version_arm > current_version . arm
685682 version_args << "--version-arm=#{ new_version_arm } "
686683 end
687684 if ( new_version_intel = new_version . intel ) &&
688- new_version_intel != "unable to get versions" &&
689- new_version_intel != "skipped" &&
685+ !message? ( new_version_intel ) &&
690686 current_version . intel &&
691687 new_version_intel > current_version . intel
692688 version_args << "--version-intel=#{ new_version_intel } "
@@ -745,8 +741,7 @@ def compare_versions(current_version, new_version, formula_or_cask)
745741 end
746742
747743 new_version_value = new_version . send ( type )
748- if new_version_value . is_a? ( String ) &&
749- new_version_value . match? ( LIVECHECK_MESSAGE_REGEX )
744+ if message? ( new_version_value )
750745 # Store a string, so we can easily tell when a value is a message
751746 # rather than a version
752747 new_versions [ type ] = new_version_value . to_s
@@ -803,6 +798,13 @@ def compare_versions(current_version, new_version, formula_or_cask)
803798 { multiple_versions :, newer_than_upstream : }
804799 end
805800
801+ sig { params ( value : T . nilable ( T . any ( Version , Cask ::DSL ::Version , String ) ) ) . returns ( T ::Boolean ) }
802+ def message? ( value )
803+ return false if !value . is_a? ( Cask ::DSL ::Version ) && !value . is_a? ( String )
804+
805+ value . match? ( LIVECHECK_MESSAGE_REGEX )
806+ end
807+
806808 sig {
807809 params (
808810 formula : Formula ,
0 commit comments