Commit 0c03fe49 authored by Kevin Daudt's avatar Kevin Daudt

overlay: add script that reports changed APKBUILDs

parent 66187b42
# TODO: change to alpinelinux/docker-cli
image: kdaudt/docker-cli:add-auxilary-scripts
image: alpinelinux/docker-cli:latest
stages:
- build
- upload
......
FROM alpine:edge
RUN apk add --no-cache abuild atools spdx-licenses-list shellcheck \
RUN apk add --no-cache abuild atools spdx-licenses-list shellcheck git \
&& adduser -D lint
COPY overlay/ /
......
......@@ -14,3 +14,8 @@ Docker container with the necessary linting tools for verifying APKBUILD files
and 'uses' them so that shellcheck does not warn about them, while still
warning about other variables. It also disables some checks that are not
applicable for APKBUILDs.
## Auxilary scripts
* **changed-aports** - Returns a list of changed APKBUILD files in a certain
branch, give a base branch: `changed-aports <basebranch>`.
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <basebranch>"
exit 1
fi
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "Fatal: not inside a git repository"
exit 2
fi
basebranch=$1
if ! git rev-parse --verify --quiet $basebranch >/dev/null; then
# The base branch does not eixst, probably due to a shallow clone
git fetch origin refs/heads/$basebranch:refs/heads/$basebranch
fi
git --no-pager diff --diff-filter=ACMR --name-only $basebranch...HEAD -- "*/APKBUILD" | xargs -n1 dirname
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment