It is okay if the file does not exist.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# #
#############################################################################*/
+#include <errno.h>
#include <ftw.h>
#include <stddef.h>
#include <stdio.h>
int r = nftw(cache_path, _unlink, 64, FTW_DEPTH|FTW_PHYS);
pakfire_free(cache_path);
+ // It is okay if the path doesn't exist
+ if (r < 0 && errno == ENOENT)
+ r = 0;
+
return r;
}
raise NotAnIPFireSystemError("You can run pakfire only on an IPFire system")
def clean(self):
- log.debug("Cleaning up everything...")
-
- # Clean up repository caches.
- self.repos.clean()
+ # Clean up repository caches
+ for repo in self.repos:
+ repo.clean()
def build(self, makefile, resultdir, stages=None, **kwargs):
b = builder.Builder(self, makefile, resultdir, **kwargs)
print(FORMAT % (repo.name, repo.enabled, repo.priority, len(repo)))
def handle_clean(self, ns):
- print(_("Cleaning up everything..."))
+ self.ui.message(_("Cleaning up everything..."))
- with self.pakfire(ns) as p:
- p.clean()
+ p = self.pakfire(ns)
+ p.clean()
def handle_check(self, ns):
with self.pakfire(ns) as p: