|
|
|
@ -199,6 +199,27 @@ char* yon_alpm_list_to_char(alpm_list_t *list){
|
|
|
|
return final;
|
|
|
|
return final;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void yon_packages_info_struct_free(yon_packages_info *info){
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->repo_name)) free(info->repo_name);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->package_name)) free(info->package_name);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->version)) free(info->version);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->description)) free(info->description);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->architecture)) free(info->architecture);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->url)) free(info->url);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->licence)) free(info->licence);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->groups)) free(info->groups);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->provides)) free(info->provides);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->depends)) free(info->depends);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->optional_depends)) free(info->optional_depends);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->conflicts)) free(info->conflicts);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->replaces)) free(info->replaces);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->download_size)) free(info->download_size);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->install_size)) free(info->install_size);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->packager)) free(info->packager);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(info->build_date)) free(info->build_date);
|
|
|
|
|
|
|
|
free(info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type, const char *package){
|
|
|
|
yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type, const char *package){
|
|
|
|
if (yon_char_is_empty(package)) return NULL;
|
|
|
|
if (yon_char_is_empty(package)) return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
@ -406,6 +427,27 @@ GList *yon_packages_get_all(){
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GList *yon_packages_search_all(char *pkgname_regex){
|
|
|
|
|
|
|
|
if (!packages_struct.init_status) return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alpm_list_t *sync_db = alpm_get_syncdbs(packages_struct.packages_handle);
|
|
|
|
|
|
|
|
for (alpm_list_t *iter=sync_db;iter;iter=alpm_list_next(iter)){
|
|
|
|
|
|
|
|
alpm_db_t *database = iter->data;
|
|
|
|
|
|
|
|
alpm_list_t *package_list = alpm_db_get_pkgcache(database);
|
|
|
|
|
|
|
|
for (alpm_list_t *iter = package_list;iter;iter=iter->next){
|
|
|
|
|
|
|
|
const char *cur_name = alpm_pkg_get_name(iter->data);
|
|
|
|
|
|
|
|
if (g_regex_match_simple(pkgname_regex,cur_name,0,0)){
|
|
|
|
|
|
|
|
if (!list) list = g_list_append(list,yon_char_new(cur_name));
|
|
|
|
|
|
|
|
else if (g_list_append(list,yon_char_new(cur_name))){};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int yon_packages_upac_init(){
|
|
|
|
int yon_packages_upac_init(){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|