Skip to content

Conversation

@sjlongland
Copy link

Allow end users to build source packages, sign packages with their own
GnuPG key, and perform other interactions with dpkg-buildpackage.

The new build script works well for unsigned binaries, but users might want source packages (since then re-building is simple), or might require package signing. This caters for those use cases.

Allow end users to build source packages, sign packages with their own
GnuPG key, and perform other interactions with `dpkg-buildpackage`.
@@ -1,17 +1,38 @@
# ------------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran shell check on this script and got this output:

$ shellcheck build-deb.sh

In build-deb.sh line 1:
# ------------------------------------------------------------------------------
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In build-deb.sh line 62:
debuild -i ${BUILD_OPTS} "$@"
           ^-----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
debuild -i "${BUILD_OPTS}" "$@"

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

Personally, I belive that the current line 62 is correct, it may conatin several comman line options.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think double-quoting that will do more harm than good. I see what they're getting at but in this case we want the arguments in the variable to be split apart and interpreted separately.

Comment on lines +17 to +27
case "$1" in
--build-source-pkg)
BUILD_SOURCE=1
;;
--skip-binary)
BUILD_BINARY=0
;;
--sign-key|-l)
SIGN_KEY=$2
shift
;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block (lines 17-27) would accept misspelled and random flags.

./build-deb --foo --bar -mokey 7 --skip-binary --hello --

No online help/usage.

```
RC=0 stuartl@rikishi ~/vrt/projects/metermaster/libs/libmbus $ ./build-deb.sh --foo --bar -mokey 7 --skip-binary --hello --
Usage: ./build-deb.sh [--build-source-pkg] [--skip-binary]
          [{--sign-key|-l} <GPG KEY ID>]
          [-- <dpkg-buildpackage options>]
Unrecognised argument --foo
RC=1 stuartl@rikishi ~/vrt/projects/metermaster/libs/libmbus $ ./build-deb.sh -h
Usage: ./build-deb.sh [--build-source-pkg] [--skip-binary]
          [{--sign-key|-l} <GPG KEY ID>]
          [-- <dpkg-buildpackage options>]
RC=0 stuartl@rikishi ~/vrt/projects/metermaster/libs/libmbus $ ./build-deb.sh -?
Usage: ./build-deb.sh [--build-source-pkg] [--skip-binary]
          [{--sign-key|-l} <GPG KEY ID>]
          [-- <dpkg-buildpackage options>]
RC=0 stuartl@rikishi ~/vrt/projects/metermaster/libs/libmbus $ ./build-deb.sh --help
Usage: ./build-deb.sh [--build-source-pkg] [--skip-binary]
          [{--sign-key|-l} <GPG KEY ID>]
          [-- <dpkg-buildpackage options>]
```
@sjlongland sjlongland force-pushed the feature/tweak-build-deb branch from 5679638 to 2bf18df Compare July 21, 2020 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants