pkgcheck icon indicating copy to clipboard operation
pkgcheck copied to clipboard

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

Open thesamesam opened this issue 5 years ago • 1 comments

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>[email protected]</email>
		<name>Aaron W. Swenson</name>
	</maintainer>
	<maintainer type="project">
		<email>[email protected]</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 ]

thesamesam avatar Feb 07 '21 01:02 thesamesam

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

radhermit avatar Feb 09 '21 07:02 radhermit