xbps-remove: misc changes to the clean-cache mode.

- If orphans mode is not set, exit directly.
- Simplify the clean-cache code to avoid unnecessary allocs in some cases.
This commit is contained in:
Juan RP
2015-01-10 11:13:26 +01:00
parent ee9aa98a64
commit 283fb4bc06
2 changed files with 10 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2008-2014 Juan Romero Pardines.
* Copyright (c) 2008-2015 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -269,7 +269,7 @@ main(int argc, char **argv)
if (clean_cache) {
rv = clean_cachedir(&xh);
if (rv != 0)
if (!orphans || rv)
exit(rv);;
}