pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
35 stars 29 forks source link

Detect obsolete restrict in metadata.xml (a la OutdatedBlocker) #278

Open thesamesam opened 3 years ago

thesamesam commented 3 years ago

Could we detect when a restrict attribute in is redundant because it applies to all or no versions in tree?

~/git/gentoo/app-eselect/eselect-postgresql $ ls -1 | grep ebuild
eselect-postgresql-2.4.ebuild
~/git/gentoo/app-eselect/eselect-postgresql $ cat metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
    <maintainer restrict="&gt;=app-eselect/eselect-postgresql-1.0.0" type="person">
        <email>titanofold@gentoo.org</email>
        <name>Aaron W. Swenson</name>
    </maintainer>
    <maintainer type="project">
        <email>pgsql-bugs@gentoo.org</email>
        <name>PostgreSQL and Related Package Development</name>
    </maintainer>
    <stabilize-allarches/>
</pkgmetadata>
~/git/gentoo/app-eselect/eselect-postgresql $ pkgcheck scan
updating /home/sam/git/gentoo git repo cache: cf33617066545 -> a3ec5e03fc442
app-eselect/eselect-postgresql
  UnstableOnly: for arch: [ hppa ], all versions are unstable: [ 2.4 ]
  OutdatedBlocker: version 2.4: outdated blocker PDEPEND="!<dev-db/postgresql-9.2.20-r1": last match removed 2.88 years ago
  OutdatedBlocker: version 2.4: outdated blocker PDEPEND="!<dev-db/postgresql-9.3.16-r1:9.3": last match removed 2.74 years ago
  PotentialStable: version 2.4: slot(0), stabled arches: [ amd64, arm, arm64, ppc, ppc64, s390, sparc, x86 ], potential: [ ~hppa ]
radhermit commented 3 years ago

I don't think pkgcore has restrict parsing support for maintainers yet so that would need to be added first.