Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-09-21 08:09:00 -0500
committerDan McGee <dan@archlinux.org>2009-09-21 08:09:00 -0500
commitece8f6fb0bf73295645a13736b6f8a6bba779242 (patch)
treee5c11a50257f515deeaf03a591cc4f3158bdbb71 /src
parente6efd1932b4df1fd7ee8130268abf80d8bd4a151 (diff)
Propagate return status up in DB cleaning code
We didn't look at the return status of sync_cleandb() in sync_cleandb_all(). Make it do so and return it up the call chain. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/sync.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 837c2b3d..e4cd408f 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -103,9 +103,11 @@ static int sync_cleandb(const char *dbpath, int keep_used) {
}
static int sync_cleandb_all(void) {
- const char *dbpath = alpm_option_get_dbpath();
+ const char *dbpath;
char newdbpath[PATH_MAX];
+ int ret = 0;
+ dbpath = alpm_option_get_dbpath();
printf(_("Database directory: %s\n"), dbpath);
if(!yesno(_("Do you want to remove unused repositories?"))) {
return(0);
@@ -113,13 +115,13 @@ static int sync_cleandb_all(void) {
/* The sync dbs were previously put in dbpath/, but are now in dbpath/sync/,
* so we will clean everything in dbpath/ (except dbpath/local/ and dbpath/sync/,
* and only the unused sync dbs in dbpath/sync/ */
- sync_cleandb(dbpath, 0);
+ ret += sync_cleandb(dbpath, 0);
sprintf(newdbpath, "%s%s", dbpath, "sync/");
- sync_cleandb(newdbpath, 1);
+ ret += sync_cleandb(newdbpath, 1);
printf(_("Database directory cleaned up\n"));
- return(0);
+ return(ret);
}
static int sync_cleancache(int level)