mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
1 Commits
github/for
...
20200407
Author | SHA1 | Date | |
---|---|---|---|
![]() |
aff81d34fd |
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
||||
V=20200213
|
||||
V=20200407
|
||||
|
||||
PREFIX = /usr/local
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
|
10
archbuild.in
10
archbuild.in
@@ -34,18 +34,16 @@ usage() {
|
||||
echo ' -h This help'
|
||||
echo ' -c Recreate the chroot before building'
|
||||
echo ' -r <dir> Create chroots in this directory'
|
||||
echo ' -s Do not run setarch'
|
||||
echo ''
|
||||
echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
|
||||
echo ''
|
||||
exit 1
|
||||
}
|
||||
|
||||
while getopts 'hcr:s' arg; do
|
||||
while getopts 'hcr:' arg; do
|
||||
case "${arg}" in
|
||||
c) clean_first=true ;;
|
||||
r) chroots="$OPTARG" ;;
|
||||
s) nosetarch_opt="-s" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
@@ -53,7 +51,7 @@ done
|
||||
check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME
|
||||
|
||||
# Pass all arguments after -- right to makepkg
|
||||
makechrootpkg_args+=("${nosetarch_opt}" "${@:$OPTIND}")
|
||||
makechrootpkg_args+=("${@:$OPTIND}")
|
||||
|
||||
if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
|
||||
msg "Creating chroot for [%s] (%s)..." "${repo}" "${arch}"
|
||||
@@ -71,14 +69,14 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
|
||||
|
||||
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
|
||||
(umask 0022; mkdir -p "${chroots}/${repo}-${arch}")
|
||||
mkarchroot ${nosetarch_opt} \
|
||||
setarch "${arch}" mkarchroot \
|
||||
-C "${pacman_config}" \
|
||||
-M "${makepkg_config}" \
|
||||
"${chroots}/${repo}-${arch}/root" \
|
||||
"${base_packages[@]}" || abort
|
||||
else
|
||||
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
|
||||
arch-nspawn ${nosetarch_opt} \
|
||||
arch-nspawn \
|
||||
-C "${pacman_config}" \
|
||||
-M "${makepkg_config}" \
|
||||
"${chroots}/${repo}-${arch}/root" \
|
||||
|
@@ -78,7 +78,6 @@ usage() {
|
||||
echo '-C Run checkpkg on the package'
|
||||
echo '-T Build in a temporary directory'
|
||||
echo '-U Run makepkg as a specified user'
|
||||
echo '-s Do not run setarch'
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -145,7 +144,7 @@ install_packages() {
|
||||
pkgnames=("${install_pkgs[@]##*/}")
|
||||
|
||||
cp -- "${install_pkgs[@]}" "$copydir/root/"
|
||||
arch-nspawn ${nosetarch_opt} "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||
bash -c 'yes y | pacman -U -- "$@"' -bash "${pkgnames[@]/#//root/}"
|
||||
ret=$?
|
||||
rm -- "${pkgnames[@]/#/$copydir/root/}"
|
||||
@@ -274,7 +273,7 @@ move_products() {
|
||||
}
|
||||
# }}}
|
||||
|
||||
while getopts 'hcur:I:l:nCTD:d:U:s' arg; do
|
||||
while getopts 'hcur:I:l:nCTD:d:U:' arg; do
|
||||
case "$arg" in
|
||||
c) clean_first=1 ;;
|
||||
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
||||
@@ -287,7 +286,6 @@ while getopts 'hcur:I:l:nCTD:d:U:s' arg; do
|
||||
C) run_checkpkg=1 ;;
|
||||
T) temp_chroot=1; copy+="-$$" ;;
|
||||
U) makepkg_user="$OPTARG" ;;
|
||||
s) nosetarch_opt="-s" ;;
|
||||
h|*) usage ;;
|
||||
esac
|
||||
done
|
||||
@@ -342,7 +340,7 @@ if [[ ! -d $copydir ]] || (( clean_first )); then
|
||||
sync_chroot "$chrootdir" "$copydir" "$copy"
|
||||
fi
|
||||
|
||||
(( update_first )) && arch-nspawn ${nosetarch_opt} "$copydir" \
|
||||
(( update_first )) && arch-nspawn "$copydir" \
|
||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||
pacman -Syuu --noconfirm
|
||||
|
||||
@@ -362,7 +360,7 @@ download_sources
|
||||
|
||||
prepare_chroot
|
||||
|
||||
if arch-nspawn ${nosetarch_opt} "$copydir" \
|
||||
if arch-nspawn "$copydir" \
|
||||
--bind="${PWD//:/\\:}:/startdir" \
|
||||
--bind="${SRCDEST//:/\\:}:/srcdest" \
|
||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||
@@ -399,7 +397,7 @@ else
|
||||
for remotepkg in "${remotepkgs[@]}"; do
|
||||
if [[ $remotepkg != file://* ]]; then
|
||||
msg2 "Downloading current versions"
|
||||
arch-nspawn ${nosetarch_opt} "$copydir" pacman --noconfirm -Swdd "${pkgnames[@]}"
|
||||
arch-nspawn "$copydir" pacman --noconfirm -Swdd "${pkgnames[@]}"
|
||||
mapfile -t remotepkgs < <(pacman --config "$copydir"/etc/pacman.conf \
|
||||
--dbpath "$copydir"/var/lib/pacman \
|
||||
-Sddp "${pkgnames[@]}")
|
||||
|
Reference in New Issue
Block a user