Compare commits

...

16 Commits

Author SHA1 Message Date
Pierre Schmitz
9cef7e0a9e Use nymeria instead of gerolde 2013-01-20 18:24:04 +01:00
Sébastien Luttringer
cb3a6ce1e8 -I ends early if there is nothing to build
This allow to build in one shot a package depending of a missing package

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-01-20 10:21:39 +01:00
Sébastien Luttringer
fb71ad1e7f Allow makechroot options in archbuild
This will allow, by example, to easily build a package with a custom pkg.

staging-x86_64-build -- -cI /var/cache/pacman/pkg/ldoc-1.2.0-1-any.pkg.tar.xz
staging-x86_64-build -- -n

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-01-20 10:21:31 +01:00
Pierre Schmitz
828143751b Drop initscripts support 2013-01-20 10:08:24 +01:00
Eric Bélanger
890baf6891 Make sure the usage functions are consistent
The usage messages now begins with a "Usage:", i.e. capitalized and with a colon. Fixes FS#26956.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 15:25:07 +01:00
Pierre Schmitz
2020fb406a prepare release 2012-11-15 14:38:03 +01:00
Eric Bélanger
4427b80aba crossrepomove: Fix dbscripts path for [community] move to nymeria
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:32:34 +01:00
Eric Bélanger
41b54bdde5 mkarchroot: Remove unnecessary parameter for usage function
Fixes FS#28973

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:28:50 +01:00
Eric Bélanger
54bad4c91d checkpkg: replace wget usage by curl
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:27:20 +01:00
Pierre Schmitz
fc95a57556 prepare release 2012-11-12 18:44:26 +01:00
Pierre Schmitz
21458bd07b For now only packages and svn from sigurd will be moved to nymeria 2012-11-11 21:07:34 +01:00
Pierre Schmitz
a05969b29d prepare release 2012-11-03 18:26:45 +01:00
Pierre Schmitz
fdeaed894a Use nymeria.archlinux.org as shared host for developers and trusted users 2012-11-03 17:32:33 +01:00
Pierre Schmitz
3699321904 Prepare release 2012-10-27 20:31:05 +02:00
Pierre Schmitz
d8ec9c9066 Use sigurd.archlinux.org instead of the now moved aur.archlinux.org hostname 2012-10-27 20:30:24 +02:00
Jan Alexander Steffens (heftig)
fbb2bd2b8e Fix return code handling
Stop trap_exit from forcing a 0 exit code. This fixes makechrootpkg,
which used to always return success, even if the build failed.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-10-27 20:27:39 +02:00
11 changed files with 52 additions and 99 deletions

View File

@@ -1,4 +1,4 @@
V=20121013 V=20130120
PREFIX = /usr/local PREFIX = /usr/local
@@ -115,6 +115,6 @@ dist:
gpg --detach-sign --use-agent devtools-$(V).tar.gz gpg --detach-sign --use-agent devtools-$(V).tar.gz
upload: upload:
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig gerolde.archlinux.org:/srv/ftp/other/devtools/ scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig nymeria.archlinux.org:/srv/ftp/other/devtools/
.PHONY: all clean install uninstall dist upload .PHONY: all clean install uninstall dist upload

View File

@@ -3,6 +3,7 @@
m4_include(lib/common.sh) m4_include(lib/common.sh)
base_packages=(base base-devel sudo) base_packages=(base base-devel sudo)
makechrootpkg_args=(-c -n)
cmd="${0##*/}" cmd="${0##*/}"
if [[ "${cmd%%-*}" == 'multilib' ]]; then if [[ "${cmd%%-*}" == 'multilib' ]]; then
@@ -18,13 +19,17 @@ chroots='/var/lib/archbuild'
clean_first=false clean_first=false
usage() { usage() {
echo "usage $cmd" echo "Usage: $cmd [options] -- [makechrootpkg args]"
echo ' -h This help'
echo ' -c Recreate the chroot before building' echo ' -c Recreate the chroot before building'
echo ' -r <dir> Create chroots in this directory' echo ' -r <dir> Create chroots in this directory'
echo ''
echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
echo ''
exit 1 exit 1
} }
while getopts 'cr:' arg; do while getopts 'hcr:' arg; do
case "${arg}" in case "${arg}" in
c) clean_first=true ;; c) clean_first=true ;;
r) chroots="$OPTARG" ;; r) chroots="$OPTARG" ;;
@@ -32,7 +37,10 @@ while getopts 'cr:' arg; do
esac esac
done done
if [[ "$EUID" != '0' ]]; then # Pass all arguments after -- right to makepkg
makechrootpkg_args=("${@:$OPTIND}")
if (( EUID )); then
die 'This script must be run as root.' die 'This script must be run as root.'
fi fi
@@ -71,4 +79,4 @@ else
fi fi
msg "Building in chroot for [${repo}] (${arch})..." msg "Building in chroot for [${repo}] (${arch})..."
exec setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}" exec setarch "${arch}" makechrootpkg "${makechrootpkg_args[@]}" -r "${chroots}/${repo}-${arch}"

