summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config24
-rw-r--r--db-functions33
-rwxr-xr-xdb-update9
3 files changed, 39 insertions, 27 deletions
diff --git a/config b/config
index 53191e0..720d110 100644
--- a/config
+++ b/config
@@ -1,25 +1,25 @@
-FTP_BASE="/srv/ftp"
-SVNREPO=''
-PKGREPOS=()
-PKGPOOL=''
-SRCPOOL=''
+FTP_BASE="/home/parabolavnx/parabolagnulinux.org/free"
+SVNREPO="/home/parabolavnx/parabolagnulinux.org/abslibre"
+PKGREPOS=('core' 'extra' 'community' 'libre' 'libre-testing' 'social' 'sugar' 'testing')
+PKGPOOL='pool/packages'
+SRCPOOL='sources/packages'
-CLEANUP_DESTDIR="/srv/package-cleanup"
+CLEANUP_DESTDIR="$FTP_BASE/old/packages"
CLEANUP_DRYRUN=false
# Time in days to keep moved packages
CLEANUP_KEEP=30
-SOURCE_CLEANUP_DESTDIR="/srv/source-cleanup"
+SOURCE_CLEANUP_DESTDIR="$FTP_BASE/old/sources"
SOURCE_CLEANUP_DRYRUN=false
# Time in days to keep moved sourcepackages
-SOURCE_CLEANUP_KEEP=14
+SOURCE_CLEANUP_KEEP=30
LOCK_DELAY=10
LOCK_TIMEOUT=300
-STAGING="$HOME/staging"
-TMPDIR="/srv/tmp"
-ARCHES=(i686 x86_64)
+STAGING="$FTP_BASE/staging"
+TMPDIR="$HOME/tmp"
+ARCHES=(i686 x86_64 mipsel)
DBEXT=".db.tar.gz"
FILESEXT=".files.tar.gz"
PKGEXT=".pkg.tar.*"
@@ -29,4 +29,4 @@ SRCEXT=".src.tar.gz"
ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1')
# Override default config with config.local
-[ -f "$(dirname ${BASH_SOURCE[0]})/config.local" ] && . "$(dirname ${BASH_SOURCE[0]})/config.local"
+#[ -f "$(dirname ${BASH_SOURCE[0]})/config.local" ] && . "$(dirname ${BASH_SOURCE[0]})/config.local"
diff --git a/db-functions b/db-functions
index 7d431fc..0553188 100644
--- a/db-functions
+++ b/db-functions
@@ -74,7 +74,7 @@ in_array() {
script_lock() {
local LOCKDIR="$TMPDIR/.scriptlock.$(basename $0)"
if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
- local _owner="$(/usr/bin/stat -c %U $LOCKDIR)"
+ local _owner="$(stat -c %U $LOCKDIR)"
error "Script $(basename $0) is already locked by $_owner."
exit 1
else
@@ -160,7 +160,7 @@ repo_lock () {
_count=0
while [ $_count -le $_trial ] || $_lockblock ; do
if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
- _owner="$(/usr/bin/stat -c %U $LOCKDIR)"
+ _owner="$(stat -c %U $LOCKDIR)"
warning "Repo [${1}] (${2}) is already locked by $_owner. "
msg2 "Retrying in $LOCK_DELAY seconds..."
else
@@ -193,7 +193,7 @@ repo_unlock () { #repo_unlock <repo-name> <arch>
_grep_pkginfo() {
local _ret
- _ret="$(/usr/bin/bsdtar -xOqf "$1" .PKGINFO | /bin/grep -m 1 "^${2} = ")"
+ _ret="$(bsdtar -xOqf "$1" .PKGINFO | /bin/grep -m 1 "^${2} = ")"
echo "${_ret#${2} = }"
}
@@ -358,9 +358,24 @@ 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" \
- "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null
- [ $? -ge 1 ] && return 1
+
+# Decide whether to look for PKGBUILD on [libre] or [libre-testing]
+ case $repo in
+ testing)
+ altrepo=libre-testing
+ ;;
+ *)
+ altrepo=libre
+ ;;
+ esac
+
+ cp -r ${SVNREPO}/$repo/$_pkgbase/PKGBUILD "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null 2>&1 || \
+ cp -r ${SVNREPO}/$altrepo/$_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[@]}))
@@ -443,7 +458,7 @@ set_repo_permission() {
local dbfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}"
if [ -w "${dbfile}" ]; then
- local group=$(/usr/bin/stat --printf='%G' "$(dirname "${dbfile}")")
+ local group=$(stat --printf='%G' "$(dirname "${dbfile}")")
chgrp $group "${dbfile}" || error "Could not change group of ${dbfile} to $group"
chmod g+w "${dbfile}" || error "Could not set write permission for group $group to ${dbfile}"
else
@@ -458,7 +473,7 @@ arch_repo_add() {
# 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 \
+ repo-add -q "${repo}${DBEXT}" ${pkgs[@]} >/dev/null \
|| error "repo-add ${repo}${DBEXT} ${pkgs[@]}"
popd >/dev/null
set_repo_permission "${repo}" "${arch}"
@@ -474,7 +489,7 @@ arch_repo_remove() {
error "No database found at '${dbfile}'"
return 1
fi
- /usr/bin/repo-remove -q "${dbfile}" ${pkgs[@]} >/dev/null \
+ repo-remove -q "${dbfile}" ${pkgs[@]} >/dev/null \
|| error "repo-remove ${dbfile} ${pkgs[@]}"
set_repo_permission "${repo}" "${arch}"
}
diff --git a/db-update b/db-update
index 5bdce5e..4740809 100755
--- a/db-update
+++ b/db-update
@@ -35,12 +35,9 @@ for repo in ${repos[@]}; do
if ! check_pkgfile "${pkg}"; then
die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data"
fi
- if ! check_pkgsvn "${pkg}" "${repo}"; then
- die "Package ${repo}/$(basename ${pkg}) is not consistent with svn repository"
- fi
- if ! check_pkgrepos "${pkg}"; then
- die "Package ${repo}/$(basename ${pkg}) already exists in another repository"
- fi
+ #if ! check_pkgrepos "${pkg}"; then
+ # die "Package ${repo}/$(basename ${pkg}) already exists in another repository"
+ #fi
done
if ! check_splitpkgs ${repo} ${pkgs[@]}; then
die "Missing split packages for ${repo}"