Commits

Michael Tharp  committed 9996d08

Create phantom packages to go with the phantom components

Also have the phantom troves provide themselves, not that there's any
way for something to require them.

  • Participants
  • Parent commits bdfa803

Comments (0)

Files changed (2)

File NEWS.src/misc-phantom-packages.feature

+Phantom components are now created with a parent phantom package for easier querying.

File conary/local/rpmcapsule.py

         name, version, flavor = self._getPhantomNVF(header)
         # Fake trove
         trv = trove.Trove(name, version, flavor)
-        trv.setProvides(header.getProvides())
+        provides = header.getProvides()
+        provides.addDep(deps.TroveDependencies, deps.Dependency(name))
+        trv.setProvides(provides)
         trv.setRequires(header.getRequires())
         # Fake capsule file
         path = str(header.getNevra()) + '.rpm'
         trv.computeDigests()
         changeSet.newTrove(trv.diff(None)[0])
 
+        # Make a fake package to contain the fake component
+        pkgName = name.split(':')[0]
+        pkg = trove.Trove(pkgName, version, flavor)
+        provides = deps.DependencySet()
+        provides.addDep(deps.TroveDependencies, deps.Dependency(pkgName))
+        pkg.setProvides(provides)
+        pkg.setIsCollection(True)
+        pkg.addTrove(name, version, flavor, byDefault=True)
+        pkg.computeDigests()
+        changeSet.newTrove(pkg.diff(None)[0])
+
 
 def rpmExpandMacro(val):
     if getattr(rpm, '_rpm', ''):