Compare commits

...

6 Commits

Author SHA1 Message Date
Pierre Schmitz
10eba28151 archbuild: fix default build flags 2013-01-22 20:12:36 +01:00
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
9 changed files with 30 additions and 90 deletions

View File

@@ -1,4 +1,4 @@
V=20121115 V=20130122
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,7 +11,7 @@ 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://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";; SVNURL="svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";;
*) *)

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='nymeria.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,8 +11,8 @@ 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://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn' community_svn='svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn'
community_server='nymeria.archlinux.org' community_server='nymeria.archlinux.org'
mirror='http://mirrors.kernel.org/archlinux' mirror='http://mirrors.kernel.org/archlinux'
@@ -76,7 +76,7 @@ popd >/dev/null
if [[ "${target_server}" == "${community_server}" ]]; then if [[ "${target_server}" == "${community_server}" ]]; then
dbscripts_path='/srv/repos/svn-community/dbscripts' dbscripts_path='/srv/repos/svn-community/dbscripts'
else else
dbscripts_path='/arch' dbscripts_path='/srv/repos/svn-packages/dbscripts'
fi fi
ssh "${target_server}" "${dbscripts_path}/db-update" || die ssh "${target_server}" "${dbscripts_path}/db-update" || die
@@ -85,7 +85,7 @@ msg "Removing ${pkgbase} from ${source_repo}"
if [[ "${source_server}" == "${community_server}" ]]; then if [[ "${source_server}" == "${community_server}" ]]; then
dbscripts_path='/srv/repos/svn-community/dbscripts' dbscripts_path='/srv/repos/svn-community/dbscripts'
else else
dbscripts_path='/arch' dbscripts_path='/srv/repos/svn-packages/dbscripts'
fi fi
for _arch in ${arch[@]}; do for _arch in ${arch[@]}; do
ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${pkgbase}" ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${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

@@ -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"

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'
@@ -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]}"
@@ -167,19 +129,6 @@ trap_chroot_umount () {
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 () {
@@ -199,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"