File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed
Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -353,31 +353,32 @@ check_bool() {
353353prepare_env () {
354354 # Check packages
355355 if [[ " ${nodepend} " = false ]]; then
356- local _check_failed=false _pkg _result
356+ local _check_failed=false _pkg _result=0 _version
357357 msg_info " Checking dependencies ..."
358358 for _pkg in ${dependence[@]} ; do
359359 msg_debug -n " Checking ${_pkg} ..."
360- _result=( $( " ${tools_dir} /package.py" -s " ${_pkg} " ) )
361- case " ${_result[0] } " in
362- " latest " )
363- [[ " ${debug} " = true ]] && echo -ne " ${_result[1] } \n"
360+ _version= " $( " ${tools_dir} /package.py" -s " ${_pkg} " ) " || _result= " ${?} "
361+ case " ${_result} " in
362+ " 0 " )
363+ [[ " ${debug} " = true ]] && echo -ne " ${_version } \n"
364364 ;;
365- " noversion " )
365+ " 1 " )
366366 echo ; msg_warn " Failed to get the latest version of ${_pkg} ."
367367 ;;
368- " nomatch " )
368+ " 2 " )
369369 [[ " ${debug} " = true ]] && echo -ne " ${_result[1]} \n"
370370 msg_warn " The version of ${_pkg} installed in local does not match one of the latest.\nLocal: ${_result[1]} Latest: ${_result[2]} "
371371 ;;
372- " failed " )
372+ " 3 " )
373373 [[ " ${debug} " = true ]] && echo
374374 msg_error " ${_pkg} is not installed." ; _check_failed=true
375375 ;;
376- " error " )
376+ " 4 " )
377377 [[ " ${debug} " = true ]] && echo
378378 msg_error " pyalpm is not installed." ; exit 1
379379 ;;
380380 esac
381+ _result=0
381382 done
382383 if [[ " ${_check_failed} " = true ]]; then exit 1; fi
383384 fi
Original file line number Diff line number Diff line change @@ -66,10 +66,14 @@ def compare(package):
6666 msg_warn (f"Failed to get the latest version of { package } ." )
6767 return 1
6868
69+ # スクリプトモード時にパッケージバージョンを表示
70+ if args .script :
71+ print (pkg_from_local .version )
72+
6973 if pkg_from_local .version == pkg_from_sync .version :
7074 # latest
7175 if not args .script :
72- msg_info (f"The latest version of { package } is installed." )
76+ msg_info (f"The latest version of { package } { pkg_from_local . version } is installed." )
7377 return 0
7478 else :
7579 # nomatch
You can’t perform that action at this time.
0 commit comments