SBOLINT(1)

NAME
sbolint - check SlackBuild directories or tarballs for common errors.

SYNOPSIS
sbolint [--help | --man | --version ] | [-a] [-q] [-u] [-e] [-n] [-r] [-c] [-m] [build [build ...]]

DESCRIPTION
sbolint checks for common errors in SlackBuilds.org scripts. It's intended for SlackBuild authors and maintainers, and can cut down on "There was a problem with your upload" errors from the submission form.

The [build] arguments must be either directories or tarballs, each containing a SlackBuild script, slack-desc, README, and .info file. With no [build] arguments, the current directory is checked. To read a list of builds from standard input, use -.

sbolint will flag errors for problems that would prevent the build from being accepted by the upload form (or by the SBo admins, if if passes the upload checks). There may also be warnings, which are things that (probably) won't stop your build from being accepted, but may cause the SBo admins extra work. There are also notes, which are things that won't generally do any harm, but might be worth investigating and cleaning up.

sbolint shares no code with the upload form's submission checker. Lack of errors/warnings from sbolint does not guarantee that your build will be accepted!

sbolint doesn't check built packages, and never executes the build script. If you want a lint tool for binary Slackware packages, use sbopkglint.

Note that sbolint is intended to help you, not control you. If your build fails the tests, and you're 100% sure it's correct, please contact the maintainer (urchlay@slackware.uk) and explain the situation. Most likely, sbolint will be modified to accomodate your code, unless something really is wrong with it.

OPTIONS
Bundling options is supported, e.g. -qr is the same as -q -r.

-a, --all
    Check all builds in the git repository. This must be run from within a git tree (e.g. one made with "git clone"). This option also turns on -q (quiet), and (by default) turns off color, though you can enable it again with -c. Also, if standard output is a terminal, sbolint -a will redirect stdout to a file called sbolint.log.YYYYMMDD (the current date).

-q, --quiet
    Quiet. Suppresses 'xxx checks out OK' and the total errors/warnings summary.

-u, --url-head
    URL check. Uses curl to make HTTP HEAD requests for the HOMEPAGE, DOWNLOAD, and DOWNLOAD_x86_64 links. This won't guarantee that the links are good, but some kinds of failure (e.g. site down, 404) mean they're definitely bad. Unfortunately a lot of sites have stopped responding to HEAD requests in the name of "security", so your mileage may vary.

-e, --no-warnings
    Suppress all warnings and notes. Only errors will be listed. This also affects the exit status (see below).

-r, --no-readme
    Suppress the warning about README lines being too long. Other warnings will still be emitted.

-n, --no-notes
    Suppress notes. Only errors and warnings will be listed.

-c, --color
    Always use colorful text, even if standard output is not a terminal. The default is to auto-detect.

-m, --mono, --no-color
    Don't use color, even if standard output is a terminal.

--version
    Show version number and exit.

--help, --doc
    Show this documentation in your pager.

--man
    Convert this documentation to a man page, on stdout.

CHECKS
For tar files only:

-   File size must not be bigger than the upload form's limit (currently one megabyte).

-   File must be a tar archive, possibly compressed with gzip, bzip2, or xz, extractable by the tar(1) command.

-   Filename extension must match compression type.

-   Archive must contain a directory with the same name as the archive's base name, e.g. foo.tar.gz must contain foo/. Everything else in the archive must be inside this directory.

-   Archive must contain dirname/dirname.SlackBuild.

-   Any files in the archive other than the .SlackBuild, .info, slack-desc, and README are checked for permissions (should be 0644) and excessive size.

-   The source archive(s) must not exist in the archive. Also sbolint attempts to detect extracted source trees (but isn't all that good at it).

-   "Junk" files such as editor backups and core dumps must not exist in the archive.

-   Files named 'build.log*' or 'strace.out*' must not exist in the archive. The sbrun tool creates these.

For all builds:

-   The directory may not contain empty directories, empty (0-byte) files, or hidden files/directories (named with a leading .).

-   The SlackBuild, .info, README files must have Unix \n line endings (not DOS \r\n), and the last line of each must have a \n.

-   The SlackBuild script must exist, with mode 0644 or 0755 (or 0644 only, if in a git repo), and be a #!/bin/bash script.

-   The script must contain the standard variable assignments for PRGNAM, VERSION, BUILD, and TAG. BUILD must be numeric.

-   PRGNAM in the script must match PRGNAM in the .info file. Both must match the script name (PRGNAM.SlackBuild) and the directory name.

-   VERSION must match the VERSION in the .info file.

-   TAG=${TAG:-_SBo}, TMP=${TMP:-/tmp/SBo}, PKG=$TMP/package-$PRGNAM, and OUTPUT=${OUTPUT:-/tmp} must occur in the script.

-   The VERSION and BUILD variables must respect the environment.

-   The script must contain the PRINT_PACKAGE_NAME section.

-   The script must assign ARCH and PKGTYPE before the PRINT_PACKAGE_NAME section.

-   The script must install the slack-desc in $PKG/install.

-   Template boilerplate comments should be removed, e.g. "REMOVE THIS ENTIRE BLOCK OF TEXT" or "Automatically determine the architecture we're building on".

-   Script must contain exactly one makepkg command.

-   ARCH=i386 or ARCH=i486 is either a warning or an error, depending on whether -march= is used in the script. The idea is that compiling for i386 or i486 is an error, but binary repacks that use an outdated ARCH just draw a warning (this "grandfathers in" older builds in the repo that haven't been updated).

-   README must exist, have mode 0644, its character encoding must be either ASCII or UTF-8 without BOM, and it may not contain tab characters.

-   slack-desc must exist, have mode 0644, its character encoding must be ASCII, and it may not contain tab characters.

-   slack-desc contents must match the SBo template, including the "handy-ruler", comments, and correct spacing/indentation.

-   The short description in the first line of the slack-desc must not be literally "short description of app" (copied from the template and not edited).

-   .info file must exist, have mode 0644, and match the SBo template.

-   .info file URLs must be valid URLs (for a very loose definition of "valid": they must begin with ftp://, http://, or https://).

-   Optionally, .info file URLs can be checked for existence with an HTTP HEAD request (see the -u option).

-   If there is a doinst.sh script:

    -   The SlackBuild must install doinst.sh to $PKG/install.

    -   If doinst.sh uses the config() and/or preserve_perms() functions, the function must be defined before it's used. Also, config files passed to config() or preserve_perms() must end with a .new suffix.

    -   If doinst.sh calls gtk-update-icon-cache, the existence of the cache must be checked before this command is run.

EXIT STATUS
Exit status from sbolint will normally be 0 (success) if there were no errors or warnings in any of the builds checked. With the -n option, exit status will be 0 if there are no errors.

Exit status 1 indicates there was at least one warning or error (or, with -n, at least one error).

Notes do not affect the exit status.

Any other exit status means sbolint itself failed somehow (e.g. called with nonexistent filename).

BUGS
Probably quite a few. Watch this space for details.

AUTHOR
B. Watson <urchlay@slackware.uk>, aka Urchlay on Libera IRC.

SEE ALSO
sbopkglint(1), sbodl, sbofixinfo(1), sbopkg(8), sboinstall(1)