View File

@@ -11,9 +11,9 @@ fi
case $scriptname in case $scriptname in
archco) archco)
SVNURL="svn+ssh://gerolde.archlinux.org/srv/svn-packages";; SVNURL="svn+ssh://svn-packages@nymeria.archlinux.org/srv/repos/svn-packages/svn";;
communityco) communityco)
SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";; SVNURL="svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";;
*) *)
die "Couldn't find svn url for $scriptname" die "Couldn't find svn url for $scriptname"
;; ;;

View File

@@ -58,7 +58,7 @@ for _pkgname in "${pkgname[@]}"; do
elif [[ -f "$STARTDIR/$oldpkg" ]]; then elif [[ -f "$STARTDIR/$oldpkg" ]]; then
ln -s "$STARTDIR/$oldpkg" "$oldpkg" ln -s "$STARTDIR/$oldpkg" "$oldpkg"
else else
wget --quiet "$pkgurl" curl -fsLC - --retry 3 --retry-delay 3 -o "$oldpkg" "$pkgurl"
fi fi
fi fi

View File

@@ -42,7 +42,7 @@ pkgbase=${pkgbase:-$pkgname}
case "$cmd" in case "$cmd" in
commitpkg) commitpkg)
if (( $# == 0 )); then if (( $# == 0 )); then
die 'usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]' die 'Usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]'
fi fi
repo="$1" repo="$1"
shift shift
@@ -51,7 +51,7 @@ case "$cmd" in
repo="${cmd%pkg}" repo="${cmd%pkg}"
;; ;;
*) *)
die 'usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]' die 'Usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]'
;; ;;
esac esac
@@ -105,15 +105,7 @@ for _arch in ${arch[@]}; do
done done
if [[ -z $server ]]; then if [[ -z $server ]]; then
case "$repo" in server='nymeria.archlinux.org'
core|extra|testing|staging|kde-unstable|gnome-unstable)
server='gerolde.archlinux.org' ;;
community*|multilib*)
server='aur.archlinux.org' ;;
*)
server='gerolde.archlinux.org'
msg "Non-standard repository $repo in use, defaulting to server $server" ;;
esac
fi fi
if [[ -n $(svn status -q) ]]; then if [[ -n $(svn status -q) ]]; then

View File

