Added files used for syncing to source forge
This commit is contained in:
7
lib/sync-sf.sh
Executable file
7
lib/sync-sf.sh
Executable file
@@ -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
|
||||
22
lib/update_downloads.php
Executable file
22
lib/update_downloads.php
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
define("SITE_ROOT", realpath(dirname(__file__) . "/.."));
|
||||
require_once SITE_ROOT . "/lib/init.php";
|
||||
$sync = array("bz2", "log", "exe", "dmg");
|
||||
|
||||
$DB->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");
|
||||
Reference in New Issue
Block a user