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