summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-08-19 01:11:03 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-08-19 01:11:03 +0200
commit49fb4d75ea83dca2ed4653e8454c478c1fd0555a (patch)
tree0d5756f95d28f42c1baa5d4df75f33e3c904ff7d
parent6666d28f019b1b7ea38f9bf1f4371a87d42fb927 (diff)
downloaddbscripts-49fb4d75ea83dca2ed4653e8454c478c1fd0555a.tar.gz
dbscripts-49fb4d75ea83dca2ed4653e8454c478c1fd0555a.tar.xz
More removal of DB_COMPRESSION from cron jobs
Remove dependance on makepkg.conf Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xcron-jobs/createFileLists17
-rwxr-xr-xmisc-scripts/ftpdir-cleanup16
2 files changed, 14 insertions, 19 deletions
diff --git a/cron-jobs/createFileLists b/cron-jobs/createFileLists
index 610f0e1..4ad4c22 100755
--- a/cron-jobs/createFileLists
+++ b/cron-jobs/createFileLists
@@ -3,7 +3,6 @@
reposdir=/srv/ftp/
targetdir=$reposdir
repos="core extra testing community"
-DB_COMPRESSION="gz"
. $(dirname $0)/../config
@@ -30,16 +29,18 @@ getpkgname() {
echo $tmp
}
-case "${DB_COMPRESSION}" in
- gz) TAR_OPT="z" ;;
- bz2) TAR_OPT="j" ;;
- xz) TAR_OPT="J" ;;
- *) echo "${DB_COMPRESSION} is not a valid archive compression" && exit 1 ;;
+case "${DBEXT}" in
+ *.gz) TAR_OPT="z" ;;
+ *.bz2) TAR_OPT="j" ;;
+ *.xz) TAR_OPT="J" ;;
+ *) echo "Unknown compression type for DBEXT=${DBEXT}" && exit 1 ;;
esac
+FILESEXT="${DBEXT//db/files}"
+
cd $reposdir
for repo in $repos; do
- REPO_DB_FILE=${repo}.files.tar.${DB_COMPRESSION}
+ REPO_DB_FILE=${repo}$FILESEXT
for arch in ${ARCHES[@]}; do
repodir=${repo}/os/${arch}/
cached="no"
@@ -77,7 +78,7 @@ for repo in $repos; do
cd ${TMPDIR}/${repodir}
[ -f "${pkgdir}${REPO_DB_FILE}.old" ] && rm "${pkgdir}${REPO_DB_FILE}.old"
[ -f "${pkgdir}${REPO_DB_FILE}" ] && mv "${pkgdir}${REPO_DB_FILE}" "${pkgdir}${REPO_DB_FILE}.old"
- bsdtar --exclude=*.tar.${DB_COMPRESSION} -c${TAR_OPT}f ${pkgdir}${REPO_DB_FILE} *
+ bsdtar --exclude=*${DBEXT//\.db/} -c${TAR_OPT}f ${pkgdir}${REPO_DB_FILE} *
fi
cd $reposdir
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index f64acfa..96407c0 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -7,16 +7,10 @@ fi
reponame=$1
dest=$2
-DB_COMPRESSION='gz'
############################################################
-if [ ! -f "$(dirname $0)/../config" ]; then
- echo "$(dirname $0)/../config not found! Aborting"
- exit 1
-fi
-
-. "$(dirname $0)/../config"
+. "$(dirname $0)/../db-functions"
getpkgname() {
local tmp
@@ -52,16 +46,16 @@ for arch in ${ARCHES[@]}; do
exit 1
fi
- if [ ! -f "$ftppath/$reponame.db.tar.$DB_COMPRESSION" ]; then
+ if [ ! -f "$ftppath/$reponame$DBEXT" ]; then
echo ""
- echo "ERROR: The file \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\" could not be found, aborting."
+ echo "ERROR: The file \"$ftppath/$reponame$DBEXT\" could not be found, aborting."
echo ""
exit 1
fi
- if ! bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"; then
+ if ! bsdtar xf "$ftppath/$reponame$DBEXT"; then
echo ""
- echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\""
+ echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame$DBEXT\""
exit 1
fi