aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-04-07 02:23:14 -0400
committerB. Watson <yalhcru@gmail.com>2022-04-07 02:23:14 -0400
commita5cdc24d521c47ea0e4eaf36868c05aa7d62a67b (patch)
treed1a41bb818afcc555bdb135e3671a92ac6191d4f
parentc1e2772c4ef1c4ce59c9ca71f3818feb9458e9dc (diff)
downloadsbo-maintainer-tools-a5cdc24d521c47ea0e4eaf36868c05aa7d62a67b.tar.gz
update docs, add -s option
-rwxr-xr-xsbopkglint44
-rw-r--r--sbopkglint.d/05-basic-sanity.t.sh10
2 files changed, 46 insertions, 8 deletions
diff --git a/sbopkglint b/sbopkglint
index 9b3a95a..b183c28 100755
--- a/sbopkglint
+++ b/sbopkglint
@@ -9,7 +9,7 @@ sbopkglint - check Slackware binary packages for common errrors.
=head1 SYNOPSIS
-B<sbopkglint> [-k] [-i] [package.t?z ...]
+B<sbopkglint> [-k] [-i] [-s] [I<package.t?z> I<...>]
=head1 DESCRIPTION
@@ -55,6 +55,11 @@ the doc dir is something that exists in thousands of existing builds,
and it's not a major problem. New builds and updates should be linted
without this option, however.
+=item B<-s>
+
+Disable the check for /usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild.
+For use with non-SBo packages (including core Slackware packages).
+
=item B<--help>
Show the short built-in help.
@@ -104,7 +109,12 @@ new top-level directories.
=item B<->
The documentation directory must exist and be correctly named, as
-/usr/doc/$PRGNAM-$VERSION. It must contain $PRGNAM.SlackBuild, too.
+/usr/doc/$PRGNAM-$VERSION.
+
+=item B<->
+
+The documentation directory must contain $PRGNAM.SlackBuild. This
+check can be disabled with the B<-s> option.
=item B<->
@@ -121,6 +131,11 @@ Some directories (e.g. /usr/share) must *only* contain subdirectories.
=item B<->
+All files in /bin, /usr/bin, /sbin, /usr/sbin must be executable (have
+at least one +x bit set).
+
+=item B<->
+
Some directories (e.g. /usr/man, /usr/share/applications) must not
contain files with executable permissions. /usr/doc is not in this
list; neither is /etc (too many existing packages install +x files
@@ -164,7 +179,8 @@ Doc dir shouldn't contain empty files (0 bytes in length).
Doc dir shouldn't contain install instructions. Specifically, files
named INSTALL, INSTALL.*, or install.txt are flagged (it's impossible
-to make this test 100% perfect).
+to make this test 100% perfect). This check can be disabled with
+the B<-i> option.
=back
@@ -296,6 +312,24 @@ glib-compile-schemas.
=back
+=head2 icons
+
+=over 4
+
+=item B<->
+
+Files in /usr/share/pixmaps and /usr/share/icons/hicolor must be known
+image file types (PNG, SVG, JPEG, etc). Their filename extensions must
+match the image type (e.g. file.png must actually be a PNG and not
+some other MIME type).
+
+=item B<->
+
+Image files in /usr/share/icons/hicolor/<size>x<size>/* must actually be
+the correct pixel size.
+
+=back
+
=head1 BUGS
Probably many. This is still a work in progress.
@@ -330,7 +364,7 @@ usage() {
$SELF - check SBo binary packages for various problems
Usage:
- $0 [-k] [-i] [/path/to/package-file] [...]
+ $0 [-k] [-i] [-s] [/path/to/package-file] [...]
$0 --doc | --man
Options:
@@ -360,6 +394,7 @@ while true; do
--man) exec pod2man --stderr -s1 -csbo-maintainer-tools -r0.4 "$0" ;;
-k) KEEP=1 ; shift ;;
-i) INSTALL_DOCS_OK=1 ; shift;;
+ -s) SLACKBUILD_MISSING_OK=1 ; shift;;
-h*|--h*) usage; exit 0 ;;
-*) echo "$SELF: invalid option '$1', try '$SELF --help'" ; exit 1 ;;
*) break ;;
@@ -376,6 +411,7 @@ if [ "$(id -u)" != "0" ]; then
INSTALL_DOCS_OK="$INSTALL_DOCS_OK" \
KEEP="$KEEP" \
SBOPKGLINT_PATH="$SBOPKGLINT_PATH" \
+ SLACKBUILD_MISSING_OK="$SLACKBUILD_MISSING_OK" \
"$0" "$@"
fi
diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh
index c0eb9b7..562dbc5 100644
--- a/sbopkglint.d/05-basic-sanity.t.sh
+++ b/sbopkglint.d/05-basic-sanity.t.sh
@@ -45,7 +45,7 @@ nofiledirs="usr usr/doc usr/share usr/man usr/doc/HTML"
# files +x.
noexecdirs="usr/man usr/share/pixmaps usr/share/icons usr/share/applications usr/share/appdata usr/share/mime usr/share/mime-info usr/share/glib-2.0 usr/doc/HTML"
-# these files must exist.
+# these files must exist, unless -s option given.
requiredfiles="usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild"
# these files must not exist.
@@ -132,9 +132,11 @@ for i in $nofiledirs; do
[ -n "$badstuff" ] && warn "$i should only contain directories, not:" && ls -ld $badstuff
done
-for i in $requiredfiles; do
- [ -f "$i" ] || warn "missing required file: $i"
-done
+if [ -z "$SLACKBUILD_MISSING_OK" ]; then
+ for i in $requiredfiles; do
+ [ -f "$i" ] || warn "missing required file: $i"
+ done
+fi
for i in $noexecdirs; do
[ -d "$i" ] || continue