summaryrefslogtreecommitdiff
path: root/misc-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'misc-scripts')
-rwxr-xr-xmisc-scripts/make-sourceball15
-rwxr-xr-xmisc-scripts/sourceballs-cleanup17
2 files changed, 12 insertions, 20 deletions
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball
index 66d3dad..fccc4b5 100755
--- a/misc-scripts/make-sourceball
+++ b/misc-scripts/make-sourceball
@@ -47,17 +47,17 @@ create_srcpackage() {
msg "Creating source tarball for $packagename-$pkgver-$pkgrel"
fi
- local logfile="${LOGDIR}/sourceballs/$packagename"
- if ! /usr/bin/makepkg --allsource --ignorearch >"$logfile" 2>&1; then
+ /usr/bin/makepkg --allsource --ignorearch > "$WORKDIR/makepkg.log" 2>&1
+ if [ $? -ne 0 ]; then
error "Failed to download source for $packagename-$pkgver-$pkgrel ($reponame-$arch)"
- popd >/dev/null
+ local line
+ while read line; do
+ msg2 "${line}"
+ done < "$WORKDIR/makepkg.log"
return 1
fi
- /bin/rm -f "$logfile"
-
- local pkg_file="${packagename}-${pkgver}-${pkgrel}${SRCEXT}"
- mv "$pkg_file" "${FTP_BASE}/${SRCPOOL}"
+ mv "${packagename}-${pkgver}-${pkgrel}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}"
popd >/dev/null
@@ -68,7 +68,6 @@ create_srcpackage() {
}
set_umask
-[ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs"
cd "$WORKDIR"
failed=0
diff --git a/misc-scripts/sourceballs-cleanup b/misc-scripts/sourceballs-cleanup
index 450d137..fdb1355 100755
--- a/misc-scripts/sourceballs-cleanup
+++ b/misc-scripts/sourceballs-cleanup
@@ -3,9 +3,6 @@
. "$(dirname $0)/../db-functions"
. "$(dirname $0)/../config"
-[ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs"
-logfile="${LOGDIR}/sourceballs/cleanup.txt"
-
script_lock
${CLEANUP_DRYRUN} && warning 'dry run mode is active'
@@ -53,10 +50,6 @@ remove_old() {
set_umask
cd "$WORKDIR"
-
-[ -e "$logfile" ] && /bin/mv "$logfile" "$logfile.old"
-echo "Orphaned sourceballs:" > "$logfile"
-
for sourceball in "${FTP_BASE}/${SRCPOOL}"/*$SRCEXT; do
[ -f "$sourceball" ] || continue
packagename=$(basename $sourceball)
@@ -64,16 +57,16 @@ for sourceball in "${FTP_BASE}/${SRCPOOL}"/*$SRCEXT; do
if ! /usr/bin/svn export -q --force "$SVNREPO/$packagename" "$packagename" >/dev/null 2>&1; then
if [ $? -ne 1 ]; then
- echo "$packagename : svn died during export. Skipping sourceball." >> "$logfile"
+ error "$packagename : svn died during export. Skipping sourceball."
else
- echo "$packagename : no longer in svn. Removing sourceball." >> "$logfile"
+ msg "$packagename : no longer in svn. Removing sourceball."
${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR
fi
elif [ -z "$(ls -A "$packagename/repos")" ]; then
- echo "$packagename : no longer in repos but trunk is still in svn. Removing sourceball." >> "$logfile"
+ warning "$packagename : no longer in repos but trunk is still in svn. Removing sourceball."
${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR
- elif ! source "$packagename/trunk/PKGBUILD" && chk_license ${license[@]}; then
- echo "$packagename : source hosting no longer required by license. Removing sourceball." >> "$logfile"
+ elif ! chk_license $(. "$packagename/trunk/PKGBUILD"; echo ${license[@]}); then
+ msg "$packagename : source hosting no longer required by license. Removing sourceball."
${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR
else
remove_old "$packagename/repos/"