Merge branch 'mlimonci/make-dist' into 'main'

Add new `make dist` target

See merge request kernel-firmware/linux-firmware!4
This commit is contained in:
Josh Boyer 2023-09-06 11:15:24 +00:00
commit 20d250e3e9
No known key found for this signature in database
4 changed files with 27 additions and 0 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
debian/
dist/
release/

View File

@ -18,8 +18,12 @@ release:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
when: never
- if: $RELEASE_TOKEN
artifacts:
paths:
- dist/*
script:
- CI_PUSH_REPO=`echo "$CI_REPOSITORY_URL" | sed 's/^.*@/@/g'`
- git remote set-url --push origin "https://gitlab-ci-token:${RELEASE_TOKEN}$CI_PUSH_REPO"
- git tag `date "+%Y%m%d"`
- git push --tags
- make dist

View File

@ -12,6 +12,14 @@ check:
fi
@pre-commit run --all-files
dist:
@mkdir -p release dist
./copy-firmware.sh release
@TARGET=linux-firmware_`git describe`.tar.gz; \
cd release && tar -czf ../dist/$${TARGET} *; \
echo "Created dist/$${TARGET}"
@rm -rf release
install:
install -d $(DESTDIR)$(FIRMWAREDIR)
./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
@ -23,3 +31,6 @@ install-xz:
install-zst:
install -d $(DESTDIR)$(FIRMWAREDIR)
./copy-firmware.sh --zstd $(DESTDIR)$(FIRMWAREDIR)
clean:
rm -rf release dist

View File

@ -9,12 +9,16 @@ prune=no
# shellcheck disable=SC2209
compress=cat
compext=
quiet=">/dev/null"
rdfind_results=/dev/null
while test $# -gt 0; do
case $1 in
-v | --verbose)
# shellcheck disable=SC2209
verbose=echo
quiet=
rdfind_results=results.txt
shift
;;
@ -115,6 +119,12 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
fi
done
$verbose rdfind -makesymlinks true "$destdir" -outputname $rdfind_results "$quiet"
find "$destdir" -type l | while read -r l; do
target="$(realpath "$l")"
ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l"
done
exit 0
# vim: et sw=4 sts=4 ts=4