• Oliver Smith's avatar
    newapkbuild: check arguments and improve usage() · a68354eb
    Oliver Smith authored
    Changes:
    * argument sanity checks:
      * `PKGNAME[-PKGVER] | SRCURL`
        * check if missing
        * check if specified more than once (see below)
      * specifying more than one buildtype flag
      * `-n` (set pkgname) without using SRCURL as last argument
      * `-s` (sourceforge source) without using PKGNAME as last argument
    * Typo fix: exist -> exists
    * `usage()`:
      * always print PKGNAME and PKGDESC (instead of NAME and DESC,
        NAME was used in one place and PKGNAME in another)
      * link to <https://spdx.org/licenses/>
      * `-m` (meson) flag was missing in short usage line at the top
      * indicate that the buildtypes are exclusive
      * `-c` flag: remove "to new directory" wording to make the
        message shorter (this should be obvious)
      * remove empty line at the end
    
    NOTE: Before this commit, the `PKGNAME[-PKGVER] | SRCURL` was allowed
    to be specified more than once, and the code looped over the arguments.
    But this was not documented in `usage()` and had unexpected results:
    
    ```
    $ newapkbuild first second third
    $ tree
    .
    ___ first
        ___ APKBUILD
        ___ first
        ___ ___ APKBUILD
        ___ ___ first
        ___ ___ ___ APKBUILD
        ___ ___ ___ src
        ___ ___ src
        ___ src
    ```
    a68354eb
Name
Last commit
Last update
.devbuildrc Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
abuild-fetch.c Loading commit data...
abuild-gzsplit.c Loading commit data...
abuild-keygen.in Loading commit data...
abuild-rmtemp.c Loading commit data...
abuild-sign.in Loading commit data...
abuild-sudo.c Loading commit data...
abuild-tar.c Loading commit data...
abuild.conf Loading commit data...
abuild.in Loading commit data...
abump.in Loading commit data...
apkbuild-cpan.in Loading commit data...
apkbuild-gem-resolver.in Loading commit data...
apkbuild-pypi.in Loading commit data...
apkgrel.in Loading commit data...
bootchartd Loading commit data...
buildlab.in Loading commit data...
checkapk.in Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
functions.sh.in Loading commit data...
newapkbuild.in Loading commit data...
sample.APKBUILD Loading commit data...
sample.confd Loading commit data...
sample.initd Loading commit data...
sample.post-install Loading commit data...
sample.pre-install Loading commit data...