From 75222d10c034365a6a3f46ffad26dbc428d86d0e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Thu, 10 Oct 2013 19:50:24 +0200 Subject: [PATCH] Added files used for syncing to source forge --- lib/sync-sf.sh | 7 +++++++ lib/update_downloads.php | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 lib/sync-sf.sh create mode 100755 lib/update_downloads.php diff --git a/lib/sync-sf.sh b/lib/sync-sf.sh new file mode 100755 index 0000000..139fcea --- /dev/null +++ b/lib/sync-sf.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +wd=/var/www/singularity +cd $wd +rsync -av -e ssh *.exe *.dmg *.tar.bz2 *.log latifer@frs.sf.net:/home/frs/project/singularityview/alphas +$wd/lib/update_downloads.php +scp lib/singularity_revisions.db latifer@frs.sf.net:/home/project-web/singularityview/htdocs/alpha/lib diff --git a/lib/update_downloads.php b/lib/update_downloads.php new file mode 100755 index 0000000..89cde5c --- /dev/null +++ b/lib/update_downloads.php @@ -0,0 +1,22 @@ +#!/usr/bin/php +query("begin"); +$DB->query("delete from downloads"); + +if ($dh = opendir(SITE_ROOT)) { + while (($file = readdir($dh)) !== false) { + $ext = pathinfo($file, PATHINFO_EXTENSION); + if (in_array($ext, $sync)) { + $q = kl_str_sql("insert into downloads(file_name) values (!s)", $file); + $DB->query($q); + } + } + closedir($dh); +} + +$DB->query("commit");