From 75deac81c2ca88219a4bc31d4a9a3da4f8274863 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 10 Jun 2012 12:28:38 +0200 Subject: Make repositories for testing2x configurable --- config | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config b/config index 4abddd5..44bfccc 100644 --- a/config +++ b/config @@ -3,6 +3,8 @@ SVNREPO='' PKGREPOS=() PKGPOOL='' SRCPOOL='' +TESTING_REPO='' +STABLE_REPOS=() CLEANUP_DESTDIR="/srv/package-cleanup" CLEANUP_DRYRUN=false -- cgit v1.2.3-54-g00ecf From b2952784db9995ecc21d3a770530a19394234d3b Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Oct 2012 14:32:39 +0200 Subject: Add the possibility to run all svn commands with a different user * A SVNUSER can be configured in the config file * This user needs to be able to call svn without a password --- config | 1 + config.local.gerolde | 1 + config.local.sigurd | 1 + cron-jobs/sourceballs | 2 +- db-functions | 12 ++++++++++-- db-move | 18 +++++++++--------- db-remove | 6 +++--- test/lib/common.inc | 14 +++++++------- test/test.d/db-update.sh | 4 ++-- test/test.d/testing2x.sh | 2 +- testing2x | 2 +- 11 files changed, 37 insertions(+), 26 deletions(-) (limited to 'config') diff --git a/config b/config index 44bfccc..9e3041c 100644 --- a/config +++ b/config @@ -1,5 +1,6 @@ FTP_BASE="/srv/ftp" SVNREPO='' +SVNUSER='' PKGREPOS=() PKGPOOL='' SRCPOOL='' diff --git a/config.local.gerolde b/config.local.gerolde index 5e16b76..f19eeec 100644 --- a/config.local.gerolde +++ b/config.local.gerolde @@ -2,5 +2,6 @@ PKGREPOS=('core' 'extra' 'testing' 'staging' 'kde-unstable' 'gnome-unstable') PKGPOOL='pool/packages' SRCPOOL='sources/packages' SVNREPO='file:///srv/svn-packages' +SVNUSER='' TESTING_REPO='testing' STABLE_REPOS=('core' 'extra') diff --git a/config.local.sigurd b/config.local.sigurd index 4f95bd2..afd5cba 100644 --- a/config.local.sigurd +++ b/config.local.sigurd @@ -2,5 +2,6 @@ PKGREPOS=('community' 'community-testing' 'community-staging' 'multilib' 'multil PKGPOOL='pool/community' SRCPOOL='sources/community' SVNREPO='file:///srv/svn-packages' +SVNUSER='' TESTING_REPO='community-testing' STABLE_REPOS=('community') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index aee3e02..5d2b086 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -79,7 +79,7 @@ for repo in ${PKGREPOS[@]}; do # Get the sources from svn mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ + arch_svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" diff --git a/db-functions b/db-functions index e3485d3..b9d0d2f 100644 --- a/db-functions +++ b/db-functions @@ -347,7 +347,7 @@ check_pkgsvn() { if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" - svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ + arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null [ $? -ge 1 ] && return 1 fi @@ -382,7 +382,7 @@ check_splitpkgs() { if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" - svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ + arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null [ $? -ge 1 ] && return 1 fi @@ -504,3 +504,11 @@ arch_repo_remove() { || error "repo-remove ${filesfile} ${pkgs[@]}" set_repo_permission "${repo}" "${arch}" } + +arch_svn() { + if [ -z "${SVNUSER}" ]; then + /usr/bin/svn "${@}" + else + sudo -u "${SVNUSER}" -- /usr/bin/svn "${@}" + fi +} diff --git a/db-move b/db-move index 1a89ded..1fa44d4 100755 --- a/db-move +++ b/db-move @@ -25,9 +25,9 @@ for pkgarch in ${ARCHES[@]}; do done # check if packages to be moved exist in svn and ftp dir -/usr/bin/svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null +arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null for pkgbase in ${args[@]:2}; do - /usr/bin/svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null + arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null for pkgarch in ${ARCHES[@]} 'any'; do svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}" if [ -r "${svnrepo_from}/PKGBUILD" ]; then @@ -79,18 +79,18 @@ for pkgbase in ${args[@]:2}; do pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) if [ -d "${svnrepo_to}" ]; then - for file in $(/usr/bin/svn ls "${svnrepo_to}"); do - /usr/bin/svn rm -q "${svnrepo_to}/$file@" + for file in $(arch_svn ls "${svnrepo_to}"); do + arch_svn rm -q "${svnrepo_to}/$file@" done else mkdir "${svnrepo_to}" - /usr/bin/svn add -q "${svnrepo_to}" + arch_svn add -q "${svnrepo_to}" fi - for file in $(svn ls "${svnrepo_from}"); do - /usr/bin/svn mv -q -r HEAD "${svnrepo_from}/$file@" "${svnrepo_to}/" + for file in $(arch_svn ls "${svnrepo_from}"); do + arch_svn mv -q -r HEAD "${svnrepo_from}/$file@" "${svnrepo_to}/" done - /usr/bin/svn rm --force -q "${svnrepo_from}" + arch_svn rm --force -q "${svnrepo_from}" tag_list="$tag_list, $pkgarch" for pkgname in ${pkgnames[@]}; do @@ -109,7 +109,7 @@ for pkgbase in ${args[@]:2}; do fi done tag_list="${tag_list#, }" - /usr/bin/svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})" + arch_svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})" done for tarch in ${ARCHES[@]}; do diff --git a/db-remove b/db-remove index da32c78..25cb9a7 100755 --- a/db-remove +++ b/db-remove @@ -32,12 +32,12 @@ done remove_pkgs=() for pkgbase in ${pkgbases[@]}; do msg "Removing $pkgbase from [$repo]..." - /usr/bin/svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null + arch_svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null if [ -d "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" ]; then remove_pkgs=(${remove_pkgs[@]} $(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) - /usr/bin/svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" - /usr/bin/svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" + arch_svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" + arch_svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" else warning "$pkgbase not found in $svnrepo" warning "Removing only $pkgbase from the repo" diff --git a/test/lib/common.inc b/test/lib/common.inc index 35cdaee..aeceece 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -91,14 +91,14 @@ setUp() { msg 'Creating svn repository...' svnadmin create "${TMP}/svn-packages-repo" - svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy" + arch_svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy" for p in "${pkgdir}"/*; do pkg=${p##*/} mkdir -p "${TMP}/svn-packages-copy/${pkg}"/{trunk,repos} cp "${p}"/* "${TMP}/svn-packages-copy"/${pkg}/trunk/ - svn add -q "${TMP}/svn-packages-copy"/${pkg} - svn commit -q -m"initial commit of ${pkg}" "${TMP}/svn-packages-copy" + arch_svn add -q "${TMP}/svn-packages-copy"/${pkg} + arch_svn commit -q -m"initial commit of ${pkg}" "${TMP}/svn-packages-copy" done cat < "$(dirname ${BASH_SOURCE[0]})/../../config.local" @@ -189,7 +189,7 @@ checkAnyPackage() { checkAnyPackageDB $repo $pkg local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" + arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}" [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ || fail "svn-packages-copy/${pkgbase}/repos/${repo}-any does not exist" } @@ -231,7 +231,7 @@ checkPackage() { checkPackageDB $repo $pkg $arch local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" + arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}" [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ || fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} does not exist" } @@ -256,7 +256,7 @@ checkRemovedPackage() { checkRemovedPackageDB $repo $pkgbase $arch - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" + arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}" [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ && fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} should not exist" } @@ -282,7 +282,7 @@ checkRemovedAnyPackage() { checkRemovedAnyPackageDB $repo $pkgbase - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" + arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}" [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ && fail "svn-packages-copy/${pkgbase}/repos/${repo}-any should not exist" } diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 67bca9f..ea1e130 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -81,7 +81,7 @@ testUpdateAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD - svn commit -q -m"update pkg to pkgrel=2" >/dev/null + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -99,7 +99,7 @@ testUpdateAnyPackageToDifferentRepositoriesAtOnce() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD - svn commit -q -m"update pkg to pkgrel=2" >/dev/null + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 357f3c2..31d85b4 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -9,7 +9,7 @@ testTesting2xAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD - svn commit -q -m"update pkg to pkgrel=2" >/dev/null + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/testing2x b/testing2x index a05cb53..369857f 100755 --- a/testing2x +++ b/testing2x @@ -20,7 +20,7 @@ declare -A pkgs for pkgbase in $*; do if [ ! -d "${WORKDIR}/${pkgbase}" ]; then - /usr/bin/svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null + arch_svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null found_source=false for pkgarch in ${ARCHES[@]} 'any'; do -- cgit v1.2.3-54-g00ecf From bef62b16c5e79bc81c8e37465477755690dc54cf Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Nov 2012 17:52:06 +0100 Subject: Adjust configuration for use on nymeria.archlinux.org --- config | 6 +++--- config.local.gerolde | 7 ------- config.local.sigurd | 7 ------- config.local.svn-community | 11 +++++++++++ config.local.svn-packages | 11 +++++++++++ 5 files changed, 25 insertions(+), 17 deletions(-) delete mode 100644 config.local.gerolde delete mode 100644 config.local.sigurd create mode 100644 config.local.svn-community create mode 100644 config.local.svn-packages (limited to 'config') diff --git a/config b/config index 9e3041c..3df6c95 100644 --- a/config +++ b/config @@ -7,12 +7,12 @@ SRCPOOL='' TESTING_REPO='' STABLE_REPOS=() -CLEANUP_DESTDIR="/srv/package-cleanup" +CLEANUP_DESTDIR="/var/tmp" CLEANUP_DRYRUN=false # Time in days to keep moved packages CLEANUP_KEEP=30 -SOURCE_CLEANUP_DESTDIR="/srv/source-cleanup" +SOURCE_CLEANUP_DESTDIR="/var/tmp" SOURCE_CLEANUP_DRYRUN=false # Time in days to keep moved sourcepackages SOURCE_CLEANUP_KEEP=14 @@ -23,7 +23,7 @@ LOCK_DELAY=10 LOCK_TIMEOUT=300 STAGING="$HOME/staging" -TMPDIR="/srv/tmp" +TMPDIR="/var/tmp" ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" diff --git a/config.local.gerolde b/config.local.gerolde deleted file mode 100644 index f19eeec..0000000 --- a/config.local.gerolde +++ /dev/null @@ -1,7 +0,0 @@ -PKGREPOS=('core' 'extra' 'testing' 'staging' 'kde-unstable' 'gnome-unstable') -PKGPOOL='pool/packages' -SRCPOOL='sources/packages' -SVNREPO='file:///srv/svn-packages' -SVNUSER='' -TESTING_REPO='testing' -STABLE_REPOS=('core' 'extra') diff --git a/config.local.sigurd b/config.local.sigurd deleted file mode 100644 index afd5cba..0000000 --- a/config.local.sigurd +++ /dev/null @@ -1,7 +0,0 @@ -PKGREPOS=('community' 'community-testing' 'community-staging' 'multilib' 'multilib-testing' 'multilib-staging') -PKGPOOL='pool/community' -SRCPOOL='sources/community' -SVNREPO='file:///srv/svn-packages' -SVNUSER='' -TESTING_REPO='community-testing' -STABLE_REPOS=('community') diff --git a/config.local.svn-community b/config.local.svn-community new file mode 100644 index 0000000..105ea66 --- /dev/null +++ b/config.local.svn-community @@ -0,0 +1,11 @@ +PKGREPOS=('community' 'community-testing' 'community-staging' 'multilib' 'multilib-testing' 'multilib-staging') +PKGPOOL='pool/community' +SRCPOOL='sources/community' +SVNREPO='file:///srv/repos/svn-community/svn' +SVNUSER='svn-community' +TESTING_REPO='community-testing' +STABLE_REPOS=('community') + +CLEANUP_DESTDIR="/srv/repos/svn-community/package-cleanup" +SOURCE_CLEANUP_DESTDIR="/srv/repos/svn-community/source-cleanup" +TMPDIR="/srv/repos/svn-community/tmp" diff --git a/config.local.svn-packages b/config.local.svn-packages new file mode 100644 index 0000000..958a483 --- /dev/null +++ b/config.local.svn-packages @@ -0,0 +1,11 @@ +PKGREPOS=('core' 'extra' 'testing' 'staging' 'kde-unstable' 'gnome-unstable') +PKGPOOL='pool/packages' +SRCPOOL='sources/packages' +SVNREPO='file:///srv/repos/svn-packages/svn' +SVNUSER='svn-packages' +TESTING_REPO='testing' +STABLE_REPOS=('core' 'extra') + +CLEANUP_DESTDIR="/srv/repos/svn-packages/package-cleanup" +SOURCE_CLEANUP_DESTDIR="/srv/repos/svn-packages/source-cleanup" +TMPDIR="/srv/repos/svn-packages/tmp" -- cgit v1.2.3-54-g00ecf From 33b8cb611363102e23972cf3914a03d65cb3cad8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 17 Jun 2013 23:59:15 -0600 Subject: use xbs, not svn --- config | 2 -- cron-jobs/sourceballs | 4 ++-- db-functions | 49 +++++++++++-------------------------------------- db-move | 48 ++++++++++++++---------------------------------- db-remove | 15 +++++---------- db-update | 4 ++-- test/lib/common.inc | 15 ++++++++++++++- testing2x | 10 ++++------ 8 files changed, 52 insertions(+), 95 deletions(-) (limited to 'config') diff --git a/config b/config index 3df6c95..e1e705b 100644 --- a/config +++ b/config @@ -1,6 +1,4 @@ FTP_BASE="/srv/ftp" -SVNREPO='' -SVNUSER='' PKGREPOS=() PKGPOOL='' SRCPOOL='' diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 6f75ccc..9572a30 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -77,9 +77,9 @@ for repo in ${PKGREPOS[@]}; do continue fi - # Get the sources from svn + # Get the sources from xbs mkdir -p -m0770 "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - arch_svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ + cp -a "$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" \ "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" diff --git a/db-functions b/db-functions index 523e872..c98b26f 100644 --- a/db-functions +++ b/db-functions @@ -17,11 +17,6 @@ restore_umask () { # set up general environment WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX") -if [ -n "${SVNUSER}" ]; then - setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}" - setfacl -m d:u:"${USER}":rwx "${WORKDIR}" - setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}" -fi LOCKS=() # Used: plain, msg, msg2, warning, error, in_array @@ -292,7 +287,7 @@ check_pkgfile() { fi } -check_pkgsvn() { +check_pkgxbs() { local pkgfile="${1}" local _pkgbase="$(getpkgbase ${pkgfile})" [ $? -ge 1 ] && return 1 @@ -306,18 +301,11 @@ check_pkgsvn() { in_array "${repo}" ${PKGREPOS[@]} || return 1 - if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then - mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" - arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ - "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null - [ $? -ge 1 ] && return 1 - fi - - local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) )" - [ "${svnver}" == "${_pkgver}" ] || return 1 + local xbsver="$(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) )" + [ "${xbsver}" == "${_pkgver}" ] || return 1 - local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo ${pkgname[@]})) - in_array "${_pkgname}" ${svnnames[@]} || return 1 + local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo ${pkgname[@]})) + in_array "${_pkgname}" ${xbsnames[@]} || return 1 return 0 } @@ -328,7 +316,7 @@ check_splitpkgs() { local pkgfiles=(${@}) local pkgfile local pkgdir - local svnname + local xbsname mkdir -p "${WORKDIR}/check_splitpkgs/" pushd "${WORKDIR}/check_splitpkgs" >/dev/null @@ -341,16 +329,9 @@ check_splitpkgs() { mkdir -p "${repo}/${_pkgarch}/${_pkgbase}" echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging" - if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then - mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" - arch_svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \ - "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null - [ $? -ge 1 ] && return 1 - fi - - local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo ${pkgname[@]})) - for svnname in ${svnnames[@]}; do - echo "${svnname}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn" + local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo ${pkgname[@]})) + for xbsname in ${xbsnames[@]}; do + echo "${xbsname}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs" done done popd >/dev/null @@ -358,8 +339,8 @@ check_splitpkgs() { for pkgdir in "${WORKDIR}/check_splitpkgs/${repo}"/*/*; do [ ! -d "${pkgdir}" ] && continue sort -u "${pkgdir}/staging" -o "${pkgdir}/staging" - sort -u "${pkgdir}/svn" -o "${pkgdir}/svn" - if [ ! -z "$(comm -13 "${pkgdir}/staging" "${pkgdir}/svn")" ]; then + sort -u "${pkgdir}/xbs" -o "${pkgdir}/xbs" + if [ ! -z "$(comm -13 "${pkgdir}/staging" "${pkgdir}/xbs")" ]; then return 1 fi done @@ -465,11 +446,3 @@ arch_repo_remove() { || error "repo-remove ${filesfile} ${pkgs[@]}" set_repo_permission "${repo}" "${arch}" } - -arch_svn() { - if [ -z "${SVNUSER}" ]; then - /usr/bin/svn "${@}" - else - sudo -u "${SVNUSER}" -- /usr/bin/svn --username "${USER}" "${@}" - fi -} diff --git a/db-move b/db-move index 1fa44d4..045f33c 100755 --- a/db-move +++ b/db-move @@ -24,19 +24,17 @@ for pkgarch in ${ARCHES[@]}; do repo_lock ${repo_from} ${pkgarch} || exit 1 done -# check if packages to be moved exist in svn and ftp dir -arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null +# check if packages to be moved exist in xbs and ftp dir for pkgbase in ${args[@]:2}; do - arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null for pkgarch in ${ARCHES[@]} 'any'; do - svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}" - if [ -r "${svnrepo_from}/PKGBUILD" ]; then - pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]})) + xbsrepo_from="$(xbs releasepath ${pkgbase} ${repo_from} ${pkgarch})" + if [ -r "${xbsrepo_from}/PKGBUILD" ]; then + pkgnames=($(. "${xbsrepo_from}/PKGBUILD"; echo ${pkgname[@]})) if [ ${#pkgnames[@]} -lt 1 ]; then die "Could not read pkgname" fi - pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) + pkgver=$(. "${xbsrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) if [ -z "${pkgver}" ]; then die "Could not read pkgver" fi @@ -63,35 +61,19 @@ msg "Moving packages from [${repo_from}] to [${repo_to}]..." declare -A add_pkgs declare -A remove_pkgs for pkgbase in ${args[@]:2}; do - tag_list="" - for pkgarch in ${ARCHES[@]} 'any'; do - svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}" - svnrepo_to="${WORKDIR}/svn/${pkgbase}/repos/${repo_to}-${pkgarch}" - - if [ -f "${svnrepo_from}/PKGBUILD" ]; then + # move the package in xbs + arches=($(xbs move ${repo_from} ${repo_to} ${pkgbase})) + # move the package in ftp + for pkgarch in ${arches[@]}; do + dir_to="$(xbs releasepath $pkgbase $repo_to $pkgarch)" + if true; then # to add in indent level to make merging easier if [ "${pkgarch}" == 'any' ]; then - tarches=(${ARCHES[@]}) + tarches=("${ARCHES[@]}") else tarches=("${pkgarch}") fi - msg2 "${pkgbase} ($(echo ${tarches[@]}))" - pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]})) - pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) - - if [ -d "${svnrepo_to}" ]; then - for file in $(arch_svn ls "${svnrepo_to}"); do - arch_svn rm -q "${svnrepo_to}/$file@" - done - else - mkdir "${svnrepo_to}" - arch_svn add -q "${svnrepo_to}" - fi - - for file in $(arch_svn ls "${svnrepo_from}"); do - arch_svn mv -q -r HEAD "${svnrepo_from}/$file@" "${svnrepo_to}/" - done - arch_svn rm --force -q "${svnrepo_from}" - tag_list="$tag_list, $pkgarch" + pkgnames=($(. "${dir_to}/PKGBUILD"; echo ${pkgname[@]})) + pkgver=$(. "${dir_to}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) for pkgname in ${pkgnames[@]}; do for tarch in ${tarches[@]}; do @@ -108,8 +90,6 @@ for pkgbase in ${args[@]:2}; do done fi done - tag_list="${tag_list#, }" - arch_svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})" done for tarch in ${ARCHES[@]}; do diff --git a/db-remove b/db-remove index 25cb9a7..e632c47 100755 --- a/db-remove +++ b/db-remove @@ -12,9 +12,6 @@ repo="$1" arch="$2" pkgbases=(${@:3}) -ftppath="$FTP_BASE/$repo/os" -svnrepo="$repo-$arch" - if ! check_repo_permission $repo; then die "You don't have permission to remove packages from ${repo}" fi @@ -32,14 +29,12 @@ done remove_pkgs=() for pkgbase in ${pkgbases[@]}; do msg "Removing $pkgbase from [$repo]..." - arch_svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null - - if [ -d "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" ]; then - remove_pkgs=(${remove_pkgs[@]} $(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) - arch_svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" - arch_svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" + path="$(xbs releasepath "$pkgbase" "$repo" "$arch")" + if [ -d "$path" ]; then + remove_pkgs+=($(. "$path/PKGBUILD"; echo ${pkgname[@]})) + xbs unrelease "$pkgbase" "$repo" "$arch" else - warning "$pkgbase not found in $svnrepo" + warning "$pkgbase not found in $repo-$arch" warning "Removing only $pkgbase from the repo" warning "If it was a split package you have to remove the others yourself!" remove_pkgs[${#remove_pkgs[*]}]=$pkgbase diff --git a/db-update b/db-update index 576fe2b..28fcabe 100755 --- a/db-update +++ b/db-update @@ -45,8 +45,8 @@ for repo in ${repos[@]}; do if ${REQUIRE_SIGNATURE} && ! pacman-key -v "${pkg}.sig" >/dev/null 2>&1; then die "Package ${repo}/${pkg##*/} does not have a valid signature" fi - if ! check_pkgsvn "${pkg}" "${repo}"; then - die "Package ${repo}/${pkg##*/} is not consistent with svn repository" + if ! check_pkgxbs "${pkg}" "${repo}"; then + die "Package ${repo}/${pkg##*/} is not consistent with xbs" fi if ! check_pkgrepos "${pkg}"; then die "Package ${repo}/${pkg##*/} already exists in another repository" diff --git a/test/lib/common.inc b/test/lib/common.inc index fbdd30b..396f12f 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -19,6 +19,10 @@ arches() ( printf '%s\n' "${ARCHES[*]}" ) +arch_svn() { + /usr/bin/svn "$@" +} + signpkg() { if [[ -r '/etc/makepkg.conf' ]]; then source '/etc/makepkg.conf' @@ -120,6 +124,15 @@ setUp() { arch_svn commit -q -m"initial commit of ${pkg}" "${TMP}/svn-packages-copy" done + mkdir -p "${TMP}/home/.config/libretools" + export XDG_CONFIG_HOME="${TMP}/home/.config" + printf '%s\n' \ + 'SVNURL=foo' \ + "SVNREPO=\"${TMP}/svn-packages-copy\"" \ + "ARCHES=($(arches))" \ + > $XDG_CONFIG_HOME/libretools/xbs-abs.conf + printf '%s\n' 'BUILDSYSTEM=abs' > $XDG_CONFIG_HOME/xbs.conf + cat < "$(dirname ${BASH_SOURCE[0]})/../../config.local" FTP_BASE="${TMP}/ftp" SVNREPO="${TMP}/svn-packages-copy" @@ -155,7 +168,7 @@ releasePackage() { local pkgname pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null - archrelease ${repo}-${arch} >/dev/null 2>&1 + xbs release ${repo} ${arch} >/dev/null 2>&1 pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) pkgname=($(. PKGBUILD; echo ${pkgname[@]})) popd >/dev/null diff --git a/testing2x b/testing2x index 369857f..a76e972 100755 --- a/testing2x +++ b/testing2x @@ -20,12 +20,10 @@ declare -A pkgs for pkgbase in $*; do if [ ! -d "${WORKDIR}/${pkgbase}" ]; then - arch_svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null - found_source=false for pkgarch in ${ARCHES[@]} 'any'; do - svnrepo_from="${WORKDIR}/${pkgbase}/${TESTING_REPO}-${pkgarch}" - if [ -r "${svnrepo_from}/PKGBUILD" ]; then + xbsrepo_from="$(xbs releasepath ${pkgbase} ${TESTING_REPO} ${pkgarch})" + if [ -r "${xbsrepo_from}/PKGBUILD" ]; then found_source=true break fi @@ -34,8 +32,8 @@ for pkgbase in $*; do found_target=false for pkgarch in ${ARCHES[@]} 'any'; do for repo in ${STABLE_REPOS[@]}; do - svnrepo_to="${WORKDIR}/${pkgbase}/${repo}-${pkgarch}" - if [ -r "${svnrepo_to}/PKGBUILD" ]; then + xbsrepo_to="$(xbs releasepath ${pkgbase} ${repo} ${pkgarch})" + if [ -r "${xbsrepo_to}/PKGBUILD" ]; then found_target=true pkgs[${repo}]+="${pkgbase} " break 2 -- cgit v1.2.3-54-g00ecf From d744cae51bf5ea3e8c01d70ddbec564ad66b036c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 18 Jun 2013 00:06:38 -0600 Subject: use /etc/makepkg.conf for sourceballs --- config | 4 +- cron-jobs/makepkg.conf | 121 ------------------------------------------------- cron-jobs/sourceballs | 2 +- 3 files changed, 3 insertions(+), 124 deletions(-) delete mode 100644 cron-jobs/makepkg.conf (limited to 'config') diff --git a/config b/config index e1e705b..34869ab 100644 --- a/config +++ b/config @@ -25,8 +25,8 @@ TMPDIR="/var/tmp" ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" -PKGEXT=".pkg.tar.?z" -SRCEXT=".src.tar.gz" +PKGEXT="$(. $(librelib conf); load_files makepkg; echo "$PKGEXT")" +SRCEXT="$(. $(librelib conf); load_files makepkg; echo "$SRCEXT")" # Allowed licenses: get sourceballs only for licenses in this array ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1') diff --git a/cron-jobs/makepkg.conf b/cron-jobs/makepkg.conf deleted file mode 100644 index 603edba..0000000 --- a/cron-jobs/makepkg.conf +++ /dev/null @@ -1,121 +0,0 @@ -# -# /etc/makepkg.conf -# - -######################################################################### -# SOURCE ACQUISITION -######################################################################### -# -#-- The download utilities that makepkg should use to acquire sources -# Format: 'protocol::agent' -DLAGENTS=('ftp::/usr/bin/curl -sS -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' - 'http::/usr/bin/curl -sS -fLC - --retry 3 --retry-delay 3 -o %o %u' - 'https::/usr/bin/curl -sS -fLC - --retry 3 --retry-delay 3 -o %o %u' - 'rsync::/usr/bin/rsync -q --no-motd -z %u %o' - 'scp::/usr/bin/scp -q -C %u %o') - -# Other common tools: -# /usr/bin/snarf -# /usr/bin/lftpget -c -# /usr/bin/wget - -######################################################################### -# ARCHITECTURE, COMPILE FLAGS -######################################################################### -# -CARCH="x86_64" -CHOST="x86_64-unknown-linux-gnu" - -#-- Compiler and Linker Flags -# -march (or -mcpu) builds exclusively for an architecture -# -mtune optimizes for an architecture, but builds for whole processor family -CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" -CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" -LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu" -#-- Make Flags: change this for DistCC/SMP systems -#MAKEFLAGS="-j2" - -######################################################################### -# BUILD ENVIRONMENT -######################################################################### -# -# Defaults: BUILDENV=(fakeroot !distcc color !ccache check !sign) -# A negated environment option will do the opposite of the comments below. -# -#-- fakeroot: Allow building packages as a non-root user -#-- distcc: Use the Distributed C/C++/ObjC compiler -#-- color: Colorize output messages -#-- ccache: Use ccache to cache compilation -#-- check: Run the check() function if present in the PKGBUILD -#-- sign: Generate PGP signature file -# -BUILDENV=(fakeroot !distcc color !ccache check !sign) -# -#-- If using DistCC, your MAKEFLAGS will also need modification. In addition, -#-- specify a space-delimited list of hosts running in the DistCC cluster. -#DISTCC_HOSTS="" -# -#-- Specify a directory for package building. -#BUILDDIR=/tmp/makepkg - -######################################################################### -# GLOBAL PACKAGE OPTIONS -# These are default values for the options=() settings -######################################################################### -# -# Default: OPTIONS=(strip docs libtool emptydirs zipman purge !upx) -# A negated option will do the opposite of the comments below. -# -#-- strip: Strip symbols from binaries/libraries -#-- docs: Save doc directories specified by DOC_DIRS -#-- libtool: Leave libtool (.la) files in packages -#-- emptydirs: Leave empty directories in packages -#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip -#-- purge: Remove files specified by PURGE_TARGETS -#-- upx: Compress binary executable files using UPX -# -OPTIONS=(strip docs libtool emptydirs zipman purge !upx) - -#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 -INTEGRITY_CHECK=(md5) -#-- Options to be used when stripping binaries. See `man strip' for details. -STRIP_BINARIES="--strip-all" -#-- Options to be used when stripping shared libraries. See `man strip' for details. -STRIP_SHARED="--strip-unneeded" -#-- Options to be used when stripping static libraries. See `man strip' for details. -STRIP_STATIC="--strip-debug" -#-- Manual (man and info) directories to compress (if zipman is specified) -MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) -#-- Doc directories to remove (if !docs is specified) -DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) -#-- Files to be removed from all packages (if purge is specified) -PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) - -######################################################################### -# PACKAGE OUTPUT -######################################################################### -# -# Default: put built package and cached source in build directory -# -#-- Destination: specify a fixed directory where all packages will be placed -#PKGDEST=/home/packages -#-- Source cache: specify a fixed directory where source files will be cached -#SRCDEST=/home/sources -#-- Source packages: specify a fixed directory where all src packages will be placed -#SRCPKGDEST=/home/srcpackages -#-- Packager: name/email of the person or organization building packages -#PACKAGER="John Doe " -#-- Specify a key to use for package signing -#GPGKEY="" - -######################################################################### -# EXTENSION DEFAULTS -######################################################################### -# -# WARNING: Do NOT modify these variables unless you know what you are -# doing. -# -PKGEXT='.pkg.tar.xz' -SRCEXT='.src.tar.gz' - -# vim: set ft=sh ts=2 sw=2 et: diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index cd70916..34de2a6 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -88,7 +88,7 @@ for repo in ${PKGREPOS[@]}; do # Build the actual source package pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null - makepkg --nocolor --allsource --ignorearch --skippgpcheck --config "${dirname}/makepkg.conf" >"${WORKDIR}/${pkgbase}.log" 2>&1 + SRCPKGDEST=. makepkg --nocolor --allsource --ignorearch --skippgpcheck >"${WORKDIR}/${pkgbase}.log" 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" # Avoid creating the same source package for every arch -- cgit v1.2.3-54-g00ecf From ac6ebd38626a052049c17f166dd2ebee81a0168a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 28 Jul 2013 00:17:44 -0600 Subject: twiddle with config --- config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config b/config index 34869ab..179a2b9 100644 --- a/config +++ b/config @@ -1,3 +1,5 @@ +#/bin/bash # as a hint to editors + FTP_BASE="/srv/ftp" PKGREPOS=() PKGPOOL='' @@ -20,13 +22,13 @@ REQUIRE_SIGNATURE=true LOCK_DELAY=10 LOCK_TIMEOUT=300 -STAGING="$HOME/staging" +[ -z "${STAGING:-}" ] && STAGING="$HOME/staging" TMPDIR="/var/tmp" ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" -PKGEXT="$(. $(librelib conf); load_files makepkg; echo "$PKGEXT")" -SRCEXT="$(. $(librelib conf); load_files makepkg; echo "$SRCEXT")" +PKGEXT=".pkg.tar.?z" +SRCEXT=".src.tar.gz" # Allowed licenses: get sourceballs only for licenses in this array ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1') -- cgit v1.2.3-54-g00ecf From 63810122211aa60b056895989984eaccf6242c58 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 8 Dec 2013 15:12:55 -0500 Subject: clarify comment on bogus shebangs --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config b/config index 179a2b9..f327cd4 100644 --- a/config +++ b/config @@ -1,4 +1,4 @@ -#/bin/bash # as a hint to editors +#/bin/bash # as a hint to text editors FTP_BASE="/srv/ftp" PKGREPOS=() -- cgit v1.2.3-54-g00ecf