summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconvert-to-any9
-rwxr-xr-xcron-jobs/createFileLists16
-rw-r--r--db-functions2
-rwxr-xr-xmisc-scripts/find-dupes4
-rwxr-xr-xmisc-scripts/ftpdir-cleanup4
5 files changed, 20 insertions, 15 deletions
diff --git a/convert-to-any b/convert-to-any
index 3d55830..5b72aab 100755
--- a/convert-to-any
+++ b/convert-to-any
@@ -18,9 +18,8 @@ fi
if [ -f /etc/makepkg.conf ]; then
. /etc/makepkg.conf
else
- echo "W: /etc/makepkg.conf does not exist."
- DB_COMPRESSION=gz
- PKGEXT=".pkg.tar.gz"
+ echo "E: /etc/makepkg.conf does not exist."
+ exit 1
fi
cleanup() {
@@ -57,13 +56,13 @@ pushd "$WORKDIR/build" >/dev/null
# Conversion of i686 package into "any" package.
mkdir -p package
-if ! fakeroot tar zxf "$pkg" -C package; then
+if ! fakeroot bsdtar zxf "$pkg" -C package; then
die "convert-to-any: error in extracting $oldpkgname"
fi
sed -i "s/arch = \(i686\|x86_64\)/arch = any/g" package/.PKGINFO
pushd package >/dev/null
-fakeroot tar czf "$OUTDIR/$newpkgname" .PKGINFO *
+fakeroot bsdtar czf "$OUTDIR/$newpkgname" .PKGINFO *
popd >/dev/null
popd >/dev/null
diff --git a/cron-jobs/createFileLists b/cron-jobs/createFileLists
index 697c39d..6d03260 100755
--- a/cron-jobs/createFileLists
+++ b/cron-jobs/createFileLists
@@ -1,11 +1,17 @@
#!/bin/bash
reposdir=/srv/ftp/
-#targetdir=/home/pierre/public_html/test-repo/
targetdir=$reposdir
repos="core extra testing community"
arches="i686 x86_64"
+if [ -f /etc/makepkg.conf ]; then
+ . /etc/makepkg.conf
+else
+ echo "Error: /etc/makepkg.conf does not exist."
+ exit 1
+fi
+
if [ -f "/tmp/createFileList.lock" ]; then
echo "Error: createFileList allready in progress."
exit 1
@@ -22,7 +28,7 @@ getpkgname() {
local tmp
tmp=${1##*/}
- tmp=${tmp%.pkg.tar.gz}
+ tmp=${tmp%$PKGEXT}
tmp=${tmp%-i686}
tmp=${tmp%-x86_64}
tmp=${tmp%-any}
@@ -31,7 +37,7 @@ getpkgname() {
cd $reposdir
for repo in $repos; do
- REPO_DB_FILE=${repo}.files.tar.gz
+ REPO_DB_FILE=${repo}.files.tar.${DB_COMPRESSION}
for arch in $arches; do
repodir=${repo}/os/${arch}/
cached="no"
@@ -44,7 +50,7 @@ for repo in $repos; do
fi
# create file lists
- for pkg in $repodir*.pkg.tar.gz; do
+ for pkg in $repodir*${PKGEXT}; do
basename=$(basename $pkg)
pkgname=$(getpkgname $basename)
tmppkgdir=${TMPDIR}/${repodir}${pkgname}/
@@ -69,7 +75,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.gz -czf ${pkgdir}${REPO_DB_FILE} *
+ bsdtar --exclude=*.tar.${DB_COMPRESSION} -cf ${pkgdir}${REPO_DB_FILE} *
fi
cd $reposdir
diff --git a/db-functions b/db-functions
index f052bad..cee13ac 100644
--- a/db-functions
+++ b/db-functions
@@ -17,7 +17,7 @@ source_makepkg () {
#Get some config info
. /etc/makepkg.conf
else
- echo "/etc/makepkg.conf does not exist!"
+ echo "error: /etc/makepkg.conf does not exist!"
exit 1
fi
}
diff --git a/misc-scripts/find-dupes b/misc-scripts/find-dupes
index 372108f..16bf530 100755
--- a/misc-scripts/find-dupes
+++ b/misc-scripts/find-dupes
@@ -39,7 +39,7 @@ getpkgname() {
showdupes() {
done=""
- for i in *.pkg.tar.gz; do
+ for i in *${PKGEXT}; do
pkgname=$(getpkgname $i)
if [ "$pkgname" = "$1" ]; then
lastmod="$(stat -c %y $i | cut -d. -f1)"
@@ -60,7 +60,7 @@ echo "Scanning for duplicate packages in '$reponame' ($arch)"
DUPES=""
lastpkg=""
-for pkg in *.pkg.tar.gz; do
+for pkg in *${PKGEXT}; do
pkgname="$(getpkgname $pkg)"
if [ "$lastpkg" = "$pkgname" ]; then
DUPES="$DUPES $pkgname"
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index ed90437..a87ed8f 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -49,11 +49,11 @@ EXTRAFILES=""
TMPDIR=$(mktemp -d /tmp/cleanup.XXXXXX) || exit 1
cd "${TMPDIR}"
-/bin/tar xzf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"
+bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"
for pkg in *; do
filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1)
- [ -z "${filename}" ] && filename="${pkg}.pkg.tar.gz"
+ [ -z "${filename}" ] && filename="${pkg}${PKGEXT}"
if [ ! -f "${ftppath}/${filename}" ]; then
MISSINGFILES="${MISSINGFILES} ${filename}"