mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-10-25 22:12:05 +02:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2edee89b62 | ||
|
|
901581936a | ||
|
|
29c6fa8537 | ||
|
|
74f65db396 | ||
|
|
64b7d99504 | ||
|
|
f32a264796 | ||
|
|
fd6e801cfb | ||
|
|
a3868cf542 | ||
|
|
62a2f118ce | ||
|
|
723ad23b48 | ||
|
|
5dd90ef848 | ||
|
|
5246cb9aa5 | ||
|
|
144f896660 | ||
|
|
bbcff883d5 | ||
|
|
6e466ca654 | ||
|
|
d8d2e23247 | ||
|
|
be44b9cde1 | ||
|
|
7b0a11677a | ||
|
|
93dbb14ab9 | ||
|
|
10c6efc440 | ||
|
|
8e4293034b | ||
|
|
b7893a2ca8 | ||
|
|
bec29e632b | ||
|
|
70f3b8ddb8 | ||
|
|
5fcd90a212 | ||
|
|
f6f4da26cb | ||
|
|
40a90e2cab | ||
|
|
74a6641946 | ||
|
|
69112171e5 | ||
|
|
c14338c0fe | ||
|
|
8dbf95cdd4 | ||
|
|
46d614d91a | ||
|
|
df0d6b867b | ||
|
|
8f5a02b23d | ||
|
|
e76d560477 | ||
|
|
27ff286ee7 | ||
|
|
2180aabc81 | ||
|
|
2f929c961f | ||
|
|
c2bbcbed64 | ||
|
|
b7ce90fefc | ||
|
|
f52002955c | ||
|
|
58374246c4 | ||
|
|
f522ce2277 | ||
|
|
7747749610 | ||
|
|
25b4ef2799 | ||
|
|
ad4b66830a | ||
|
|
321e998020 | ||
|
|
c86823a2d4 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,4 +15,5 @@ zsh_completion
|
|||||||
find-libdeps
|
find-libdeps
|
||||||
crossrepomove
|
crossrepomove
|
||||||
arch-nspawn
|
arch-nspawn
|
||||||
|
sogrep
|
||||||
doc/*.1
|
doc/*.1
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ sudo: required
|
|||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
arch:
|
archlinux:
|
||||||
packages:
|
packages:
|
||||||
- openssh
|
- openssh
|
||||||
- subversion
|
- subversion
|
||||||
|
|||||||
18
Makefile
18
Makefile
@@ -1,4 +1,4 @@
|
|||||||
V=20190329
|
V=20191016
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANDIR = $(PREFIX)/share/man
|
MANDIR = $(PREFIX)/share/man
|
||||||
@@ -16,11 +16,12 @@ IN_PROGS = \
|
|||||||
crossrepomove\
|
crossrepomove\
|
||||||
arch-nspawn \
|
arch-nspawn \
|
||||||
mkarchroot \
|
mkarchroot \
|
||||||
makechrootpkg
|
makechrootpkg \
|
||||||
|
sogrep
|
||||||
|
|
||||||
BINPROGS = \
|
BINPROGS = \
|
||||||
$(IN_PROGS) \
|
$(IN_PROGS) \
|
||||||
sogrep
|
offload-build \
|
||||||
|
|
||||||
CONFIGFILES = \
|
CONFIGFILES = \
|
||||||
makepkg-x86_64.conf \
|
makepkg-x86_64.conf \
|
||||||
@@ -68,6 +69,7 @@ BASHCOMPLETION_LINKS = \
|
|||||||
MANS = \
|
MANS = \
|
||||||
doc/lddd.1 \
|
doc/lddd.1 \
|
||||||
doc/checkpkg.1 \
|
doc/checkpkg.1 \
|
||||||
|
doc/offload-build.1 \
|
||||||
doc/sogrep.1 \
|
doc/sogrep.1 \
|
||||||
doc/mkarchroot.1 \
|
doc/mkarchroot.1 \
|
||||||
doc/find-libdeps.1 \
|
doc/find-libdeps.1 \
|
||||||
@@ -77,7 +79,7 @@ MANS = \
|
|||||||
all: $(BINPROGS) bash_completion zsh_completion man
|
all: $(BINPROGS) bash_completion zsh_completion man
|
||||||
man: $(MANS)
|
man: $(MANS)
|
||||||
|
|
||||||
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
|
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
|
||||||
|
|
||||||
%: %.in Makefile lib/common.sh
|
%: %.in Makefile lib/common.sh
|
||||||
@echo "GEN $@"
|
@echo "GEN $@"
|
||||||
@@ -126,6 +128,12 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile#doc/}; \
|
rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile#doc/}; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
|
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
|
||||||
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
||||||
@@ -136,5 +144,5 @@ upload:
|
|||||||
check: $(BINPROGS) bash_completion makepkg-x86_64.conf PKGBUILD.proto
|
check: $(BINPROGS) bash_completion makepkg-x86_64.conf PKGBUILD.proto
|
||||||
shellcheck $^
|
shellcheck $^
|
||||||
|
|
||||||
.PHONY: all clean install uninstall dist upload check
|
.PHONY: all clean install uninstall dist upload check tag
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
|
|||||||
@@ -13,6 +13,10 @@
|
|||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
m4_include(lib/archroot.sh)
|
m4_include(lib/archroot.sh)
|
||||||
|
|
||||||
|
# umask might have been changed in /etc/profile
|
||||||
|
# ensure that sane default is set again
|
||||||
|
umask 0022
|
||||||
|
|
||||||
working_dir=''
|
working_dir=''
|
||||||
|
|
||||||
files=()
|
files=()
|
||||||
@@ -35,7 +39,7 @@ while getopts 'hC:M:c:f:s' arg; do
|
|||||||
case "$arg" in
|
case "$arg" in
|
||||||
C) pac_conf="$OPTARG" ;;
|
C) pac_conf="$OPTARG" ;;
|
||||||
M) makepkg_conf="$OPTARG" ;;
|
M) makepkg_conf="$OPTARG" ;;
|
||||||
c) cache_dir="$OPTARG" ;;
|
c) cache_dirs+=("$OPTARG") ;;
|
||||||
f) files+=("$OPTARG") ;;
|
f) files+=("$OPTARG") ;;
|
||||||
s) nosetarch=1 ;;
|
s) nosetarch=1 ;;
|
||||||
h|?) usage ;;
|
h|?) usage ;;
|
||||||
@@ -52,16 +56,27 @@ shift 1
|
|||||||
|
|
||||||
[[ -z $working_dir ]] && die 'Please specify a working directory.'
|
[[ -z $working_dir ]] && die 'Please specify a working directory.'
|
||||||
|
|
||||||
if [[ -z $cache_dir ]]; then
|
pacconf_cmd=$(command -v pacman-conf || command -v pacconf)
|
||||||
cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
|
|
||||||
else
|
if (( ${#cache_dirs[@]} == 0 )); then
|
||||||
cache_dirs=("$cache_dir")
|
mapfile -t cache_dirs < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pacconf_cmd=$(command -v pacman-conf || command -v pacconf)
|
|
||||||
# shellcheck disable=2016
|
# shellcheck disable=2016
|
||||||
host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
|
host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
|
||||||
# shellcheck disable=2016
|
|
||||||
|
while read -r line; do
|
||||||
|
mapfile -t lines < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" \
|
||||||
|
--repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1$repo/os/$arch#')
|
||||||
|
if [[ ${lines[0]} != ${host_mirrors[0]} ]]; then
|
||||||
|
for line in "${lines[@]}"; do
|
||||||
|
if [[ $line = file://* ]]; then
|
||||||
|
line=${line#file://}
|
||||||
|
in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list)
|
||||||
|
|
||||||
# {{{ functions
|
# {{{ functions
|
||||||
build_mount_args() {
|
build_mount_args() {
|
||||||
@@ -70,19 +85,20 @@ build_mount_args() {
|
|||||||
for host_mirror in "${host_mirrors[@]}"; do
|
for host_mirror in "${host_mirrors[@]}"; do
|
||||||
if [[ $host_mirror == *file://* ]]; then
|
if [[ $host_mirror == *file://* ]]; then
|
||||||
host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
|
host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
|
||||||
mount_args+=("--bind-ro=$host_mirror_path")
|
mount_args+=("--bind-ro=${host_mirror_path//:/\\:}")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
mount_args+=("--bind=${cache_dirs[0]}")
|
mount_args+=("--bind=${cache_dirs[0]//:/\\:}")
|
||||||
|
|
||||||
for cache_dir in "${cache_dirs[@]:1}"; do
|
for cache_dir in "${cache_dirs[@]:1}"; do
|
||||||
mount_args+=("--bind-ro=$cache_dir")
|
mount_args+=("--bind-ro=${cache_dir//:/\\:}")
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_hostconf () {
|
copy_hostconf () {
|
||||||
cp -a /etc/pacman.d/gnupg "$working_dir/etc/pacman.d"
|
unshare --fork --pid gpg --homedir "$working_dir"/etc/pacman.d/gnupg/ --no-permission-warning --quiet --batch --import --import-options import-local-sigs "$(pacman-conf GpgDir)"/pubring.gpg >/dev/null 2>&1
|
||||||
|
pacman-key --gpgdir "$working_dir"/etc/pacman.d/gnupg/ --import-trustdb "$(pacman-conf GpgDir)" >/dev/null 2>&1
|
||||||
printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
|
printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
|
||||||
|
|
||||||
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
|
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
|
||||||
|
|||||||
23
archbuild.in
23
archbuild.in
@@ -5,7 +5,7 @@ m4_include(lib/common.sh)
|
|||||||
m4_include(lib/archroot.sh)
|
m4_include(lib/archroot.sh)
|
||||||
|
|
||||||
base_packages=(base-devel)
|
base_packages=(base-devel)
|
||||||
makechrootpkg_args=(-c -n)
|
makechrootpkg_args=(-c -n -C)
|
||||||
|
|
||||||
cmd="${0##*/}"
|
cmd="${0##*/}"
|
||||||
if [[ "${cmd%%-*}" == 'multilib' ]]; then
|
if [[ "${cmd%%-*}" == 'multilib' ]]; then
|
||||||
@@ -20,6 +20,15 @@ fi
|
|||||||
chroots='/var/lib/archbuild'
|
chroots='/var/lib/archbuild'
|
||||||
clean_first=false
|
clean_first=false
|
||||||
|
|
||||||
|
pacman_config="@pkgdatadir@/pacman-${repo}.conf"
|
||||||
|
if [[ -f @pkgdatadir@/pacman-${repo}-${arch}.conf ]]; then
|
||||||
|
pacman_config="@pkgdatadir@/pacman-${repo}-${arch}.conf"
|
||||||
|
fi
|
||||||
|
makepkg_config="@pkgdatadir@/makepkg-${arch}.conf"
|
||||||
|
if [[ -f @pkgdatadir@/makepkg-${repo}-${arch}.conf ]]; then
|
||||||
|
makepkg_config="@pkgdatadir@/makepkg-${repo}-${arch}.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $cmd [options] -- [makechrootpkg args]"
|
echo "Usage: $cmd [options] -- [makechrootpkg args]"
|
||||||
echo ' -h This help'
|
echo ' -h This help'
|
||||||
@@ -59,19 +68,19 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
|
|||||||
lock_close 9
|
lock_close 9
|
||||||
|
|
||||||
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
|
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
|
||||||
mkdir -p "${chroots}/${repo}-${arch}"
|
mkdir -m755 -p "${chroots}/${repo}-${arch}"
|
||||||
setarch "${arch}" mkarchroot \
|
setarch "${arch}" mkarchroot \
|
||||||
-C "@pkgdatadir@/pacman-${repo}.conf" \
|
-C "${pacman_config}" \
|
||||||
-M "@pkgdatadir@/makepkg-${arch}.conf" \
|
-M "${makepkg_config}" \
|
||||||
"${chroots}/${repo}-${arch}/root" \
|
"${chroots}/${repo}-${arch}/root" \
|
||||||
"${base_packages[@]}" || abort
|
"${base_packages[@]}" || abort
|
||||||
else
|
else
|
||||||
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
|
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
|
||||||
arch-nspawn \
|
arch-nspawn \
|
||||||
-C "@pkgdatadir@/pacman-${repo}.conf" \
|
-C "${pacman_config}" \
|
||||||
-M "@pkgdatadir@/makepkg-${arch}.conf" \
|
-M "${makepkg_config}" \
|
||||||
"${chroots}/${repo}-${arch}/root" \
|
"${chroots}/${repo}-${arch}/root" \
|
||||||
pacman -Syu --noconfirm || abort
|
pacman -Syuu --noconfirm || abort
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Always build official packages reproducibly
|
# Always build official packages reproducibly
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ if [[ $(svn status -q) ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
pushd .. >/dev/null
|
pushd .. >/dev/null
|
||||||
IFS=$'\n' read -r -d '' -a known_files < <(svn ls -r HEAD "$trunk")
|
mapfile -t known_files < <(svn ls -r HEAD "$trunk")
|
||||||
|
wait $! || die "failed to discover committed files"
|
||||||
for file in "${known_files[@]}"; do
|
for file in "${known_files[@]}"; do
|
||||||
if [[ ${file:(-1)} = '/' ]]; then
|
if [[ ${file:(-1)} = '/' ]]; then
|
||||||
die "archrelease: subdirectories are not supported in package directories!"
|
die "archrelease: subdirectories are not supported in package directories!"
|
||||||
@@ -65,12 +66,12 @@ for tag in "$@"; do
|
|||||||
stat_busy "Copying %s to %s" "${trunk}" "${tag}"
|
stat_busy "Copying %s to %s" "${trunk}" "${tag}"
|
||||||
|
|
||||||
if [[ -d repos/$tag ]]; then
|
if [[ -d repos/$tag ]]; then
|
||||||
declare -a trash
|
mapfile -t trash < <(svn ls "repos/$tag")
|
||||||
trash=()
|
wait $! || die "failed to discover existing files"
|
||||||
while read -r file; do
|
if (( ${#trash[@]} )); then
|
||||||
trash+=("repos/$tag/$file")
|
trash=("${trash[@]/#/repos/$tag/}")
|
||||||
done < <(svn ls "repos/$tag")
|
svn rm -q "${trash[@]/%/@}"
|
||||||
[[ ${#trash[@]} == 0 ]] || svn rm -q "${trash[@]/%/@}"
|
fi
|
||||||
else
|
else
|
||||||
mkdir -p "repos/$tag"
|
mkdir -p "repos/$tag"
|
||||||
svn add --parents -q "repos/$tag"
|
svn add --parents -q "repos/$tag"
|
||||||
|
|||||||
78
checkpkg.in
78
checkpkg.in
@@ -22,6 +22,53 @@ elif [[ -r "$HOME/.makepkg.conf" ]]; then
|
|||||||
source "$HOME/.makepkg.conf"
|
source "$HOME/.makepkg.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${BASH_SOURCE[0]##*/} [OPTIONS]
|
||||||
|
|
||||||
|
Searches for a locally built package corresponding to the PKGBUILD, and
|
||||||
|
downloads the last version of that package from the Pacman repositories.
|
||||||
|
It then compares the list of .so files provided by each version of the
|
||||||
|
package and outputs if there are soname differences for the new package.
|
||||||
|
A directory is also created using mktemp with files containing a file
|
||||||
|
list for both packages and a library list for both packages.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-r, --rmdir Remove the temporary directory
|
||||||
|
-w, --warn Print a warning in case of differences
|
||||||
|
-h, --help Show this help text
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
RMDIR=0
|
||||||
|
WARN=0
|
||||||
|
|
||||||
|
OPT_SHORT='rwh'
|
||||||
|
OPT_LONG=('rmdir' 'warn' 'help')
|
||||||
|
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
set -- "${OPTRET[@]}"
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
case $1 in
|
||||||
|
-r|--rmdir)
|
||||||
|
RMDIR=1
|
||||||
|
;;
|
||||||
|
-w|--warn)
|
||||||
|
WARN=1
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift; break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
die 'This must be run in the directory of a built package.'
|
die 'This must be run in the directory of a built package.'
|
||||||
fi
|
fi
|
||||||
@@ -33,9 +80,12 @@ if [[ ${arch[0]} == 'any' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
STARTDIR=$(pwd)
|
STARTDIR=$(pwd)
|
||||||
|
(( RMDIR )) && trap 'rm -rf $TEMPDIR' EXIT INT TERM QUIT
|
||||||
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
||||||
|
|
||||||
for _pkgname in "${pkgname[@]}"; do
|
for _pkgname in "${pkgname[@]}"; do
|
||||||
|
comparepkg=$_pkgname
|
||||||
|
pkgurl=
|
||||||
target_pkgver=$(get_full_version "$_pkgname")
|
target_pkgver=$(get_full_version "$_pkgname")
|
||||||
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
|
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
|
||||||
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"
|
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"
|
||||||
@@ -43,16 +93,29 @@ for _pkgname in "${pkgname[@]}"; do
|
|||||||
|
|
||||||
ln -s "$pkgfile" "$TEMPDIR"
|
ln -s "$pkgfile" "$TEMPDIR"
|
||||||
|
|
||||||
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") ||
|
if (( $# )); then
|
||||||
die "Couldn't download previous package for %s." "$_pkgname"
|
case $1 in
|
||||||
|
/*|*/*)
|
||||||
|
pkgurl=file://$(readlink -m "$1") ;;
|
||||||
|
*.pkg.tar*)
|
||||||
|
pkgurl=$1 ;;
|
||||||
|
'')
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
comparepkg=$1 ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
[[ -n $pkgurl ]] || pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$comparepkg") ||
|
||||||
|
die "Couldn't download previous package for %s." "$comparepkg"
|
||||||
|
|
||||||
oldpkg=${pkgurl##*://*/}
|
oldpkg=${pkgurl##*/}
|
||||||
|
|
||||||
if [[ ${oldpkg##*/} = "${pkgfile##*/}" ]]; then
|
if [[ ${oldpkg} = "${pkgfile##*/}" ]]; then
|
||||||
die "The built package (%s) is the one in the repo right now!" "$_pkgname"
|
die "The built package (%s) is the one in the repo right now!" "$_pkgname"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $pkgurl = file://* ]]; then
|
if [[ $pkgurl = file://* || ( $pkgurl = /* && -f $pkgurl ) ]]; then
|
||||||
ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg"
|
ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg"
|
||||||
elif [[ -f "$PKGDEST/$oldpkg" ]]; then
|
elif [[ -f "$PKGDEST/$oldpkg" ]]; then
|
||||||
ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg"
|
ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg"
|
||||||
@@ -70,11 +133,12 @@ for _pkgname in "${pkgname[@]}"; do
|
|||||||
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
||||||
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
||||||
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
|
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
|
||||||
msg "Sonames differ in $_pkgname!"
|
message="Sonames differ in $_pkgname!"
|
||||||
|
(( WARN )) && warning "$message" || msg "$message"
|
||||||
echo "$diff_output"
|
echo "$diff_output"
|
||||||
else
|
else
|
||||||
msg "No soname differences for %s." "$_pkgname"
|
msg "No soname differences for %s." "$_pkgname"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
msg "Files saved to %s" "$TEMPDIR"
|
(( RMDIR )) || msg "Files saved to %s" "$TEMPDIR"
|
||||||
|
|||||||
13
commitpkg.in
13
commitpkg.in
@@ -83,7 +83,7 @@ while getopts ':l:a:s:f' flag; do
|
|||||||
done
|
done
|
||||||
shift $(( OPTIND - 1 ))
|
shift $(( OPTIND - 1 ))
|
||||||
|
|
||||||
# check packages have the packager field set
|
# check packages for validity
|
||||||
for _arch in "${arch[@]}"; do
|
for _arch in "${arch[@]}"; do
|
||||||
if [[ -n $commit_arch && ${_arch} != "$commit_arch" ]]; then
|
if [[ -n $commit_arch && ${_arch} != "$commit_arch" ]]; then
|
||||||
continue
|
continue
|
||||||
@@ -91,10 +91,15 @@ for _arch in "${arch[@]}"; do
|
|||||||
for _pkgname in "${pkgname[@]}"; do
|
for _pkgname in "${pkgname[@]}"; do
|
||||||
fullver=$(get_full_version "$_pkgname")
|
fullver=$(get_full_version "$_pkgname")
|
||||||
|
|
||||||
if pkgfile=$(find_cached_package "$_pkgname" "$_arch" "$fullver"); then
|
if pkgfile=$(find_cached_package "$_pkgname" "$fullver" "$_arch"); then
|
||||||
if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then
|
if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then
|
||||||
die "PACKAGER was not set when building package"
|
die "PACKAGER was not set when building package"
|
||||||
fi
|
fi
|
||||||
|
hashsum=sha256sum
|
||||||
|
pkgbuild_hash=$(awk -v"hashsum=$hashsum" -F' = ' '$1 == "pkgbuild_"hashsum {print $2}' <(bsdtar -xOqf "$pkgfile" .BUILDINFO))
|
||||||
|
if [[ "$pkgbuild_hash" != "$($hashsum PKGBUILD|cut -d' ' -f1)" ]]; then
|
||||||
|
die "PKGBUILD $hashsum mismatch: expected $pkgbuild_hash"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
@@ -157,8 +162,8 @@ for _arch in "${arch[@]}"; do
|
|||||||
fi
|
fi
|
||||||
gpg --detach-sign --use-agent --no-armor "${SIGNWITHKEY[@]}" "${pkgfile}" || die
|
gpg --detach-sign --use-agent --no-armor "${SIGNWITHKEY[@]}" "${pkgfile}" || die
|
||||||
fi
|
fi
|
||||||
if ! gpg --verify "$sigfile" >/dev/null 2>&1; then
|
if ! gpg --verify "$sigfile" "$pkgfile" >/dev/null 2>&1; then
|
||||||
die "Signature %s.sig is incorrect!" "$pkgfile"
|
die "Signature %s is incorrect!" "$sigfile"
|
||||||
fi
|
fi
|
||||||
uploads+=("$sigfile")
|
uploads+=("$sigfile")
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -19,6 +19,19 @@ outputs if there are soname differences for the new package. A directory is
|
|||||||
also created using mktemp with files containing a file list for both packages
|
also created using mktemp with files containing a file list for both packages
|
||||||
and a library list for both packages.
|
and a library list for both packages.
|
||||||
|
|
||||||
|
Options
|
||||||
|
-------
|
||||||
|
|
||||||
|
*-r, --rmdir*::
|
||||||
|
Remove the temporary directory created to contain the file and library list
|
||||||
|
of both packages.
|
||||||
|
|
||||||
|
*-w, --warn*::
|
||||||
|
Print a warning instead of a regular message in case of soname differences.
|
||||||
|
|
||||||
|
*-h, --help*::
|
||||||
|
Show a help text
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|||||||
52
doc/offload-build.1.asciidoc
Normal file
52
doc/offload-build.1.asciidoc
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
offload-build(1)
|
||||||
|
================
|
||||||
|
|
||||||
|
Name
|
||||||
|
----
|
||||||
|
offload-build - Build a PKGBUILD on a remote server using makechrootpkg
|
||||||
|
|
||||||
|
Synopsis
|
||||||
|
--------
|
||||||
|
offload-build [OPTIONS] -- [ARCHBUILD_OPTIONS]
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Build a PKGBUILD on a remote server using makechrootpkg. Requires a remote user
|
||||||
|
that can run archbuild in a non-interactive manner, e.g. must be able to
|
||||||
|
elevate permissions using passwordless sudo.
|
||||||
|
|
||||||
|
Options
|
||||||
|
-------
|
||||||
|
|
||||||
|
*-r, --repo* <reponame>::
|
||||||
|
Build against a specific repository. The default is `extra`, to build packages using
|
||||||
|
the stable repositories via extra-x86_64-build.
|
||||||
|
|
||||||
|
*-a, --arch* <architecture>::
|
||||||
|
Build against a specific architecture. The default is `x86_64`, the only
|
||||||
|
architecture officially supported by Arch Linux.
|
||||||
|
|
||||||
|
*-s, --server* <hostname>::
|
||||||
|
Offload to a specific build server. The default is dragon.archlinux.org
|
||||||
|
which is used as part of the build toolchain for the official Arch Linux
|
||||||
|
repos.
|
||||||
|
|
||||||
|
*-h, --help*::
|
||||||
|
Show a help text.
|
||||||
|
|
||||||
|
Passing options to archbuild
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Options after a delimiting -- are passed on to archbuild on the remote.
|
||||||
|
archbuild in turn supports passing arguments on to makechrootpkg, which in turn
|
||||||
|
supports passing options to makepkg. Since each uses -- to delimit options that
|
||||||
|
are forwarded, make sure to escape them properly:
|
||||||
|
|
||||||
|
`offload-build offload-args -- archbuild-args -- makechrootpkg-args -- makepkg-args`
|
||||||
|
|
||||||
|
Example: To use a second `testing-x86_64-build` instance with another copydir:
|
||||||
|
|
||||||
|
`offload-build -r testing -- -- -l <chroot_copy>`
|
||||||
|
|
||||||
|
include::footer.asciidoc[]
|
||||||
@@ -13,7 +13,7 @@ if [[ $1 = "--ignore-internal" ]]; then
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
script_mode=${0##*/find-lib}
|
script_mode=${BASH_SOURCE[0]##*/find-lib}
|
||||||
|
|
||||||
case $script_mode in
|
case $script_mode in
|
||||||
deps|provides) true;;
|
deps|provides) true;;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if [[ -z $match ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find . -type d | while read -r d; do
|
find . -type d -print0 2>/dev/null| while read -r -d '' d; do
|
||||||
if [[ -f "$d/PKGBUILD" ]]; then
|
if [[ -f "$d/PKGBUILD" ]]; then
|
||||||
pkgname=() depends=() makedepends=() optdepends=()
|
pkgname=() depends=() makedepends=() optdepends=()
|
||||||
# shellcheck source=PKGBUILD.proto
|
# shellcheck source=PKGBUILD.proto
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ CHROOT_VERSION='v4'
|
|||||||
##
|
##
|
||||||
# usage : check_root $keepenv
|
# usage : check_root $keepenv
|
||||||
##
|
##
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("${BASH_SOURCE[0]}" "$@")
|
||||||
check_root() {
|
check_root() {
|
||||||
local keepenv=$1
|
local keepenv=$1
|
||||||
|
|
||||||
@@ -37,14 +37,6 @@ is_subvolume() {
|
|||||||
[[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs && "$(stat -c %i "$1")" == 256 ]]
|
[[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs && "$(stat -c %i "$1")" == 256 ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
##
|
|
||||||
# usage : is_same_fs( $path_a, $path_b )
|
|
||||||
# return : whether $path_a and $path_b are on the same filesystem
|
|
||||||
##
|
|
||||||
is_same_fs() {
|
|
||||||
[[ "$(stat -c %d "$1")" == "$(stat -c %d "$1")" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# usage : subvolume_delete_recursive( $path )
|
# usage : subvolume_delete_recursive( $path )
|
||||||
#
|
#
|
||||||
|
|||||||
31
lib/valid-repos.sh
Normal file
31
lib/valid-repos.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/hint/bash
|
||||||
|
# License: Unspecified
|
||||||
|
:
|
||||||
|
|
||||||
|
# shellcheck disable=2034
|
||||||
|
_repos=(
|
||||||
|
staging
|
||||||
|
testing
|
||||||
|
core
|
||||||
|
extra
|
||||||
|
community-staging
|
||||||
|
community-testing
|
||||||
|
community
|
||||||
|
multilib-staging
|
||||||
|
multilib-testing
|
||||||
|
multilib
|
||||||
|
gnome-unstable
|
||||||
|
kde-unstable
|
||||||
|
)
|
||||||
|
|
||||||
|
# shellcheck disable=2034
|
||||||
|
_build_repos=(
|
||||||
|
staging
|
||||||
|
testing
|
||||||
|
extra
|
||||||
|
multilib-staging
|
||||||
|
multilib-testing
|
||||||
|
multilib
|
||||||
|
gnome-unstable
|
||||||
|
kde-unstable
|
||||||
|
)
|
||||||
177
makechrootpkg.in
177
makechrootpkg.in
@@ -15,6 +15,30 @@ m4_include(lib/archroot.sh)
|
|||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
|
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
||||||
|
makepkg_args=("${default_makepkg_args[@]}")
|
||||||
|
verifysource_args=()
|
||||||
|
chrootdir=
|
||||||
|
passeddir=
|
||||||
|
makepkg_user=
|
||||||
|
declare -a install_pkgs
|
||||||
|
declare -i ret=0
|
||||||
|
|
||||||
|
keepbuilddir=0
|
||||||
|
update_first=0
|
||||||
|
clean_first=0
|
||||||
|
run_namcap=0
|
||||||
|
run_checkpkg=0
|
||||||
|
temp_chroot=0
|
||||||
|
|
||||||
|
bindmounts_ro=()
|
||||||
|
bindmounts_rw=()
|
||||||
|
|
||||||
|
copy=$USER
|
||||||
|
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
||||||
|
[[ -z "$copy" || $copy = root ]] && copy=copy
|
||||||
|
src_owner=${SUDO_USER:-$USER}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
||||||
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
||||||
@@ -49,6 +73,7 @@ usage() {
|
|||||||
echo ' Useful for maintaining multiple copies'
|
echo ' Useful for maintaining multiple copies'
|
||||||
echo " Default: $copy"
|
echo " Default: $copy"
|
||||||
echo '-n Run namcap on the package'
|
echo '-n Run namcap on the package'
|
||||||
|
echo '-C Run checkpkg on the package'
|
||||||
echo '-T Build in a temporary directory'
|
echo '-T Build in a temporary directory'
|
||||||
echo '-U Run makepkg as a specified user'
|
echo '-U Run makepkg as a specified user'
|
||||||
exit 1
|
exit 1
|
||||||
@@ -69,43 +94,37 @@ load_vars() {
|
|||||||
[[ -f $makepkg_conf ]] || return 1
|
[[ -f $makepkg_conf ]] || return 1
|
||||||
|
|
||||||
for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do
|
for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do
|
||||||
[[ -z ${!var:-} ]] && eval "$(grep -a "^${var}=" "$makepkg_conf")"
|
[[ -z ${!var:-} ]] && eval "$(source "$makepkg_conf"; printf "%s='%s'" "$var" "${!var}")"
|
||||||
done
|
done
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: sync_chroot $rootdir $copydir [$copy]
|
# Usage: sync_chroot $chrootdir $copydir [$copy]
|
||||||
sync_chroot() {
|
sync_chroot() {
|
||||||
local rootdir=$1
|
local chrootdir=$1
|
||||||
local copydir=$2
|
local copydir=$2
|
||||||
local copy=${3:-$2}
|
local copy=${3:-$2}
|
||||||
|
|
||||||
if [[ "$rootdir" -ef "$copydir" ]]; then
|
if [[ "$chrootdir/root" -ef "$copydir" ]]; then
|
||||||
error 'Cannot sync copy with itself: %s' "$copydir"
|
error 'Cannot sync copy with itself: %s' "$copydir"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get a read lock on the root chroot to make
|
# Get a read lock on the root chroot to make
|
||||||
# sure we don't clone a half-updated chroot
|
# sure we don't clone a half-updated chroot
|
||||||
slock 8 "$rootdir.lock" \
|
slock 8 "$chrootdir/root.lock" \
|
||||||
"Locking clean chroot [%s]" "$rootdir"
|
"Locking clean chroot [%s]" "$chrootdir/root"
|
||||||
|
|
||||||
stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$rootdir" "$copy"
|
stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$chrootdir/root" "$copy"
|
||||||
if is_subvolume "$rootdir" && is_same_fs "$rootdir" "$(dirname -- "$copydir")" && ! mountpoint -q "$copydir"; then
|
if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then
|
||||||
if is_subvolume "$copydir"; then
|
|
||||||
subvolume_delete_recursive "$copydir" ||
|
subvolume_delete_recursive "$copydir" ||
|
||||||
die "Unable to delete subvolume %s" "$copydir"
|
die "Unable to delete subvolume %s" "$copydir"
|
||||||
else
|
btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null ||
|
||||||
# avoid change of filesystem in case of an umount failure
|
|
||||||
rm --recursive --force --one-file-system "$copydir" ||
|
|
||||||
die "Unable to delete %s" "$copydir"
|
|
||||||
fi
|
|
||||||
btrfs subvolume snapshot "$rootdir" "$copydir" >/dev/null ||
|
|
||||||
die "Unable to create subvolume %s" "$copydir"
|
die "Unable to create subvolume %s" "$copydir"
|
||||||
else
|
else
|
||||||
mkdir -p "$copydir"
|
mkdir -p "$copydir"
|
||||||
rsync -a --delete -q -W -x "$rootdir/" "$copydir"
|
rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir"
|
||||||
fi
|
fi
|
||||||
stat_done
|
stat_done
|
||||||
|
|
||||||
@@ -136,11 +155,7 @@ delete_chroot() {
|
|||||||
stat_done
|
stat_done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: install_packages $copydir $pkgs...
|
|
||||||
install_packages() {
|
install_packages() {
|
||||||
local copydir=$1
|
|
||||||
local install_pkgs=("${@:2}")
|
|
||||||
|
|
||||||
local -a pkgnames
|
local -a pkgnames
|
||||||
local ret
|
local ret
|
||||||
|
|
||||||
@@ -148,28 +163,19 @@ install_packages() {
|
|||||||
|
|
||||||
cp -- "${install_pkgs[@]}" "$copydir/root/"
|
cp -- "${install_pkgs[@]}" "$copydir/root/"
|
||||||
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||||
pacman -U --noconfirm -- "${pkgnames[@]/#//root/}"
|
bash -c 'yes y | pacman -U -- "$@"' -bash "${pkgnames[@]/#//root/}"
|
||||||
ret=$?
|
ret=$?
|
||||||
rm -- "${pkgnames[@]/#/$copydir/root/}"
|
rm -- "${pkgnames[@]/#/$copydir/root/}"
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: prepare_chroot $copydir $HOME $keepbuilddir $run_namcap
|
|
||||||
# Globals:
|
|
||||||
# - MAKEFLAGS
|
|
||||||
# - PACKAGER
|
|
||||||
prepare_chroot() {
|
prepare_chroot() {
|
||||||
local copydir=$1
|
(( keepbuilddir )) || rm -rf "$copydir/build"
|
||||||
local USER_HOME=$2
|
|
||||||
local keepbuilddir=$3
|
|
||||||
local run_namcap=$4
|
|
||||||
|
|
||||||
[[ $keepbuilddir = true ]] || rm -rf "$copydir/build"
|
|
||||||
|
|
||||||
local builduser_uid builduser_gid
|
local builduser_uid builduser_gid
|
||||||
builduser_uid="${SUDO_UID:-$UID}"
|
builduser_uid="$(id -u "$makepkg_user")"
|
||||||
builduser_gid="$(id -g "$builduser_uid")"
|
builduser_gid="$(id -g "$makepkg_user")"
|
||||||
local install="install -o $builduser_uid -g $builduser_gid"
|
local install="install -o $builduser_uid -g $builduser_gid"
|
||||||
local x
|
local x
|
||||||
|
|
||||||
@@ -204,7 +210,7 @@ EOF
|
|||||||
declare -p SOURCE_DATE_EPOCH 2>/dev/null || true
|
declare -p SOURCE_DATE_EPOCH 2>/dev/null || true
|
||||||
printf '_chrootbuild "$@" || exit\n'
|
printf '_chrootbuild "$@" || exit\n'
|
||||||
|
|
||||||
if [[ $run_namcap = true ]]; then
|
if (( run_namcap )); then
|
||||||
declare -f _chrootnamcap
|
declare -f _chrootnamcap
|
||||||
printf '_chrootnamcap || exit\n'
|
printf '_chrootnamcap || exit\n'
|
||||||
fi
|
fi
|
||||||
@@ -243,32 +249,18 @@ _chrootnamcap() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: download_sources $copydir $makepkg_user
|
|
||||||
# Globals:
|
|
||||||
# - SRCDEST
|
|
||||||
download_sources() {
|
download_sources() {
|
||||||
local copydir=$1
|
|
||||||
local makepkg_user=$2
|
|
||||||
|
|
||||||
setup_workdir
|
setup_workdir
|
||||||
chown "$makepkg_user:" "$WORKDIR"
|
chown "$makepkg_user:" "$WORKDIR"
|
||||||
|
|
||||||
# Ensure sources are downloaded
|
# Ensure sources are downloaded
|
||||||
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
|
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
|
||||||
env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \
|
env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \
|
||||||
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
|
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o "${verifysource_args[@]}" ||
|
||||||
die "Could not download sources."
|
die "Could not download sources."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: move_products $copydir $owner
|
|
||||||
# Globals:
|
|
||||||
# - PKGDEST
|
|
||||||
# - LOGDEST
|
|
||||||
# - SRCPKGDEST
|
|
||||||
move_products() {
|
move_products() {
|
||||||
local copydir=$1
|
|
||||||
local src_owner=$2
|
|
||||||
|
|
||||||
local pkgfile
|
local pkgfile
|
||||||
for pkgfile in "$copydir"/pkgdest/*; do
|
for pkgfile in "$copydir"/pkgdest/*; do
|
||||||
chown "$src_owner" "$pkgfile"
|
chown "$src_owner" "$pkgfile"
|
||||||
@@ -299,39 +291,18 @@ move_products() {
|
|||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
main() {
|
while getopts 'hcur:I:l:nCTD:d:U:' arg; do
|
||||||
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
|
||||||
makepkg_args=("${default_makepkg_args[@]}")
|
|
||||||
keepbuilddir=false
|
|
||||||
update_first=false
|
|
||||||
clean_first=false
|
|
||||||
run_namcap=false
|
|
||||||
temp_chroot=false
|
|
||||||
chrootdir=
|
|
||||||
passeddir=
|
|
||||||
makepkg_user=
|
|
||||||
declare -a install_pkgs
|
|
||||||
declare -i ret=0
|
|
||||||
|
|
||||||
bindmounts_ro=()
|
|
||||||
bindmounts_rw=()
|
|
||||||
|
|
||||||
copy=$USER
|
|
||||||
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
|
||||||
[[ -z "$copy" || $copy = root ]] && copy=copy
|
|
||||||
src_owner=${SUDO_USER:-$USER}
|
|
||||||
|
|
||||||
while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
c) clean_first=true ;;
|
c) clean_first=1 ;;
|
||||||
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
||||||
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
||||||
u) update_first=true ;;
|
u) update_first=1 ;;
|
||||||
r) passeddir="$OPTARG" ;;
|
r) passeddir="$OPTARG" ;;
|
||||||
I) install_pkgs+=("$OPTARG") ;;
|
I) install_pkgs+=("$OPTARG") ;;
|
||||||
l) copy="$OPTARG" ;;
|
l) copy="$OPTARG" ;;
|
||||||
n) run_namcap=true; makepkg_args+=(--install) ;;
|
n) run_namcap=1; makepkg_args+=(--install) ;;
|
||||||
T) temp_chroot=true; copy+="-$$" ;;
|
C) run_checkpkg=1 ;;
|
||||||
|
T) temp_chroot=1; copy+="-$$" ;;
|
||||||
U) makepkg_user="$OPTARG" ;;
|
U) makepkg_user="$OPTARG" ;;
|
||||||
h|*) usage ;;
|
h|*) usage ;;
|
||||||
esac
|
esac
|
||||||
@@ -358,12 +329,12 @@ main() {
|
|||||||
makepkg_args+=("${@:$OPTIND}")
|
makepkg_args+=("${@:$OPTIND}")
|
||||||
|
|
||||||
# See if -R or -e was passed to makepkg
|
# See if -R or -e was passed to makepkg
|
||||||
for arg in "${makepkg_args[@]}"; do
|
for arg in "${@:$OPTIND}"; do
|
||||||
case ${arg%%=*} in
|
case ${arg%%=*} in
|
||||||
--repackage|--noextract) keepbuilddir=true; break ;;
|
--skip*|--holdver) verifysource_args+=("$arg") ;;
|
||||||
--repackage|--noextract) keepbuilddir=true; break ;;
|
--repackage|--noextract) keepbuilddir=1 ;;
|
||||||
--*) ;;
|
--*) ;;
|
||||||
-*R*|-*e*) keepbuilddir=true; break ;;
|
-*R*|-*e*) keepbuilddir=1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -387,19 +358,19 @@ main() {
|
|||||||
# Lock the chroot we want to use. We'll keep this lock until we exit.
|
# Lock the chroot we want to use. We'll keep this lock until we exit.
|
||||||
lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy"
|
lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy"
|
||||||
|
|
||||||
if [[ ! -d $copydir ]] || $clean_first; then
|
if [[ ! -d $copydir ]] || (( clean_first )); then
|
||||||
sync_chroot "$chrootdir/root" "$copydir" "$copy"
|
sync_chroot "$chrootdir" "$copydir" "$copy"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$update_first && arch-nspawn "$copydir" \
|
(( update_first )) && arch-nspawn "$copydir" \
|
||||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||||
pacman -Syu --noconfirm
|
pacman -Syuu --noconfirm
|
||||||
|
|
||||||
if [[ -n ${install_pkgs[*]:-} ]]; then
|
if [[ -n ${install_pkgs[*]:-} ]]; then
|
||||||
install_packages "$copydir" "${install_pkgs[@]}"
|
install_packages
|
||||||
ret=$?
|
ret=$?
|
||||||
# If there is no PKGBUILD we have done
|
# If there is no PKGBUILD we are done
|
||||||
[[ -f PKGBUILD ]] || return $ret
|
[[ -f PKGBUILD ]] || exit $ret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$(id -u "$makepkg_user")" == 0 ]]; then
|
if [[ "$(id -u "$makepkg_user")" == 0 ]]; then
|
||||||
@@ -407,32 +378,44 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
download_sources "$copydir" "$makepkg_user"
|
download_sources
|
||||||
|
|
||||||
prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir" "$run_namcap"
|
prepare_chroot
|
||||||
|
|
||||||
if arch-nspawn "$copydir" \
|
if arch-nspawn "$copydir" \
|
||||||
--bind="$PWD:/startdir" \
|
--bind="${PWD//:/\\:}:/startdir" \
|
||||||
--bind="$SRCDEST:/srcdest" \
|
--bind="${SRCDEST//:/\\:}:/srcdest" \
|
||||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||||
/chrootbuild "${makepkg_args[@]}"
|
/chrootbuild "${makepkg_args[@]}"
|
||||||
then
|
then
|
||||||
move_products "$copydir" "$src_owner"
|
pkgnames=()
|
||||||
|
for pkgfile in "$copydir"/pkgdest/*; do
|
||||||
|
pkgfile=${pkgfile##*/};
|
||||||
|
pkgnames+=("${pkgfile%-*-*-*}");
|
||||||
|
done
|
||||||
|
move_products
|
||||||
else
|
else
|
||||||
(( ret += 1 ))
|
(( ret += 1 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$temp_chroot && delete_chroot "$copydir" "$copy"
|
(( temp_chroot )) && delete_chroot "$copydir" "$copy"
|
||||||
|
|
||||||
if (( ret != 0 )); then
|
if (( ret != 0 )); then
|
||||||
if $temp_chroot; then
|
if (( temp_chroot )); then
|
||||||
die "Build failed"
|
die "Build failed"
|
||||||
else
|
else
|
||||||
die "Build failed, check %s/build" "$copydir"
|
die "Build failed, check %s/build" "$copydir"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if (( run_checkpkg )); then
|
||||||
|
msg "Running checkpkg"
|
||||||
|
msg2 "Downloading current versions"
|
||||||
|
if pacman --noconfirm -Swdd --logfile /dev/null "${pkgnames[@]}"; then
|
||||||
|
msg2 "Checking packages"
|
||||||
|
sudo -u "$makepkg_user" checkpkg --rmdir --warn
|
||||||
|
else
|
||||||
|
warning "Skipped checkpkg due to missing packages"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
|
|||||||
@@ -13,9 +13,14 @@
|
|||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
m4_include(lib/archroot.sh)
|
m4_include(lib/archroot.sh)
|
||||||
|
|
||||||
|
# umask might have been changed in /etc/profile
|
||||||
|
# ensure that sane default is set again
|
||||||
|
umask 0022
|
||||||
|
|
||||||
working_dir=''
|
working_dir=''
|
||||||
|
|
||||||
files=()
|
files=()
|
||||||
|
nspawn_args=()
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options] working-dir package-list..."
|
echo "Usage: ${0##*/} [options] working-dir package-list..."
|
||||||
@@ -33,12 +38,14 @@ while getopts 'hC:M:c:f:s' arg; do
|
|||||||
case "$arg" in
|
case "$arg" in
|
||||||
C) pac_conf="$OPTARG" ;;
|
C) pac_conf="$OPTARG" ;;
|
||||||
M) makepkg_conf="$OPTARG" ;;
|
M) makepkg_conf="$OPTARG" ;;
|
||||||
c) cache_dir="$OPTARG" ;;
|
c) cache_dirs+=("$OPTARG") ;;
|
||||||
f) files+=("$OPTARG") ;;
|
f) files+=("$OPTARG") ;;
|
||||||
s) nosetarch=1 ;;
|
s) nosetarch=1 ;;
|
||||||
h|?) usage ;;
|
h|?) usage ;;
|
||||||
*) error "invalid argument '%s'" "$arg"; usage ;;
|
*) error "invalid argument '%s'" "$arg"; usage ;;
|
||||||
esac
|
esac
|
||||||
|
nspawn_args+=("-$arg")
|
||||||
|
[[ -v OPTARG ]] && nspawn_args+=("$OPTARG")
|
||||||
done
|
done
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
@@ -51,10 +58,10 @@ shift 1
|
|||||||
|
|
||||||
[[ -z $working_dir ]] && die 'Please specify a working directory.'
|
[[ -z $working_dir ]] && die 'Please specify a working directory.'
|
||||||
|
|
||||||
if [[ -z $cache_dir ]]; then
|
pacconf_cmd=$(command -v pacman-conf || command -v pacconf)
|
||||||
cache_dirs=($(pacman -v "$cache_conf" 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
|
|
||||||
else
|
if (( ${#cache_dirs[@]} == 0 )); then
|
||||||
cache_dirs=(${cache_dir})
|
mapfile -t cache_dirs < <($pacconf_cmd CacheDir)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
@@ -78,12 +85,7 @@ for file in "${files[@]}"; do
|
|||||||
cp "$file" "$working_dir$file"
|
cp "$file" "$working_dir$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
_env=()
|
pacstrap -Mcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
||||||
while read -r varname; do
|
|
||||||
_env+=("$varname=${!varname}")
|
|
||||||
done < <(declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$')
|
|
||||||
env -i "${_env[@]}" \
|
|
||||||
pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
|
||||||
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
|
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
|
||||||
|
|
||||||
printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen"
|
printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen"
|
||||||
@@ -93,8 +95,5 @@ echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot"
|
|||||||
systemd-machine-id-setup --root="$working_dir"
|
systemd-machine-id-setup --root="$working_dir"
|
||||||
|
|
||||||
exec arch-nspawn \
|
exec arch-nspawn \
|
||||||
${nosetarch:+-s} \
|
"${nspawn_args[@]}" \
|
||||||
${pac_conf:+-C "$pac_conf"} \
|
|
||||||
${makepkg_conf:+-M "$makepkg_conf"} \
|
|
||||||
${cache_dir:+-c "$cache_dir"} \
|
|
||||||
"$working_dir" locale-gen
|
"$working_dir" locale-gen
|
||||||
|
|||||||
108
offload-build
Executable file
108
offload-build
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# offload-build - build a PKGBUILD on a remote server using makechrootpkg.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 by Eli Schwartz <eschwartz@archlinux.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# global defaults suitable for use by Arch staff
|
||||||
|
repo=extra
|
||||||
|
arch=x86_64
|
||||||
|
server=dragon.archlinux.org
|
||||||
|
|
||||||
|
die() { printf "error: $1\n" "${@:2}"; exit 1; }
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${BASH_SOURCE[0]##*/} [--repo REPO] [--arch ARCHITECTURE] [--server SERVER] -- [ARCHBUILD_ARGS]
|
||||||
|
|
||||||
|
Build a PKGBUILD on a remote server using makechrootpkg. Requires a remote user
|
||||||
|
that can run archbuild without password auth. Options passed after a -- are
|
||||||
|
passed on to archbuild, and eventually to makechrootpkg.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-r, --repo Build against a specific repository (current: $repo)
|
||||||
|
-a, --arch Build against a specific architecture (current: $arch)
|
||||||
|
-s, --server Offload to a specific build server (current: $server)
|
||||||
|
-h, --help Show this help text
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
# option checking
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-r|--repo)
|
||||||
|
repo=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-a|--arch)
|
||||||
|
arch=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-s|--server)
|
||||||
|
server=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# multilib must be handled specially
|
||||||
|
if [[ $repo = multilib* ]]; then
|
||||||
|
arch=
|
||||||
|
fi
|
||||||
|
|
||||||
|
archbuild_cmd=("${repo}${arch:+-$arch}-build" "$@")
|
||||||
|
|
||||||
|
trap 'rm -rf $SRCPKGDEST' EXIT
|
||||||
|
|
||||||
|
# Use a source-only tarball as an intermediate to transfer files. This
|
||||||
|
# guarantees the checksums are okay, and guarantees that all needed files are
|
||||||
|
# transferred, including local sources, install scripts, and changelogs.
|
||||||
|
export SRCPKGDEST=$(mktemp -d)
|
||||||
|
makepkg --source || die "unable to make source package"
|
||||||
|
|
||||||
|
mapfile -t files < <(
|
||||||
|
# This is sort of bash golfing but it allows running a mildly complex
|
||||||
|
# command over ssh with a single connection.
|
||||||
|
# shellcheck disable=SC2145
|
||||||
|
cat "$SRCPKGDEST"/*.src.tar.gz |
|
||||||
|
ssh $server '
|
||||||
|
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
|
||||||
|
mkdir -p "$temp" &&
|
||||||
|
temp=$(mktemp -d -p "$temp") &&
|
||||||
|
cd "$temp" &&
|
||||||
|
{
|
||||||
|
bsdtar --strip-components 1 -xvf - &&
|
||||||
|
script -qefc "'"${archbuild_cmd[@]@Q}"'" /dev/null &&
|
||||||
|
printf "%s\n" "" "-> build complete" &&
|
||||||
|
printf "\t%s\n" "$temp"/*
|
||||||
|
} >&2 &&
|
||||||
|
makepkg --packagelist
|
||||||
|
')
|
||||||
|
|
||||||
|
(( ${#files[@]} )) && printf '%s\n' '' '-> copying files...' && scp "${files[@]/#/$server:}" .
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
|
|
||||||
if (( $# < 1 )); then
|
if (( $# < 1 )); then
|
||||||
printf 'Usage: %s <chrootdir> <packages to rebuild>\n' "$(basename "$0")"
|
printf 'Usage: %s <chrootdir> <packages to rebuild>\n' "$(basename "${BASH_SOURCE[0]}")"
|
||||||
printf ' example: %s ~/chroot readline bash foo bar baz\n' "$(basename "$0")"
|
printf ' example: %s ~/chroot readline bash foo bar baz\n' "$(basename "${BASH_SOURCE[0]}")"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,8 @@
|
|||||||
# globals
|
# globals
|
||||||
: ${SOLINKS_MIRROR:="https://mirror.pkgbuild.com"}
|
: ${SOLINKS_MIRROR:="https://mirror.pkgbuild.com"}
|
||||||
: ${SOCACHE_DIR:="${XDG_CACHE_HOME:-${HOME}/.cache}/sogrep"}
|
: ${SOCACHE_DIR:="${XDG_CACHE_HOME:-${HOME}/.cache}/sogrep"}
|
||||||
repos=('staging' 'testing' 'core' 'extra'
|
|
||||||
'community-staging' 'community-testing' 'community'
|
m4_include(lib/valid-repos.sh)
|
||||||
'multilib-staging' 'multilib-testing' 'multilib'
|
|
||||||
'gnome-unstable' 'kde-unstable')
|
|
||||||
arches=('x86_64')
|
arches=('x86_64')
|
||||||
|
|
||||||
# options
|
# options
|
||||||
@@ -39,20 +37,20 @@ recache() {
|
|||||||
|
|
||||||
(( VERBOSE )) && verbosity=--progress-bar
|
(( VERBOSE )) && verbosity=--progress-bar
|
||||||
|
|
||||||
for repo in "${repos[@]}"; do
|
for repo in "${_repos[@]}"; do
|
||||||
for arch in "${arches[@]}"; do
|
for arch in "${arches[@]}"; do
|
||||||
rm -rf "${SOCACHE_DIR}/${arch}/${repo}"
|
rm -rf "${SOCACHE_DIR}/${arch}/${repo}"
|
||||||
mkdir -p "${SOCACHE_DIR}/${arch}/${repo}"
|
mkdir -p "${SOCACHE_DIR}/${arch}/${repo}"
|
||||||
curl "$verbosity" "${SOLINKS_MIRROR}/${repo}/os/${arch}/${repo}.links.tar.gz" | bsdtar -xf - -C "${SOCACHE_DIR}/${arch}/${repo}"
|
curl -L "$verbosity" "${SOLINKS_MIRROR}/${repo}/os/${arch}/${repo}.links.tar.gz" | bsdtar -xf - -C "${SOCACHE_DIR}/${arch}/${repo}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
search() {
|
search() {
|
||||||
local repo=$1 arch lib=$2 srepos=("${repos[@]}")
|
local repo=$1 arch lib=$2 srepos=("${_repos[@]}")
|
||||||
|
|
||||||
if [[ $repo != all ]]; then
|
if [[ $repo != all ]]; then
|
||||||
if ! in_array "${repo}" "${repos[@]}"; then
|
if ! in_array "${repo}" "${_repos[@]}"; then
|
||||||
echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'"
|
echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'"
|
||||||
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
#compdef archbuild archco arch-nspawn archrelease commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco
|
#compdef archbuild archco arch-nspawn archrelease commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco checkpkg sogrep offload-build
|
||||||
# License: Unspecified
|
# License: Unspecified
|
||||||
|
|
||||||
m4_include(lib/valid-tags.sh)
|
m4_include(lib/valid-tags.sh)
|
||||||
|
m4_include(lib/valid-repos.sh)
|
||||||
|
|
||||||
|
_binary_arch=${_arch[*]:0:-1}
|
||||||
|
|
||||||
_archbuild_args=(
|
_archbuild_args=(
|
||||||
'-c[Recreate the chroot before building]'
|
'-c[Recreate the chroot before building]'
|
||||||
'-r[Create chroots in this directory]:base_dir:_files -/'
|
'-r[Create chroots in this directory]:base_dir:_files -/'
|
||||||
|
'-h[Display usage]'
|
||||||
)
|
)
|
||||||
|
|
||||||
_archco_args=(
|
_archco_args=(
|
||||||
@@ -13,19 +17,25 @@ _archco_args=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
_arch_nspawn_args=(
|
_arch_nspawn_args=(
|
||||||
'-C[Location of a pacman config file]:pacman_config:_files'
|
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
|
||||||
'-M[Location of a makepkg config file]:makepkg_config:_files'
|
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
||||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||||
|
'-f[Copy file from the host to the chroot]:copy_file:_files'
|
||||||
|
'-s[Do not run setarch]'
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
|
'1:chroot_dir:_files -/'
|
||||||
)
|
)
|
||||||
|
|
||||||
_archrelease_args=(
|
_archrelease_args=(
|
||||||
|
'-f[Force release without checks]'
|
||||||
"*:arch:($_tags[*])"
|
"*:arch:($_tags[*])"
|
||||||
)
|
)
|
||||||
|
|
||||||
_commitpkg_args=(
|
_commitpkg_args=(
|
||||||
"-a[Release to a specific architecture only]:arch:($_arch[*])"
|
'-f[Force release without checks]'
|
||||||
|
'-s[Target repo server]'
|
||||||
'-l[Set bandwidth limit]:limit'
|
'-l[Set bandwidth limit]:limit'
|
||||||
|
"-a[Release to a specific architecture only]:arch:($_arch[*])"
|
||||||
'1:commit_msg'
|
'1:commit_msg'
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,19 +44,26 @@ _finddeps_args=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
_makechrootpkg_args=(
|
_makechrootpkg_args=(
|
||||||
'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
|
|
||||||
'-c[Clean the chroot before building]'
|
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
'-l[The directory to use as the working copy]:copy_dir:_files -/'
|
'-c[Clean the chroot before building]'
|
||||||
'-r[The chroot dir to use]:chroot_dir:_files -/'
|
'-d[Bind directory into build chroot as read-write]:bind_dir_rw:_files -/'
|
||||||
|
'-D[Bind directory into build chroot as read-only]:bind_dir_ro:_files -/'
|
||||||
'-u[Update the working copy of the chroot before building]'
|
'-u[Update the working copy of the chroot before building]'
|
||||||
|
'-r[The chroot dir to use]:chroot_dir:_files -/'
|
||||||
|
'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
|
||||||
|
'-l[The directory to use as the working copy]:copy_dir:_files -/'
|
||||||
|
'-n[Run namcap on the package]'
|
||||||
|
'-T[Build in a temporary directory]'
|
||||||
|
'-U[Run makepkg as a specified user]:makepkg_user'
|
||||||
)
|
)
|
||||||
|
|
||||||
_mkarchroot_args=(
|
_mkarchroot_args=(
|
||||||
'-C[Location of a pacman config file]:pacman_config:_files'
|
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
|
||||||
'-M[Location of a makepkg config file]:makepkg_config:_files'
|
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
||||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
|
'1:working_dir:_files -/'
|
||||||
|
'*:packages:_devtools_completions_all_packages'
|
||||||
)
|
)
|
||||||
|
|
||||||
_rebuildpkgs_args=(
|
_rebuildpkgs_args=(
|
||||||
@@ -54,6 +71,27 @@ _rebuildpkgs_args=(
|
|||||||
'*:packages:_devtools_completions_all_packages'
|
'*:packages:_devtools_completions_all_packages'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_checkpkg_args=(
|
||||||
|
'(-r --rmdir)'{-r,--rmdir}'[Remove the temporary directory]'
|
||||||
|
'(-w --warn)'{-w,--warn}'[Print a warning in case of differences]'
|
||||||
|
'(-h --help)'{-h,--help}'[Display usage]'
|
||||||
|
)
|
||||||
|
|
||||||
|
_sogrep_args=(
|
||||||
|
'(-v --verbose)'{-v,--verbose}'[Show matched links in addition to pkgname]'
|
||||||
|
'(-r --refresh)'{-r,--refresh}'[Refresh the links databases]'
|
||||||
|
'(-h --help)'{-h,--help}'[Display usage]'
|
||||||
|
'1:repo:(all $_repos[*])'
|
||||||
|
'2:libname'
|
||||||
|
)
|
||||||
|
|
||||||
|
_offload_build_args=(
|
||||||
|
'(-r --repo)'{-r,--repo}'[Build against a specific repository]:repo:($_build_repos[*])'
|
||||||
|
'(-a --arch)'{-a,--arch}'[Build against a specific architecture]:arch:(${_binary_arch[*]})'
|
||||||
|
'(-s --server)'{-s,--server}'[Offload to a specific Build server]:server:'
|
||||||
|
'(-h --help)'{-h,--help}'[Display usage]'
|
||||||
|
)
|
||||||
|
|
||||||
_devtools_completions_all_packages() {
|
_devtools_completions_all_packages() {
|
||||||
typeset -U packages
|
typeset -U packages
|
||||||
packages=($(_call_program packages pacman -Sql))
|
packages=($(_call_program packages pacman -Sql))
|
||||||
|
|||||||
Reference in New Issue
Block a user