Skip to content

Apt-key add runs when /apt-key is empty #23

@cgmcintyr

Description

@cgmcintyr

When running sudo make DIST=testing REPO=Debian RPI=2 with 645f78d checked out, the following lines of the postinstall script fail:

# Make sure all apt keys are installed
cd /apt-keys > /dev/null
for i in *.asc; do
apt-key --keyring /etc/apt/trusted.gpg.d/${i%.*}.gpg add ${i}
done
cd - > /dev/null

Specifically line 67 apt-key --keyring /etc/apt/trusted.gpg.d/${i%.*}.gpg add ${i} is running despite the contents of /apt-keys being empty.

This results in the command being run as follows: apt-key --keyring /etc/apt/trusted.gpg.d/*.gpg add *.asc.

The error message in full:

Usage: apt-key [--keyring file] [command] [arguments]

Manage apt's list of trusted keys

  apt-key add <file>          - add the key contained in <file> ('-' for stdin)
  apt-key del <keyid>         - remove the key <keyid>
  apt-key export <keyid>      - output the key <keyid>
  apt-key exportall           - output all trusted keys
  apt-key update              - update keys using the keyring package
  apt-key net-update          - update keys using the network
  apt-key list                - list keys
  apt-key finger              - list fingerprints
  apt-key adv                 - pass advanced options to gpg (download key)

If no specific keyring file is given the command applies to all keyring files.
rootfs.mak:112: recipe for target '/home/cgmcintyre/devel/router/rpi-img-builder/rootfs' failed
make[1]: *** [/home/cgmcintyre/devel/router/rpi-img-builder/rootfs] Error 1
Makefile:21: recipe for target 'build-rootfs' failed
make: *** [build-rootfs] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions