mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-14 02:16:18 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3de03e8b1f | ||
![]() |
720b7c9b05 | ||
![]() |
0ea7e9e0e5 | ||
![]() |
be5f54c95c | ||
![]() |
5c6e13a672 | ||
![]() |
a07df0beea | ||
![]() |
c7d627165f | ||
![]() |
e47035e74d | ||
![]() |
9b11b16a7e | ||
![]() |
3283b2ca59 | ||
![]() |
71cb9e97bb |
19
Makefile
19
Makefile
@@ -1,6 +1,6 @@
|
||||
SHELL=/bin/bash
|
||||
|
||||
V=1.0.1
|
||||
V=1.0.3
|
||||
BUILDTOOLVER ?= $(V)
|
||||
|
||||
PREFIX = /usr/local
|
||||
@@ -145,19 +145,20 @@ uninstall:
|
||||
$(DESTDIR)$(DATADIR)/pacman.conf.d \
|
||||
$(DESTDIR)$(DATADIR)
|
||||
|
||||
TODAY=$(shell date +"%Y%m%d")
|
||||
tag:
|
||||
@sed -E "s|^V=[0-9]{8}|V=$(TODAY)|" -i Makefile
|
||||
@git commit --gpg-sign --message "Version $(TODAY)" Makefile
|
||||
@git tag --sign --message "Version $(TODAY)" $(TODAY)
|
||||
@echo "current version: v$(V)"
|
||||
@read -r -p "tag version: v" VERSION && \
|
||||
sed -E "s|^V=.+|V=$$VERSION|" -i Makefile && \
|
||||
git commit --gpg-sign --message "chore(release): version v$$VERSION" Makefile && \
|
||||
git tag --sign --message "Version v$$VERSION" v$$VERSION
|
||||
|
||||
release: dist
|
||||
glab release create v$(RELEASE) devtools-$(RELEASE).tar.gz*
|
||||
|
||||
dist:
|
||||
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip > devtools-$(V).tar.gz
|
||||
git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz
|
||||
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
||||
|
||||
upload:
|
||||
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
|
||||
|
||||
check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto
|
||||
shellcheck $^
|
||||
|
||||
|
@@ -42,6 +42,7 @@ will automatically build the project and proxy all calls to the local build dire
|
||||
- binutils
|
||||
- coreutils
|
||||
- diffutils
|
||||
- fakeroot
|
||||
- findutils
|
||||
- grep
|
||||
- jq
|
||||
|
@@ -32,6 +32,9 @@ usage() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# save all args for check_root
|
||||
orig_args=("$@")
|
||||
|
||||
while getopts 'hC:M:c:f:s' arg; do
|
||||
case "$arg" in
|
||||
C) pac_conf="$OPTARG" ;;
|
||||
@@ -46,7 +49,7 @@ done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
(( $# < 1 )) && die 'You must specify a directory.'
|
||||
check_root "" "${BASH_SOURCE[0]}" "$@"
|
||||
check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
|
||||
|
||||
working_dir=$(readlink -f "$1")
|
||||
shift 1
|
||||
|
@@ -111,7 +111,7 @@ if (( ${#validpgpkeys[@]} != 0 )); then
|
||||
fi
|
||||
|
||||
# find files which should be under source control
|
||||
needsversioning=()
|
||||
needsversioning=(PKGBUILD)
|
||||
for s in "${source[@]}"; do
|
||||
[[ $s != *://* ]] && needsversioning+=("$s")
|
||||
done
|
||||
@@ -129,6 +129,10 @@ done
|
||||
# assert that they really are controlled by git
|
||||
if (( ${#needsversioning[*]} )); then
|
||||
for file in "${needsversioning[@]}"; do
|
||||
# skip none existing files
|
||||
if [[ ! -f "${file}" ]]; then
|
||||
continue
|
||||
fi
|
||||
if ! git ls-files --error-unmatch "$file"; then
|
||||
die "%s is not under version control" "$file"
|
||||
fi
|
||||
|
@@ -129,7 +129,7 @@ pkgctl_build() {
|
||||
local WORKER_SLOT=
|
||||
|
||||
# variables
|
||||
local path pkgbase pkgrepo source
|
||||
local loop_arch path pkgbase pkgrepo source
|
||||
|
||||
while (( $# )); do
|
||||
case $1 in
|
||||
@@ -298,7 +298,7 @@ pkgctl_build() {
|
||||
die 'failed to get pacman repo'
|
||||
fi
|
||||
if [[ -z "${pkgrepo}" ]]; then
|
||||
die 'unknown repo, please specify --repo for new packages'
|
||||
die 'unknown repo, specify --repo for packages not currently in any official repo'
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -318,7 +318,13 @@ pkgctl_build() {
|
||||
if in_array any "${arch[@]}"; then
|
||||
BUILD_ARCH=("${_arch[0]}")
|
||||
else
|
||||
BUILD_ARCH+=("${arch[@]}")
|
||||
for loop_arch in "${arch[@]}"; do
|
||||
if in_array "${loop_arch}" "${_arch[@]}"; then
|
||||
BUILD_ARCH+=("$loop_arch")
|
||||
else
|
||||
warning 'invalid architecture, not building for: %s' "${loop_arch}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -329,7 +335,7 @@ pkgctl_build() {
|
||||
|
||||
# increment pkgrel on rebuild
|
||||
if (( REBUILD )); then
|
||||
# try to figure out of pkgrel has been changed
|
||||
# try to figure out if pkgrel has been changed
|
||||
if ! old_pkgrel=$(git_diff_tree HEAD PKGBUILD | grep --perl-regexp --only-matching --max-count=1 '^-pkgrel=\K\w+'); then
|
||||
old_pkgrel=${pkgrel}
|
||||
fi
|
||||
|
@@ -38,7 +38,7 @@ pkgctl_repo_configure_usage() {
|
||||
-h, --help Show this help text
|
||||
|
||||
EXAMPLES
|
||||
$ ${COMMAND} configure *
|
||||
$ ${COMMAND} *
|
||||
_EOF_
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ pkgctl_repo_web_usage() {
|
||||
-h, --help Show this help text
|
||||
|
||||
EXAMPLES
|
||||
$ ${COMMAND} web linux
|
||||
$ ${COMMAND} linux
|
||||
_EOF_
|
||||
}
|
||||
|
||||
|
@@ -125,6 +125,9 @@ OPTIONS
|
||||
__EOF__
|
||||
}
|
||||
|
||||
# save all args for check_root
|
||||
orig_args=("$@")
|
||||
|
||||
while getopts 'dM:c:l:h' arg; do
|
||||
case "$arg" in
|
||||
d) diffoscope=1 ;;
|
||||
@@ -137,7 +140,7 @@ while getopts 'dM:c:l:h' arg; do
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
check_root "" "${BASH_SOURCE[0]}" "$@"
|
||||
check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
|
||||
|
||||
[[ -f PKGBUILD ]] || { error "No PKGBUILD in current directory."; exit 1; }
|
||||
|
||||
|
@@ -32,6 +32,9 @@ usage() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# save all args for check_root
|
||||
orig_args=("$@")
|
||||
|
||||
while getopts 'hUC:M:c:f:s' arg; do
|
||||
case "$arg" in
|
||||
U) umode=U ;;
|
||||
@@ -52,7 +55,7 @@ shift $((OPTIND - 1))
|
||||
|
||||
(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
|
||||
|
||||
check_root "" "${BASH_SOURCE[0]}" "$@"
|
||||
check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
|
||||
|
||||
working_dir="$(readlink -f "$1")"
|
||||
shift 1
|
||||
|
Reference in New Issue
Block a user