@@ -11,10 +11,10 @@ fi
pkgbase="${1}" pkgbase="${1}"
packages_svn='svn+ssh://gerolde.archlinux.org/srv/svn-packages' packages_svn='svn+ssh://svn-packages@nymeria.archlinux.org/srv/repos/svn-packages/svn'
packages_server='gerolde.archlinux.org' packages_server='nymeria.archlinux.org'
community_svn='svn+ssh://aur.archlinux.org/srv/svn-packages' community_svn='svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn'
community_server='aur.archlinux.org' community_server='nymeria.archlinux.org'
mirror='http://mirrors.kernel.org/archlinux' mirror='http://mirrors.kernel.org/archlinux'
case $scriptname in case $scriptname in
@@ -72,11 +72,23 @@ svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${targe
pushd "target_checkout/${pkgbase}/trunk" >/dev/null pushd "target_checkout/${pkgbase}/trunk" >/dev/null
archrelease "${arch[@]/#/$target_repo-}" || die archrelease "${arch[@]/#/$target_repo-}" || die
popd >/dev/null popd >/dev/null
ssh "${target_server}" '/arch/db-update' || die
if [[ "${target_server}" == "${community_server}" ]]; then
dbscripts_path='/srv/repos/svn-community/dbscripts'
else
dbscripts_path='/srv/repos/svn-packages/dbscripts'
fi
ssh "${target_server}" "${dbscripts_path}/db-update" || die
msg "Removing ${pkgbase} from ${source_repo}" msg "Removing ${pkgbase} from ${source_repo}"
if [[ "${source_server}" == "${community_server}" ]]; then
dbscripts_path='/srv/repos/svn-community/dbscripts'
else
dbscripts_path='/srv/repos/svn-packages/dbscripts'
fi
for _arch in ${arch[@]}; do for _arch in ${arch[@]}; do
ssh "${source_server}" "/arch/db-remove ${source_repo} ${_arch} ${pkgbase}" ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${pkgbase}"
done done
svn -q checkout -N "${source_svn}" source_checkout svn -q checkout -N "${source_svn}" source_checkout
svn -q up "source_checkout/${pkgbase}" svn -q up "source_checkout/${pkgbase}"

View File

@@ -8,7 +8,7 @@ m4_include(lib/common.sh)
match=$1 match=$1
if [[ -z $match ]]; then if [[ -z $match ]]; then
echo 'usage: finddeps <depname>' echo 'Usage: finddeps <depname>'
echo '' echo ''
echo 'Find packages that depend on a given depname.' echo 'Find packages that depend on a given depname.'
echo 'Run this script from the top-level directory of your ABS tree.' echo 'Run this script from the top-level directory of your ABS tree.'

View File

@@ -78,7 +78,7 @@ trap_abort() {
trap_exit() { trap_exit() {
trap - EXIT INT QUIT TERM HUP trap - EXIT INT QUIT TERM HUP
cleanup 0 cleanup
} }
die() { die() {

View File

@@ -28,7 +28,7 @@ default_copy=$USER
src_owner=${SUDO_USER:-$USER} 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'
echo ' clean chroot. All unrecognized arguments passed to this script' echo ' clean chroot. All unrecognized arguments passed to this script'
echo ' will be passed to makepkg.' echo ' will be passed to makepkg.'
@@ -161,8 +161,8 @@ if [[ -n $install_pkg ]]; then
rm "$copydir/$pkgname" rm "$copydir/$pkgname"
# Exit early, we've done all we need to # If there is no PKGBUILD we have done
exit $ret [[ -f PKGBUILD ]] || exit $ret
fi fi
$update_first && mkarchroot -u "$copydir" $update_first && mkarchroot -u "$copydir"
@@ -213,12 +213,12 @@ if ! grep -q 'SRCDEST="/srcdest"' "$copydir/etc/makepkg.conf"; then
echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf" echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf"
fi fi
if [[ -n $MAKEFLAGS ]]; then if [[ -n $MAKEFLAGS ]]; then
sed -i '/^MAKEFLAGS=/d' "$copydir/etc/makepkg.conf" sed -i '/^MAKEFLAGS=/d' "$copydir/etc/makepkg.conf"
echo "MAKEFLAGS='${MAKEFLAGS}'" >> "$copydir/etc/makepkg.conf" echo "MAKEFLAGS='${MAKEFLAGS}'" >> "$copydir/etc/makepkg.conf"
fi fi
if [[ -n $PACKAGER ]]; then if [[ -n $PACKAGER ]]; then
sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf"
echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf"
fi fi

View File

@@ -22,7 +22,7 @@ APPNAME=$(basename "${0}")
# usage: usage <exitvalue> # usage: usage <exitvalue>
usage() { usage() {
echo "usage ${APPNAME} [options] working-dir [package-list | app]" echo "Usage: ${APPNAME} [options] working-dir [package-list | app]"
echo ' options:' echo ' options:'
echo ' -r <app> Run "app" within the context of the chroot' echo ' -r <app> Run "app" within the context of the chroot'
echo ' -u Update the chroot via pacman' echo ' -u Update the chroot via pacman'
@@ -44,7 +44,7 @@ while getopts 'r:ufnhC:M:c:' arg; do
M) makepkg_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;;
n) NOCOPY='y' ;; n) NOCOPY='y' ;;
c) cache_dir="$OPTARG" ;; c) cache_dir="$OPTARG" ;;
h|?) usage 0 ;; h|?) usage ;;
*) error "invalid argument '${arg}'"; usage ;; *) error "invalid argument '${arg}'"; usage ;;
esac esac
done done
@@ -98,44 +98,6 @@ bind_mount() {
chroot_mount() { chroot_mount() {
trap 'trap_chroot_umount' EXIT INT QUIT TERM HUP trap 'trap_chroot_umount' EXIT INT QUIT TERM HUP
if (( ! have_nspawn )); then
bind_mount /sys ro
[[ -e "${working_dir}/proc" ]] || mkdir "${working_dir}/proc"
mount -t proc proc -o nosuid,noexec,nodev "${working_dir}/proc"
bind_mount /proc/sys ro
[[ -e "${working_dir}/dev" ]] || mkdir "${working_dir}/dev"
mount -t tmpfs dev "${working_dir}/dev" -o mode=0755,size=10M,nosuid,strictatime
mknod -m 666 "${working_dir}/dev/null" c 1 3
mknod -m 666 "${working_dir}/dev/zero" c 1 5
mknod -m 600 "${working_dir}/dev/console" c 5 1
mknod -m 644 "${working_dir}/dev/random" c 1 8
mknod -m 644 "${working_dir}/dev/urandom" c 1 9
mknod -m 666 "${working_dir}/dev/tty" c 5 0
mknod -m 666 "${working_dir}/dev/ptmx" c 5 2
mknod -m 666 "${working_dir}/dev/tty0" c 4 0
mknod -m 666 "${working_dir}/dev/full" c 1 7
mknod -m 666 "${working_dir}/dev/rtc0" c 254 0
ln -s /proc/kcore "${working_dir}/dev/core"
ln -s /proc/self/fd "${working_dir}/dev/fd"
ln -s /proc/self/fd/0 "${working_dir}/dev/stdin"
ln -s /proc/self/fd/1 "${working_dir}/dev/stdout"
ln -s /proc/self/fd/2 "${working_dir}/dev/stderr"
[[ -e "${working_dir}/dev/shm" ]] || mkdir "${working_dir}/dev/shm"
mount -t tmpfs shm "${working_dir}/dev/shm" -o nodev,nosuid,size=128M
bind_mount /dev/pts
[[ -e "${working_dir}/run" ]] || mkdir "${working_dir}/run"
mount -t tmpfs tmpfs "${working_dir}/run" -o mode=0755,nodev,nosuid,strictatime,size=64M
for host_config in resolv.conf localtime; do
bind_mount /etc/$host_config ro
done
fi
[[ -n $host_mirror_path ]] && bind_mount "$host_mirror_path" ro [[ -n $host_mirror_path ]] && bind_mount "$host_mirror_path" ro
bind_mount "${cache_dirs[0]}" bind_mount "${cache_dirs[0]}"
@@ -160,25 +122,13 @@ copy_hostconf () {
} }
trap_chroot_umount () { trap_chroot_umount () {
trap 'trap_exit' EXIT INT QUIT TERM HUP trap 'trap_abort' INT QUIT TERM HUP
trap 'trap_exit' EXIT
for cache_dir in ${cache_dirs[@]}; do for cache_dir in ${cache_dirs[@]}; do
umount "${working_dir}/${cache_dir}" umount "${working_dir}/${cache_dir}"
done done
[[ -n $host_mirror_path ]] && umount "${working_dir}/${host_mirror_path}" [[ -n $host_mirror_path ]] && umount "${working_dir}/${host_mirror_path}"
if (( ! have_nspawn )); then
for host_config in resolv.conf localtime; do
umount "${working_dir}/etc/${host_config}"
done
umount "${working_dir}/proc/sys"
umount "${working_dir}/proc"
umount "${working_dir}/sys"
umount "${working_dir}/dev/pts"
umount "${working_dir}/dev/shm"
umount "${working_dir}/dev"
umount "${working_dir}/run"
fi
} }
chroot_lock () { chroot_lock () {
@@ -198,20 +148,11 @@ chroot_lock () {
chroot_run() { chroot_run() {
local dir=$1 local dir=$1
shift shift
if (( have_nspawn)); then eval systemd-nspawn -D "${dir}" -- ${@} 2>/dev/null
eval systemd-nspawn -D "${dir}" -- ${@} 2>/dev/null
else
eval unshare -mui -- chroot "${dir}" ${@}
fi
} }
# }}} # }}}
# use systemd-nspawn if we have it available and systemd is running
if type -P systemd-nspawn >/dev/null && mountpoint -q /sys/fs/cgroup/systemd; then
have_nspawn=1
fi
umask 0022 umask 0022
if [[ -n $RUN ]]; then if [[ -n $RUN ]]; then
# run chroot {{{ # run chroot {{{

View File

@@ -12,7 +12,7 @@
m4_include(lib/common.sh) m4_include(lib/common.sh)
if (( $# < 1 )); then if (( $# < 1 )); then
echo "usage: $(basename $0) <chrootdir> <packages to rebuild>" echo "Usage: $(basename $0) <chrootdir> <packages to rebuild>"
echo " example: $(basename $0) ~/chroot readline bash foo bar baz" echo " example: $(basename $0) ~/chroot readline bash foo bar baz"
exit 1 exit 1
fi fi
@@ -47,7 +47,7 @@ pkg_from_pkgbuild() {
chrootdir="$1"; shift chrootdir="$1"; shift
pkgs="$@" pkgs="$@"
SVNPATH='svn+ssh://gerolde.archlinux.org/srv/svn-packages' SVNPATH='svn+ssh://nymeria.archlinux.org/srv/repos/svn-packages/svn'
msg "Work will be done in $(pwd)/rebuilds" msg "Work will be done in $(pwd)/rebuilds"