This repository contains a collection of various qa scripts for gentoo ebuild repositories. Results of the these scripts can be seen on https://gentooqa.levelnine.at/
Repostats generates statistics about repos. Following statistics are generated:
- ebuild_eapi_statistics:
EAPIusage in repo - ebuild_live_statistics: lists all live (
9999) ebuilds - ebuild_eclass_statistics: eclass usage among ebuilds
- ebuild_licenses_statistics:
LICENSEusage among ebuilds - ebuild_keywords_statistics: keyword usage among ebuilds
- ebuild_virtual_use_statistics:
virtual/*usage among ebuilds - ebuild_obsolete_eapi: lists all ebuilds which have an obsolete
EAPI - ebuild_cleanup_candidates: lists ebuilds which are candidates to cleanup
- ebuild_stable_candidates: lists ebuilds which are candidates for stabilization
- ebuild_glep81_group_statistics:
app-group/*usage among ebuilds - ebuild_glep81_user_statistics:
app-user/*usage among ebuilds
repochecks scan ebuilds, categories or a whole repository for various errors and mistakes. Nowadays many checks are already done by the the amazing tool dev-util/pkgcheck, which is why i've included the checks from pkgcheck into repochecks.
Since pkgcheck already has mostly the same checks as repochecks, checks which are basically the same are going to be removed in further updates.
Following a list of all the checks done with repochecks and (if available) the correspondig check in pkgcheck.
- ebuild_install_worthless_file_install: checks for ebuilds which install
INSTALLfiles - ebuild_trailing_whitespaces: checks for trailing whitespaces in ebuilds
- pkgcheck: WhitespaceFound
- ebuild_obsolete_dependency_tracking: checks if ebuilds have
--disable-dependency-trackingenabled. Not needed sinceEAPI4 - ebuild_obsolete_silent_rules: checks if ebuilds have
--disable-silent-rulesenabled. Not needed sinceEAPI5 - ebuild_obsolete_disable_static: checks if ebuilds have
--disable-staticenabled. Not needed sinceEAPI8 - ebuild_variable_missing_braces: Simple check to find variables in ebuilds which not use curly braces.
- ebuild_epatch_in_eapi6: checks for
epatchusage inEAPI 6ebuilds- going to be removed with the last EAPI6 ebuild
- ebuild_dohtml_in_eapi6: checks for
dohtmlusage inEAPI 6ebuids- going to be removed with the last EAPI6 ebuild
- ebuild_description_over_80: checks if
DESCRIPTIONis longer then 80 chars- pkgcheck: DescriptionCheck
- ebuild_variables_in_homepages: checks if
HOMEPAGEcontains variables- pkgcheck: ReferenceInMetadataVar
- ebuild_insecure_git_uri_usage: checks for
git://usage - ebuild_deprecated_eclasses: lists ebuilds which uses deprecated eclasses
- pkgcheck: DeprecatedEclass
- ebuild_leading_trailing_whitespaces_in_variables: checks for leading / trailing whitespaces in certain variables
- ebuild_multiple_deps_per_line: lists ebuilds which have multiple dependencies in on line
- ebuild_nonexist_dependency: checks for dependencies which doesn't exists
- ebuild_obsolete_virtual: lists virtuals which has effective only on consumer left
- ebuild_missing_eclasses: lists ebuilds which are missing eclasses
- pkgcheck: InheritsCheck
- ebuild_unused_eclasses: lists ebuilds who
inheriteclasses which are not needed- pkgcheck: InheritsCheck
- ebuild_missing_eclasses_fatal: lists ebuilds which are missing eclasses and are not inherited indirectly
- pkgcheck: InheritsCheck
- ebuild_homepage_upstream_shutdown: lists ebuilds who have a
HOMEPAGEto a know shutdown service - ebuild_homepage_unsync: lists packages who have different
HOMEPAGEamong ebuilds - ebuild_missing_zip_dependency: lists ebuilds which misses
app-arch/unzipdependency- pkgcheck: MissingUnpackerDep
- ebuild_src_uri_offline: lists ebuilds who's upstream
SRC_URIis unavailable and are the ebuild has mirror restricted enabled - ebuild_src_uri_bad: This check uses wget's spider functionality to check if a ebuild's
SRC_URIlink still works - ebuild_unused_patches: Extensive check to find unused pachtes. Uses a
whitelistfor false-positives - ebuild_unused_patches_simple: simple check for unused patches
- ebuild_insecure_pkg_post_config: lists ebuilds who use ch{mod,own} -R in
pkg_configorpkg_postinst - ebuild_insecure_init_scripts: lists ebuilds who use ch{mod,own} -R in init scripts
- ebuild_homepage_redirections: lists ebuilds with a Homepage which actually redirects to another sites
- pkgcheck: RedirectedUrl
- packages_pkgcheck_scan: runs
pkgcheck scan --net --keywords=-info -qon packages- pkgcheck: simply use
pkgcheck
- pkgcheck: simply use
- metadata_mixed_indentation: Checks metadata files (
metadata.xml) if it uses mixed tabs and whitespaces- pkgcheck: PkgMetadataXmlIndentation
- metadata_missing_proxy_maintainer: Checks the
metadata.xmlof proxy maintained packages if it includes actually a non gentoo email address (address of proxy maintainer)- pkgcheck: MaintainerWithoutProxy
- metadata_duplicate_useflag_description: Lists packages which define use flags locally in
metadata.xmlwhich already exists as a global use flag. - metadata_missing_remote_id: Lists packages which has a certain homepage (github, sourceforge) but doesn't set remote-id in
metadata.xml- pkgcheck: MissingRemoteId
Following Structures can't be found (yet) and will give a false positive:
- Usage of special vars which are not included in the script:
epatch foo-bar-${MY_VERS}.patch - Usage of patching via eclasses: In this case not the ebuild uses the file, but the eclass. For example:
apache-moduledo that. However we exclude most of the beforehand. - Usage for loops like:
for i in name1 name2 name3; do
epatch foo-bar-$i.patch
done
- False negative can also occur if the filename is the same as the package name.
- Directories under the
filesdirectory will be ignored (for now)
For a detailed explanation of each check please refer to the descriptions in repochecks
This script is used in order to run multiple repositories. It support to run scripts in diff mode (git diffs) in order to only run on packages which were changes since last run.
This python script doesn't take any arguments and just prints every gentoo project and it members.
Simply prints the inheration tree of a particular eclass.
Removes obsolete entries from whitelist files (for unused patches)
Prints functions which can be used by ebuilds.
Following usage will work for repochecks and repostats:
- Scan the full portage tree:
./scriptname.sh full - Scan a whole category:
./scriptname.sh app-admin - Scan a single package:
./scriptname.sh app-admin/diradm
There are also a few Variables which can be set, but don't have too. Most importantly are:
REPOTREE: Set's the repository path, default is:/usr/portageFILERESULTS: If this is set totruethe script will save it's output in files. Default isfalseRESULTSDIR: This is the directory were the files will be copied ifSCRIPT_MODEis enabled. Default is set to${HOME}/${scriptname}
Most script also have some debugging possibilities. Following variables can be configured:
DEBUG: if this is set totrue, debugging is enabledDEBUGLEVEL: if unset, the default is set to1. Changes in Levels:1only print basic information, in this case script runs in parallel2includes important messages, script runs not in parallel anymore3includes non important messages<=4includes messages from_funcs.shas well.
DEBUGFILE: redirects the debug output into a file.
All scripts are free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.