import json
import logging
import os
+import pakfire
import re
import shutil
import urllib.parse
# Find all versions that are interesting for us and store them with
# how many parts are matching against the current version
- with self.backend.pakfire() as p:
- for version in available_versions:
- # Only consider later versions
- if p.version_compare(current_version, version) >= 0:
- continue
+ for version in available_versions:
+ # Only consider later versions
+ if pakfire.version_compare(current_version, version) >= 0:
+ continue
- # Split the version into parts
- parts = self._split_version(version)
+ # Split the version into parts
+ parts = self._split_version(version)
- # Count the number of parts that match at the beginning
- for i, (a, b) in enumerate(zip(current_version_parts, parts)):
- if not a == b:
- break
+ # Count the number of parts that match at the beginning
+ for i, (a, b) in enumerate(zip(current_version_parts, parts)):
+ if not a == b:
+ break
- # Store the number of matching parts
- versions[version] = i + 1
+ # Store the number of matching parts
+ versions[version] = i + 1
# Fetch all versions with the highest number of matches
versions = [v for v in versions if versions[v] == max(versions.values())]
if not self.latest_build:
return False
- # Check if the version is larger than the build
- with self.backend.pakfire() as p:
- # Compare the versions
- if p.version_compare(self.latest_build.pkg.evr, version) > 0:
- return True
+ # Compare the versions
+ if pakfire.version_compare(self.latest_build.pkg.evr, version) > 0:
+ return True
return False