From fb71ad1e7fe24edcc142b8643f311c28073c5c03 Mon Sep 17 00:00:00 2001 From: Sébastien Luttringer Date: Wed, 2 Jan 2013 01:42:44 +0100 Subject: Allow makechroot options in archbuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Pierre Schmitz --- archbuild.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/archbuild.in b/archbuild.in index 10d33b8..44288df 100644 --- a/archbuild.in +++ b/archbuild.in @@ -3,6 +3,7 @@ m4_include(lib/common.sh) base_packages=(base base-devel sudo) +makechrootpkg_args=(-c -n) cmd="${0##*/}" if [[ "${cmd%%-*}" == 'multilib' ]]; then @@ -18,13 +19,17 @@ chroots='/var/lib/archbuild' clean_first=false usage() { - echo "Usage: $cmd" + echo "Usage: $cmd [options] -- [makechrootpkg args]" + echo ' -h This help' echo ' -c Recreate the chroot before building' echo ' -r Create chroots in this directory' + echo '' + echo "Default makechrootpkg args: ${makechrootpkg_args[*]}" + echo '' exit 1 } -while getopts 'cr:' arg; do +while getopts 'hcr:' arg; do case "${arg}" in c) clean_first=true ;; r) chroots="$OPTARG" ;; @@ -32,7 +37,10 @@ while getopts 'cr:' arg; do esac 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.' fi @@ -71,4 +79,4 @@ else fi 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}" -- cgit v1.2.3-70-g09d2 From cb3a6ce1e8a146d32f52013fd568fb99692d95f6 Mon Sep 17 00:00:00 2001 From: Sébastien Luttringer Date: Wed, 2 Jan 2013 01:42:45 +0100 Subject: -I ends early if there is nothing to build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allow to build in one shot a package depending of a missing package Signed-off-by: Sébastien Luttringer Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 762ad7b..fb91100 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -161,8 +161,8 @@ if [[ -n $install_pkg ]]; then rm "$copydir/$pkgname" - # Exit early, we've done all we need to - exit $ret + # If there is no PKGBUILD we have done + [[ -f PKGBUILD ]] || exit $ret fi $update_first && mkarchroot -u "$copydir" -- cgit v1.2.3-70-g09d2 From 9cef7e0a9ef7b2431028a441f5a23d41447931ec Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 20 Jan 2013 17:55:00 +0100 Subject: Use nymeria instead of gerolde --- Makefile | 4 ++-- archco.in | 2 +- commitpkg.in | 10 +--------- crossrepomove.in | 8 ++++---- rebuildpkgs.in | 2 +- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 931318b..3232773 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20121115 +V=20130120 PREFIX = /usr/local @@ -115,6 +115,6 @@ dist: gpg --detach-sign --use-agent devtools-$(V).tar.gz 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 diff --git a/archco.in b/archco.in index 5d497cc..1ee977e 100644 --- a/archco.in +++ b/archco.in @@ -11,7 +11,7 @@ fi case $scriptname in archco) - SVNURL="svn+ssh://gerolde.archlinux.org/srv/svn-packages";; + SVNURL="svn+ssh://svn-packages@nymeria.archlinux.org/srv/repos/svn-packages/svn";; communityco) SVNURL="svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";; *) diff --git a/commitpkg.in b/commitpkg.in index d9ee0aa..db78517 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -105,15 +105,7 @@ for _arch in ${arch[@]}; do done if [[ -z $server ]]; then - case "$repo" in - 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 + server='nymeria.archlinux.org' fi if [[ -n $(svn status -q) ]]; then diff --git a/crossrepomove.in b/crossrepomove.in index 8794326..653c8ee 100644 --- a/crossrepomove.in +++ b/crossrepomove.in @@ -11,8 +11,8 @@ fi pkgbase="${1}" -packages_svn='svn+ssh://gerolde.archlinux.org/srv/svn-packages' -packages_server='gerolde.archlinux.org' +packages_svn='svn+ssh://svn-packages@nymeria.archlinux.org/srv/repos/svn-packages/svn' +packages_server='nymeria.archlinux.org' community_svn='svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn' community_server='nymeria.archlinux.org' mirror='http://mirrors.kernel.org/archlinux' @@ -76,7 +76,7 @@ popd >/dev/null if [[ "${target_server}" == "${community_server}" ]]; then dbscripts_path='/srv/repos/svn-community/dbscripts' else - dbscripts_path='/arch' + dbscripts_path='/srv/repos/svn-packages/dbscripts' fi ssh "${target_server}" "${dbscripts_path}/db-update" || die @@ -85,7 +85,7 @@ msg "Removing ${pkgbase} from ${source_repo}" if [[ "${source_server}" == "${community_server}" ]]; then dbscripts_path='/srv/repos/svn-community/dbscripts' else - dbscripts_path='/arch' + dbscripts_path='/srv/repos/svn-packages/dbscripts' fi for _arch in ${arch[@]}; do ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${pkgbase}" diff --git a/rebuildpkgs.in b/rebuildpkgs.in index a4c8969..2f71c40 100644 --- a/rebuildpkgs.in +++ b/rebuildpkgs.in @@ -47,7 +47,7 @@ pkg_from_pkgbuild() { chrootdir="$1"; shift 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" -- cgit v1.2.3-70-g09d2 From 10eba28151b1bf3ca5c29ccfb524f0cb85958c1d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 22 Jan 2013 20:12:36 +0100 Subject: archbuild: fix default build flags --- Makefile | 2 +- archbuild.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3232773..f730f75 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20130120 +V=20130122 PREFIX = /usr/local diff --git a/archbuild.in b/archbuild.in index 44288df..4054de7 100644 --- a/archbuild.in +++ b/archbuild.in @@ -38,7 +38,7 @@ while getopts 'hcr:' arg; do done # Pass all arguments after -- right to makepkg -makechrootpkg_args=("${@:$OPTIND}") +makechrootpkg_args+=("${@:$OPTIND}") if (( EUID )); then die 'This script must be run as root.' -- cgit v1.2.3-70-g09d2 From dee4d05b1ea4533979933d32953ffa4481c6c66e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 27 Jan 2013 17:04:26 +0100 Subject: Fix crossrepomove for use on nymeria --- Makefile | 2 +- crossrepomove.in | 42 ++++++++++++++---------------------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index f730f75..f0f374a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20130122 +V=20130127 PREFIX = /usr/local diff --git a/crossrepomove.in b/crossrepomove.in index 653c8ee..b1204af 100644 --- a/crossrepomove.in +++ b/crossrepomove.in @@ -11,26 +11,16 @@ fi pkgbase="${1}" -packages_svn='svn+ssh://svn-packages@nymeria.archlinux.org/srv/repos/svn-packages/svn' -packages_server='nymeria.archlinux.org' -community_svn='svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn' -community_server='nymeria.archlinux.org' -mirror='http://mirrors.kernel.org/archlinux' - case $scriptname in extra2community) - source_svn="${packages_svn}" - target_svn="${community_svn}" - source_server="${packages_server}" - target_server="${community_server}" + source_name='packages' + target_name='community' source_repo='extra' target_repo='community' ;; community2extra) - source_svn="${community_svn}" - target_svn="${packages_svn}" - source_server="${community_server}" - target_server="${packages_server}" + source_name='community' + target_name='packages' source_repo='community' target_repo='extra' ;; @@ -39,6 +29,13 @@ case $scriptname in ;; esac +server='nymeria.archlinux.org' +mirror="http://${server}" +source_svn="svn+ssh://svn-${source_name}@${server}/srv/repos/svn-${source_name}/svn" +target_svn="svn+ssh://svn-${target_name}@${server}/srv/repos/svn-${target_name}/svn" +source_dbscripts="/srv/repos/svn-${source_name}/dbscripts" +target_dbscripts="/srv/repos/svn-${target_name}/dbscripts" + setup_workdir pushd $WORKDIR >/dev/null @@ -59,7 +56,7 @@ for _arch in ${arch[@]}; do for _pkgname in ${pkgname[@]}; do fullver=$(get_full_version $_pkgname) # FIXME: this only works with .xz packages - ssh "${target_server}" "cd staging/${target_repo} + ssh "${server}" "cd staging/${target_repo} curl -O ${mirror}/${source_repo}/os/${repo_arch}/$_pkgname-$fullver-${_arch}.pkg.tar.xz curl -O ${mirror}/${source_repo}/os/${repo_arch}/$_pkgname-$fullver-${_arch}.pkg.tar.xz.sig" || die done @@ -73,22 +70,11 @@ pushd "target_checkout/${pkgbase}/trunk" >/dev/null archrelease "${arch[@]/#/$target_repo-}" || die popd >/dev/null -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 +ssh "${server}" "${target_dbscripts}/db-update" || die 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 - ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${pkgbase}" + ssh "${server}" "${source_dbscripts}/db-remove ${source_repo} ${_arch} ${pkgbase}" done svn -q checkout -N "${source_svn}" source_checkout svn -q up "source_checkout/${pkgbase}" -- cgit v1.2.3-70-g09d2 From 280d5501b00945fdf4e8de13724ec22b87a41576 Mon Sep 17 00:00:00 2001 From: Sébastien Luttringer Date: Sat, 2 Mar 2013 05:21:08 +0100 Subject: makechrootpkg: -I to handle multiple packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit cb3a6ce, running makechroot 2 times to insert a package in a build directory require to find a directory without PKGBUILD cd /var/empty makechrootpkg -cu -I virtualbox-host-dkms-*-i686.pkg.tar.xz -r makechrootpkg -I virtualbox-host-dkms-*-i686.pkg.tar.xz -r cd - makechrootpkg -n -r This patch allow makechrootpkg to handle more than one package to be installed before the build is run and simplify the previous case in makechrootpkg -ncu -I virtualbox-host-dkms-*-i686.pkg.tar.xz -I virtualbox-guest-dkms-*-i686.pkg.tar.xz -r Signed-off-by: Sébastien Luttringer Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index fb91100..9021b3e 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -21,6 +21,7 @@ add_to_db=false run_namcap=false chrootdir= passeddir= +declare -a install_pkgs default_copy=$USER [[ -n $SUDO_USER ]] && default_copy=$SUDO_USER @@ -66,7 +67,7 @@ while getopts 'hcudr:I:l:n' arg; do u) update_first=true ;; d) add_to_db=true ;; r) passeddir="$OPTARG" ;; - I) install_pkg="$OPTARG" ;; + I) install_pkgs+=("$OPTARG") ;; l) copy="$OPTARG" ;; n) run_namcap=true; makepkg_args="$makepkg_args -i" ;; *) makepkg_args="$makepkg_args -$arg $OPTARG" ;; @@ -98,7 +99,7 @@ if (( EUID )); then die 'This script must be run as root.' fi -if [[ ! -f PKGBUILD && -z $install_pkg ]]; then +if [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]]; then die 'This must be run in a directory containing a PKGBUILD.' fi @@ -152,14 +153,17 @@ if [[ ! -d $copydir ]] || $clean_first; then exec 8>&- fi -if [[ -n $install_pkg ]]; then - pkgname="${install_pkg##*/}" - cp "$install_pkg" "$copydir/$pkgname" +if [[ -n "${install_pkgs[*]}" ]]; then + declare -i ret=0 + for install_pkg in "${install_pkgs[@]}"; do + pkgname="${install_pkg##*/}" + cp "$install_pkg" "$copydir/$pkgname" - mkarchroot -r "pacman -U /$pkgname --noconfirm" "$copydir" - ret=$? + mkarchroot -r "pacman -U /$pkgname --noconfirm" "$copydir" + (( ret += !! $? )) - rm "$copydir/$pkgname" + rm "$copydir/$pkgname" + done # If there is no PKGBUILD we have done [[ -f PKGBUILD ]] || exit $ret -- cgit v1.2.3-70-g09d2