xbps-repo: implement new target 'pkg-list' to list pkgs from target repo.
This commit is contained in:
		@@ -43,17 +43,18 @@ list_pkgs_in_dict(prop_object_t obj, void *arg, bool *loop_done)
 | 
			
		||||
 | 
			
		||||
	(void)loop_done;
 | 
			
		||||
 | 
			
		||||
	if (xbps_pkg_state_dictionary(obj, &curstate))
 | 
			
		||||
		return EINVAL;
 | 
			
		||||
 | 
			
		||||
	if (lpc->state == 0) {
 | 
			
		||||
		/* Only list packages that are fully installed */
 | 
			
		||||
		if (curstate != XBPS_PKG_STATE_INSTALLED)
 | 
			
		||||
			return 0;
 | 
			
		||||
	} else {
 | 
			
		||||
		/* Only list packages with specified state */
 | 
			
		||||
		if (curstate != lpc->state)
 | 
			
		||||
			return 0;
 | 
			
		||||
	if (lpc->check_state) {
 | 
			
		||||
		if (xbps_pkg_state_dictionary(obj, &curstate))
 | 
			
		||||
			return EINVAL;
 | 
			
		||||
		if (lpc->state == 0) {
 | 
			
		||||
			/* Only list packages that are fully installed */
 | 
			
		||||
			if (curstate != XBPS_PKG_STATE_INSTALLED)
 | 
			
		||||
				return 0;
 | 
			
		||||
		} else {
 | 
			
		||||
			/* Only list packages with specified state */
 | 
			
		||||
			if (curstate != lpc->state)
 | 
			
		||||
				return 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user