from listing import PackageListing
from make import Makefile
-from packager import Packager
+from packager import BinaryPackager
from pakfire.i18n import _
class Package(object):
- type = None # either "bin", "src" or "virt"
-
def __init__(self, pakfire, repo=None):
self.pakfire = pakfire
self._repo = repo
def arch(self):
raise NotImplementedError
+ @property
+ def type(self):
+ return self.metadata.get("TYPE", "unknown")
+
@property
def maintainer(self):
return self.metadata.get("PKG_MAINTAINER")
from file import FilePackage
class BinaryPackage(FilePackage):
- type = "bin"
-
@property
def arch(self):
return self.metadata.get("PKG_ARCH")
from file import FilePackage
class SourcePackage(FilePackage):
- type = "src"
-
@property
def arch(self):
- return self.type
+ return "src"
def extract(self, path):
pass
class VirtualPackage(Package):
- type = "virt"
-
def __init__(self, pakfire, data):
self.pakfire = pakfire
self._data = {}
package = packages.BinaryPackage(self.pakfire, self.repo, file)
+ if package.type == "source":
+ # Silently skip source packages.
+ continue
+
if not package.arch in (self.arch, "noarch"):
logging.warning("Skipped package with wrong architecture: %s (%s)" \
% (package.filename, package.arch))
+ print package.type
continue
self._packages.append(package)