summaryrefslogtreecommitdiffstats
path: root/scripts/cleanup
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 08:31:47 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 10:03:54 +0200
commit76343fb91511b9f53e58b6c01b258bfe00ddb4c6 (patch)
tree60eb4d3727bae159a1807915a58348b210ead206 /scripts/cleanup
parenta0a523070847230565c2ad5993ee058ff475a8e1 (diff)
downloadaur-76343fb91511b9f53e58b6c01b258bfe00ddb4c6.tar.gz
aur-76343fb91511b9f53e58b6c01b258bfe00ddb4c6.tar.xz
Use an INI-style configuration file
Replace web/lib/config.inc.php with an INI-style configuration file. This allows us to get rid of several globals and makes it easier to use the same configuration file in external scripts. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'scripts/cleanup')
-rwxr-xr-xscripts/cleanup11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/cleanup b/scripts/cleanup
index 1fe63a27..0ccbe7df 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);