Skip to content
Snippets Groups Projects
Forked from Arch Linux / Arch Linux Keyring
440 commits behind the upstream repository.
  • Levente Polyak's avatar
    d0ea790c
    fix(make): use proper dependency tracking for the build output · d0ea790c
    Levente Polyak authored
    Declare the whole keyring data as well as the code as input dependency
    for the build target. This way we can properly depend on the build
    target for installation without forcing rebuilding on every invocation.
    
    A rebuild will be triggered if either the keyring or the source code
    creating the build output changes.
    
    The directories are added to the source dependencies on purpose to
    guarantee that changes like deleted files will result in a rebuild.
    
    The mtime of the build directory is force updated on every run to allow
    make to track the output artifacts mtime compared against the
    dependencies.
    Verified
    d0ea790c
    History
    fix(make): use proper dependency tracking for the build output
    Levente Polyak authored
    Declare the whole keyring data as well as the code as input dependency
    for the build target. This way we can properly depend on the build
    target for installation without forcing rebuilding on every invocation.
    
    A rebuild will be triggered if either the keyring or the source code
    creating the build output changes.
    
    The directories are added to the source dependencies on purpose to
    guarantee that changes like deleted files will result in a rebuild.
    
    The mtime of the build directory is force updated on every run to allow
    make to track the output artifacts mtime compared against the
    dependencies.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Makefile 929 B
PREFIX ?= /usr/local
KEYRING_TARGET_DIR=$(DESTDIR)$(PREFIX)/share/pacman/keyrings/
KEYRING_FILES=$(wildcard build/*.gpg) $(wildcard build/*-revoked) $(wildcard build/*-trusted)
SOURCES := $(shell find keyring) $(shell find libkeyringctl -name '*.py' -or -type d) keyringctl

all: build

lint:
	black --check --diff keyringctl libkeyringctl tests
	isort --diff .
	flake8 keyringctl libkeyringctl tests
	mypy --install-types --non-interactive keyringctl libkeyringctl tests

fmt:
	black .
	isort .

check:
	./keyringctl -v check

test:
	coverage run
	coverage xml
	coverage report --fail-under=100.0

build: $(SOURCES)
	./keyringctl -v build

clean:
	rm -rf build

install: build
	install -vDm 755 $(KEYRING_FILES) -t $(KEYRING_TARGET_DIR)

uninstall:
	rm -f $(KEYRING_TARGET_DIR)/archlinux{.gpg,-trusted,-revoked}
	rmdir -p --ignore-fail-on-non-empty $(KEYRING_TARGET_DIR)

.PHONY: all lint fmt check test clean install uninstall