xbps-{bin,repo}: ignore ENOENT when checking write perms in {root,meta,cache}dir.
This commit is contained in:
		| @@ -243,6 +243,7 @@ main(int argc, char **argv) | ||||
| 		if ((access(xh.rootdir, W_OK) == -1) || | ||||
| 		    (access(xh.metadir, W_OK) == -1) || | ||||
| 		    (access(xh.cachedir, W_OK) == -1)) { | ||||
| 			if (errno != ENOENT) { | ||||
| 				xbps_error_printf("xbps-bin: cannot write to " | ||||
| 				    "rootdir/cachedir/metadir: %s\n", | ||||
| 				strerror(errno)); | ||||
| @@ -250,6 +251,7 @@ main(int argc, char **argv) | ||||
| 				exit(EXIT_FAILURE); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (strcasecmp(argv[0], "list") == 0) { | ||||
| 		/* Lists packages currently registered in database. */ | ||||
|   | ||||
| @@ -158,12 +158,14 @@ main(int argc, char **argv) | ||||
| 	    (strcasecmp(argv[0], "clean") == 0)) { | ||||
| 		if ((access(xh.metadir, W_OK) == -1) || | ||||
| 		    (access(xh.cachedir, W_OK) == -1)) { | ||||
| 			if (errno != ENOENT) { | ||||
| 				xbps_error_printf("xbps-repo: cannot write to " | ||||
| 				    "cachedir/metadir: %s\n", strerror(errno)); | ||||
| 				xbps_end(&xh); | ||||
| 				exit(EXIT_FAILURE); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (strcasecmp(argv[0], "list") == 0) { | ||||
| 		/* Lists all repositories registered in pool. */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user