diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/aurblup/aurblup-wrapper | 12 | ||||
-rwxr-xr-x | scripts/cleanup | 11 |
2 files changed, 14 insertions, 9 deletions
diff --git a/scripts/aurblup/aurblup-wrapper b/scripts/aurblup/aurblup-wrapper index b056030..c7b20af 100755 --- a/scripts/aurblup/aurblup-wrapper +++ b/scripts/aurblup/aurblup-wrapper @@ -8,10 +8,14 @@ if (empty($dir)) { } set_include_path(get_include_path() . PATH_SEPARATOR . "$dir/lib"); -include("config.inc.php"); +include("confparser.inc.php"); + +$user = config_get('database', 'user'); +$password = config_get('database', 'password'); +$name = config_get('database', 'name'); exec($dir . "/../scripts/aurblup/aurblup " . "-S /var/run/mysqld/mysqld.sock " . - "-u " . escapeshellarg(AUR_db_user) . " " . - "-p " . escapeshellarg(AUR_db_pass) . " " . - "-D " . escapeshellarg(AUR_db_name)); + "-u " . escapeshellarg($user) . " " . + "-p " . escapeshellarg($password) . " " . + "-D " . escapeshellarg($name)); diff --git a/scripts/cleanup b/scripts/cleanup index 1fe63a2..0ccbe7d 100755 --- a/scripts/cleanup +++ b/scripts/cleanup @@ -16,24 +16,25 @@ if (empty($dir)) { } set_include_path(get_include_path() . PATH_SEPARATOR . "$dir/lib"); -include("config.inc.php"); +include("confparser.inc.php"); include("aur.inc.php"); include("pkgfuncs.inc.php"); $count = 0; -$buckets = scandir(INCOMING_DIR); +$incoming_dir = config_get('paths', 'storage'); +$buckets = scandir($incoming_dir); foreach ($buckets as $bucket) { - $bucketpath = INCOMING_DIR . $bucket; + $bucketpath = $incoming_dir . $bucket; if ($bucket == '.' || $bucket == '..' || !is_dir($bucketpath)) { continue; } - $files = scandir(INCOMING_DIR . $bucket); + $files = scandir($incoming_dir . $bucket); foreach ($files as $pkgname) { if ($pkgname == '.' || $pkgname == '..') { continue; } - $fullpath = INCOMING_DIR . $bucket . "/" . $pkgname; + $fullpath = $incoming_dir . $bucket . "/" . $pkgname; if (!pkg_from_name($pkgname) && is_dir($fullpath)) { echo 'Removing ' . $fullpath . "\n"; rm_tree($fullpath); |