From f338cb024ffad54b051000bba3d42fd343e363ae Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 5 Jun 2015 00:49:37 -0600 Subject: db-functions: do better printing of whitespace-separated filenames --- db-functions | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/db-functions b/db-functions index a0b20cd..deaa008 100644 --- a/db-functions +++ b/db-functions @@ -509,12 +509,13 @@ arch_repo_add() { local arch=$2 local pkgs=("${@:3}") + printf -v pkgs_str -- '%q ' "${pkgs[@]}" # package files might be relative to repo dir pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null /usr/bin/repo-add -q "${repo}${DBEXT}" "${pkgs[@]}" >/dev/null \ - || error '%s' "repo-add ${repo}${DBEXT} ${pkgs[*]}" + || error 'repo-add %q %s' "${repo}${DBEXT}" "${pkgs_str% }" /usr/bin/repo-add -f -q "${repo}${FILESEXT}" "${pkgs[@]}" \ - || error '%s' "repo-add -f ${repo}${FILESEXT} ${pkgs[*]}" + || error 'repo-add -f %q %s' "${repo}${FILESEXT}" "${pkgs_str% }" popd >/dev/null set_repo_permission "${repo}" "${arch}" @@ -532,10 +533,11 @@ arch_repo_remove() { error "No database found at '%s'" "${dbfile}" return 1 fi + printf -v pkgs_str -- '%q ' "${pkgs[@]}" /usr/bin/repo-remove -q "${dbfile}" "${pkgs[@]}" >/dev/null \ - || error '%s' "repo-remove ${dbfile} ${pkgs[*]}" + || error 'repo-remove %q %s' "${dbfile}" "${pkgs_str% }" /usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \ - || error '%s' "repo-remove ${filesfile} ${pkgs[*]}" + || error 'repo-remove %q %s' "${filesfile}" "${pkgs_str% }" set_repo_permission "${repo}" "${arch}" REPO_MODIFIED=1 -- cgit v1.2.3 From 17a94df0c108f09cada98535138136779b4e13a4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 24 May 2015 12:41:09 -0600 Subject: Use XBS instead of the SVN/ABS grossness. * config: drop SVNREPO * cron-jobs/sourceballs: Replace commented out SVN code and active ABS code with XBS code. The XBS code is fairly similar to the SVN code, the difference being that it uses `xbs releasepath` instead of `svn export`. * db-functions: - Rename check_pkgsvn to check_pkgxbs - check_pkgxbs: Drop the `svn export` bit, as `xbs releasepath` assumes that a working directory already exists. Replace the paths created by the `svn export` with calls to `xbs releasepath`. - check_splitpkgs: Drop the ABS `cp` -r bit, as `xbs releasepath` assumes that a working directory already exists. Replace the paths created by the `cp -r` with calls to `xbs releasepath`. Rename the variables and temporary files s/svn/xbs/ . * db-move: - First loop: Rename the variable svnrepo_from to xbsrepo_from, and get the value from `xbs releasepath`. - Second loop: Run `xbs move` before the inner loop to get a list of architectures. Rename the variable `svnrepo_from` to `xbsrepo_to`, and get the value for it from `xbs releasepath`. Because xbs guarantees that the PKGBUILD exists for the architectures listed, replace the check for whether the PKGBUILD exists with `if true`, to keep merging easy (as opposed to removing the if, and de-indenting the whole thing). * db-remove: Get the location of the PKGBUILD from `xbs releasepath`, call `xbs unrelease`, and adjust a message to use `xbs name` and mention the appropriate repo/arch pair. --- config | 2 +- cron-jobs/sourceballs | 11 +++-------- db-functions | 40 ++++++++++------------------------------ db-move | 22 ++++++++++++---------- db-remove | 6 ++++-- 5 files changed, 30 insertions(+), 51 deletions(-) diff --git a/config b/config index ec732c8..f1b09eb 100644 --- a/config +++ b/config @@ -1,6 +1,6 @@ #!/hint/bash + FTP_BASE="/srv/repo/main" -SVNREPO="/var/abs" # Repos from Arch ARCHREPOS=('core' 'testing' 'extra' 'community' 'multilib' 'multilib-testing') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index a9addc3..c12a128 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -78,15 +78,10 @@ for repo in "${PKGREPOS[@]}"; do continue fi - # Get the sources from svn + # Get the sources from xbs mkdir -p -m0770 "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - #svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ - # "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 - - # If it's on official repos, nor [libre], nor [libre-testing] - cp -r "${SVNREPO}/$repo/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre-testing/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 + cp -a "$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" \ + "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}") continue diff --git a/db-functions b/db-functions index deaa008..d76aa41 100644 --- a/db-functions +++ b/db-functions @@ -347,7 +347,7 @@ check_pkgfile() { fi } -check_pkgsvn() { +check_pkgxbs() { local pkgfile="${1}" local _pkgbase="$(getpkgbase "${pkgfile}")" [ $? -ge 1 ] && return 1 @@ -361,18 +361,11 @@ check_pkgsvn() { in_array "${repo}" "${PKGREPOS[@]}" || return 1 - if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then - mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" - 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}"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}")" - [ "${svnver}" == "${_pkgver}" ] || return 1 + local xbsver="$(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; get_full_version "${_pkgname}")" + [ "${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 } @@ -383,7 +376,7 @@ check_splitpkgs() { local pkgfiles=("${@}") local pkgfile local pkgdir - local svnname + local xbsname mkdir -p "${WORKDIR}/check_splitpkgs/" pushd "${WORKDIR}/check_splitpkgs" >/dev/null @@ -397,29 +390,16 @@ 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}" - - cp -r "${SVNREPO}/$repo/$_pkgbase/PKGBUILD" "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre/$_pkgbase/PKGBUILD" "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre-testing/$_pkgbase/PKGBUILD" "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/$_pkgbase">/dev/null 2>&1 - - [[ $? -ge 1 ]] && { - echo "Failed $_pkgbase-$_pkgver-$_pkgarch" - return 1 - } - fi - - local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}")) - printf '%s\n' "${svnnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn" + local xbsnames=($(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; echo "${pkgname[@]}")) + printf '%s\n' "${xbsnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs" done popd >/dev/null 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 diff --git a/db-move b/db-move index 2ac3f4a..275a11a 100755 --- a/db-move +++ b/db-move @@ -27,14 +27,14 @@ done # First loop is to check that all necessary files exist for pkgbase in "${args[@]:2}"; do for pkgarch in "${ARCHES[@]}" 'any'; do - svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}" - 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"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") if [ -z "${pkgver}" ]; then die "Could not read pkgver" fi @@ -61,18 +61,20 @@ msg "Moving packages from [%s] to [%s]..." "${repo_from}" "${repo_to}" declare -A add_pkgs declare -A remove_pkgs for pkgbase in "${args[@]:2}"; do - for pkgarch in "${ARCHES[@]}" 'any'; do - svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}" - - 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 + xbsrepo_to="$(xbs releasepath "$pkgbase" "$repo_to" "$pkgarch")" + if true; then # to add an indent level to make merging easier if [ "${pkgarch}" == 'any' ]; then tarches=("${ARCHES[@]}") else tarches=("${pkgarch}") fi msg2 '%s (%s)' "${pkgbase}" "${tarches[*]}" - pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo "${pkgname[@]}")) - pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgnames=($(. "${xbsrepo_to}/PKGBUILD"; echo "${pkgname[@]}")) + pkgver=$(. "${xbsrepo_to}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") for pkgname in "${pkgnames[@]}"; do for tarch in "${tarches[@]}"; do diff --git a/db-remove b/db-remove index 53fdb2a..dcbe4b4 100755 --- a/db-remove +++ b/db-remove @@ -30,11 +30,13 @@ remove_pkgs=() for pkgbase in "${pkgbases[@]}"; do msg "Removing %s from [%s]..." "$pkgbase" "$repo" - path="${SVNREPO}/$repo/$pkgbase" + path="$(xbs releasepath "$pkgbase" "$repo" "$arch")" if [ -d "$path" ]; then remove_pkgs+=($(. "$path/PKGBUILD"; echo "${pkgname[@]}")) + xbs unrelease "$pkgbase" "$repo" "$arch" else - warning "%s not found in ABS(libre)" "$pkgbase" + warning "%s not found in %s for %s" \ + "$pkgbase" "$(xbs name)" "$repo-$arch" warning "Removing only %s from the repo" "$pkgbase" warning "If it was a split package you have to remove the others yourself!" remove_pkgs+=("$pkgbase") -- cgit v1.2.3 From 003288a90c042c56d86258f60ac205b1d3053eab Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 24 May 2015 15:37:05 -0600 Subject: Remove cron-jobs/sourceballs2. It was "simpler" than cron-jobs/sourceballs because it iterated over the files in $SVNREPO directly, rather than getting the list from $FTP_BASE, and then getting the corresponding files from $SVNREPO. This fails with XBS because there is no single `abstree` path, there is one for each architecture. --- cron-jobs/sourceballs2 | 62 -------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100755 cron-jobs/sourceballs2 diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2 deleted file mode 100755 index e935f86..0000000 --- a/cron-jobs/sourceballs2 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# Steps -# Traverse ABSLibre -# Makepkg --allsource every package -# Remove the old sourceballs - -dirname="$(dirname "$(readlink -e "$0")")" -. "${dirname}/../config" -. "${dirname}/../db-functions" -. "${MAKEPKGCONF}" - -pushd "${WORKDIR}" >/dev/null - -script_lock - -# Adjust the nice level to run at a lower priority -renice +10 -p $$ > /dev/null - -# Create a list of all available source package file names -find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" - -pushd "${SVNREPO}" >/dev/null - -for repo in "${PKGREPOS[@]}"; do - msg "Sourceballing [%s]" "${repo}" - - pushd "$repo" >/dev/null - find -maxdepth 1 -type d | while read pkg; do - pushd "${SVNREPO}/$repo/$pkg" >/dev/null - - [[ ! -e ./PKGBUILD ]] && { - warning "%s is not a package" "$repo/$pkg" - continue - } - - # Unset the previous data - unset pkgbase pkgname pkgver pkgrel - source PKGBUILD - - unset build package url pkgdesc source md5sums depends makedepends \ - optdepends license arch options check mksource - - for _pkg in "${pkgname[@]}"; do - unset "package_${_pkg}" >/dev/null 2>&1 - done - - pkgbase=${pkgbase:-$pkgname} - srcfile="${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" - - echo "${srcfile}" >> "${WORKDIR}/expected-src-pkgs" - - # Skip already sourceballed - [ -e "${SRCPKGDEST}/${srcfile}" ] && continue - - makepkg --allsource --ignorearch -c >/dev/null 2>&1 - - [ $? -ne 0 ] && plain '%s' "${srcfile}" - - done # end find pkgs - popd >/dev/null - -done # end repos -- cgit v1.2.3 From b96b9d95dd4d2214a428f1435a9a72ef50f43cf5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 5 Jun 2015 00:48:12 -0600 Subject: db-update: Hook in to `xbs release-server` as it exists today. Obviously, this is an exercise in noticing a leaky abstraction. - assumes that the PKGBUILD is staged to a real directory going in - assumes where that is - assumes how to clean that up I believe the correct solution will require modifying XBS. Following is what I believe the changes should be. - change release-server to take "REPO ARCH DIR1 [DIR2...]", instead of using the CWD. - but this still assumes that the caller knows where release-client put the PKGBUILD, so change it to take "REPO ARCH PKGBASE1 [PKGBASE2...]". - this means that release-server knows to check if a PKGBUILD exists at the specified arch, and fall back to 'any' if it doesn't. - an alternative would be passing in the .pkg.tar filenames, and either parsing the filename or using db-functions to figure out the arch. - ??? how to get rid of cleaning up assumptions. --- db-update | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/db-update b/db-update index 0c4f824..f22eb15 100755 --- a/db-update +++ b/db-update @@ -55,13 +55,16 @@ for repo in "${repos[@]}"; do fi done +dirs=() for repo in "${repos[@]}"; do msg "Updating [%s]..." "${repo}" any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in "${ARCHES[@]}"; do + add_dirs=() add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do + add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$pkg")/$(getpkgbase "$pkg")") pkgfile="${pkg##*/}" msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run @@ -78,9 +81,14 @@ for repo in "${repos[@]}"; do fi add_pkgs+=("${pkgfile}") done + for add_dir in "${add_dirs[@]}"; do + (cd "${add_dir}" && xbs release-server "${repo}" "${pkgarch}") || + error 'cd %q && xbs release-server %q %q' "${add_dir}" "${repo}" "${pkgarch}" + done if [ ${#add_pkgs[@]} -ge 1 ]; then arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi + dirs+=("${add_dirs[@]}") done done @@ -91,6 +99,14 @@ for repo in "${repos[@]}"; do done cd "${STAGING}" + +# Remove left over XBS files +rm -rf -- "${dirs[@]}" +dirname -z -- "${dirs[@]}" | + xargs -0 realpath -zm --relative-to="${STAGING}" -- | + xargs -0 rmdir -p -- 2>/dev/null + +# Stage generated source files while read -r file; do pub="${FTP_BASE}/${file}" if [[ -f "$pub" ]]; then -- cgit v1.2.3 From 6fd5374e66877d8d1b44aaf6f70e8a00ad8c2d7b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Jun 2015 07:01:18 +0100 Subject: rename libremessages to db-libremessages to avoid masking libretools libremessages --- any-to-ours | 2 +- db-cleanup | 2 +- db-libremessages | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ db-sync | 2 +- libremessages | 83 -------------------------------------------------------- 5 files changed, 86 insertions(+), 86 deletions(-) create mode 100755 db-libremessages delete mode 100755 libremessages diff --git a/any-to-ours b/any-to-ours index d98cc5d..a901d54 100755 --- a/any-to-ours +++ b/any-to-ours @@ -8,7 +8,7 @@ trap_exit() { } source "$(dirname "$(readlink -e "$0")")/config" -source "$(dirname "$(readlink -e "$0")")/libremessages" +source "$(dirname "$(readlink -e "$0")")/db-libremessages" # From makepkg set -E diff --git a/db-cleanup b/db-cleanup index efe7397..ffa2601 100755 --- a/db-cleanup +++ b/db-cleanup @@ -16,7 +16,7 @@ trap_exit() { } source "$(dirname "$(readlink -e "$0")")/config" -source "$(dirname "$(readlink -e "$0")")/libremessages" +source "$(dirname "$(readlink -e "$0")")/db-libremessages" # From makepkg set -E diff --git a/db-libremessages b/db-libremessages new file mode 100755 index 0000000..37df149 --- /dev/null +++ b/db-libremessages @@ -0,0 +1,83 @@ +# Copyright (c) 2006-2010 Pacman Development Team +# Copyright (c) 2002-2006 by Judd Vinet +# Copyright (c) 2005 by Aurelien Foret +# Copyright (c) 2006 by Miklos Vajna +# Copyright (c) 2005 by Christian Hamar +# Copyright (c) 2006 by Alex Smith +# Copyright (c) 2006 by Andras Voroskoi +# Copyright (c) 2011 by Joshua Haase +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# gettext initialization +export TEXTDOMAIN='libretools' +export TEXTDOMAINDIR='/usr/share/locale' + +# check if messages are to be printed using color +unset ALL_OFF BOLD BLUE GREEN RED YELLOW + +if tput setaf 0 &>/dev/null; then + ALL_OFF="$(tput sgr0)" + BOLD="$(tput bold)" + BLUE="${BOLD}$(tput setaf 4)" + GREEN="${BOLD}$(tput setaf 2)" + RED="${BOLD}$(tput setaf 1)" + YELLOW="${BOLD}$(tput setaf 3)" + PURPLE="${ALL_OFF}$(tput setaf 5)" +else + ALL_OFF="\033[1;0m" + BOLD="\033[1;1m" + BLUE="${BOLD}\033[1;34m" + GREEN="${BOLD}\033[1;32m" + RED="${BOLD}\033[1;31m" + YELLOW="${BOLD}\033[1;33m" + PURPLE="${BOLD}\033[1;30;40m" +fi + +stdnull() { + local action=$1; + eval "${action} >/dev/null 2>&1" +} + +plain() { + local mesg=$1; shift + printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +msg() { + local mesg=$1; shift + printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +msg2() { + local mesg=$1; shift + printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +warning() { + local mesg=$1; shift + printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +error() { + local mesg=$1; shift + printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +fatal_error() { + local mesg=$1; shift + error "$mesg" "$@" + + exit 1 +} diff --git a/db-sync b/db-sync index 35b6489..2194fe6 100755 --- a/db-sync +++ b/db-sync @@ -190,7 +190,7 @@ trap_exit() { source "$(dirname "$(readlink -e "$0")")/config" source "$(dirname "$(readlink -e "$0")")/db-sync.conf" -source "$(dirname "$(readlink -e "$0")")/libremessages" +source "$(dirname "$(readlink -e "$0")")/db-libremessages" # Check variables presence for var in DBEXT FILESEXT mirror mirrorpath WORKDIR BLACKLIST_FILE FTP_BASE ARCHSRCPOOLS ARCHPKGPOOLS; do diff --git a/libremessages b/libremessages deleted file mode 100755 index 37df149..0000000 --- a/libremessages +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2006-2010 Pacman Development Team -# Copyright (c) 2002-2006 by Judd Vinet -# Copyright (c) 2005 by Aurelien Foret -# Copyright (c) 2006 by Miklos Vajna -# Copyright (c) 2005 by Christian Hamar -# Copyright (c) 2006 by Alex Smith -# Copyright (c) 2006 by Andras Voroskoi -# Copyright (c) 2011 by Joshua Haase -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# gettext initialization -export TEXTDOMAIN='libretools' -export TEXTDOMAINDIR='/usr/share/locale' - -# check if messages are to be printed using color -unset ALL_OFF BOLD BLUE GREEN RED YELLOW - -if tput setaf 0 &>/dev/null; then - ALL_OFF="$(tput sgr0)" - BOLD="$(tput bold)" - BLUE="${BOLD}$(tput setaf 4)" - GREEN="${BOLD}$(tput setaf 2)" - RED="${BOLD}$(tput setaf 1)" - YELLOW="${BOLD}$(tput setaf 3)" - PURPLE="${ALL_OFF}$(tput setaf 5)" -else - ALL_OFF="\033[1;0m" - BOLD="\033[1;1m" - BLUE="${BOLD}\033[1;34m" - GREEN="${BOLD}\033[1;32m" - RED="${BOLD}\033[1;31m" - YELLOW="${BOLD}\033[1;33m" - PURPLE="${BOLD}\033[1;30;40m" -fi - -stdnull() { - local action=$1; - eval "${action} >/dev/null 2>&1" -} - -plain() { - local mesg=$1; shift - printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -msg() { - local mesg=$1; shift - printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -msg2() { - local mesg=$1; shift - printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -warning() { - local mesg=$1; shift - printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -error() { - local mesg=$1; shift - printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -fatal_error() { - local mesg=$1; shift - error "$mesg" "$@" - - exit 1 -} -- cgit v1.2.3 From 969e2de31319c95913ec52f85b97552c3d26414f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Jun 2015 07:02:15 +0100 Subject: db-update: get the correct directory for xbs --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db-update b/db-update index f22eb15..4830791 100755 --- a/db-update +++ b/db-update @@ -64,7 +64,6 @@ for repo in "${repos[@]}"; do add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do - add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$pkg")/$(getpkgbase "$pkg")") pkgfile="${pkg##*/}" msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run @@ -79,6 +78,7 @@ for repo in "${repos[@]}"; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi + add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$FTP_BASE/$PKGPOOL/$pkgfile")/$repo/$(getpkgbase "$FTP_BASE/$PKGPOOL/$pkgfile")") add_pkgs+=("${pkgfile}") done for add_dir in "${add_dirs[@]}"; do -- cgit v1.2.3 From 00c15eb70600b5024973fd19528761381a89f759 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Jun 2015 07:03:07 +0100 Subject: config: remove mips64el from ARCHES --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index f1b09eb..287f5b0 100644 --- a/config +++ b/config @@ -43,7 +43,7 @@ LOCK_TIMEOUT=300 [ -n "${STAGING:-}" ] || STAGING="$HOME/staging/unknown/staging" TMPDIR="/tmp" ARCHARCHES=(i686 x86_64) -OURARCHES=(mips64el) +OURARCHES=() ARCHES=(${ARCHARCHES[@]} ${OURARCHES[@]}) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" -- cgit v1.2.3 From 780c57ec14e7ccbf8695ccc159bbee49cf17e237 Mon Sep 17 00:00:00 2001 From: Parabola Repo Date: Mon, 8 Jun 2015 07:04:15 +0100 Subject: These changes to abslibre were sitting on the server --- abslibre | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/abslibre b/abslibre index af57ec2..6b21d24 100755 --- a/abslibre +++ b/abslibre @@ -1,6 +1,6 @@ #!/bin/bash -set -e -x +set -e FTP_BASE=/srv/repo/main ABSLIBRE=/srv/abslibre @@ -52,12 +52,12 @@ function get_blacklist() { function sync_abs_libre() { # Clone ABSLibre git repo - if [ -d /var/tmp/abslibre/.git ]; then - pushd /var/tmp/abslibre >/dev/null 2>&1 + if [ -d /tmp/abslibre/.git ]; then + pushd /tmp/abslibre >/dev/null 2>&1 git pull popd >/dev/null 2>&1 else - git clone "$ABSGIT" /var/tmp/abslibre + git clone "$ABSGIT" /tmp/abslibre fi # Sync from ABS and then sync from ABSLibre @@ -67,7 +67,7 @@ function sync_abs_libre() { ${ABSROOT} \ ${ABSLIBRE} \ && - for ARCH in i686 x86_64; do rsync -v -mrtq --no-motd --no-p --no-o --no-g --quiet --exclude=.git/ /var/tmp/abslibre/ ${ABSLIBRE}/${ARCH}/; done) || { + for ARCH in i686 x86_64; do rsync -v -mrtq --no-motd --no-p --no-o --no-g --quiet --exclude=.git/ /tmp/abslibre/ ${ABSLIBRE}/${ARCH}/; done) || { printf "[FAILED]\n" return 1 } -- cgit v1.2.3