mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat: Indicate dependency source
Dependencies might reside in the AUR or official repositories. Add "AUR" as superscript letters to indicate if a package/provider is present in the AUR. Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
1433553c05
commit
0a7b02956f
5 changed files with 72 additions and 7 deletions
|
@ -57,14 +57,17 @@ class PackageDependency(Base):
|
|||
params=("NULL"),
|
||||
)
|
||||
|
||||
def is_package(self) -> bool:
|
||||
def is_aur_package(self) -> bool:
|
||||
pkg = db.query(_Package).filter(_Package.Name == self.DepName).exists()
|
||||
return db.query(pkg).scalar()
|
||||
|
||||
def is_package(self) -> bool:
|
||||
official = (
|
||||
db.query(_OfficialProvider)
|
||||
.filter(_OfficialProvider.Name == self.DepName)
|
||||
.exists()
|
||||
)
|
||||
return db.query(pkg).scalar() or db.query(official).scalar()
|
||||
return self.is_aur_package() or db.query(official).scalar()
|
||||
|
||||
def provides(self) -> list[PackageRelation]:
|
||||
from aurweb.models.relation_type import PROVIDES_ID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue