use pyalpm to compare package verions
This commit is contained in:
parent
655e110a7a
commit
0951af9dc7
1 changed files with 2 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import pyalpm
|
||||
|
||||
from arch import ArchDatabase, ArchPackage
|
||||
from aur import AURPackage
|
||||
|
@ -64,8 +64,7 @@ class AURChecker:
|
|||
|
||||
def compare(package, aur_package):
|
||||
"""Compare package two versions and return status."""
|
||||
result = subprocess.check_output(["vercmp", package.get_version(), aur_package.get_version()])
|
||||
result = int(result)
|
||||
result = pyalpm.vercmp(package.get_version(), aur_package.get_version())
|
||||
if result < 0:
|
||||
return AURChecker.STATUS_NEEDS_UPDATE
|
||||
elif result > 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue