Added separate packages update functions for more speed

pull/47/head
parent bc16ad4ce0
commit bc8d4507bb
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -101,6 +101,34 @@ int yon_packages_check_updates(char *package){
return g_hash_table_contains(packages_struct.updates_list,package);
}
void yon_packages_update_package_is_installed(char *package){
char *command = update_package_installed_command(package);
if (!system(command)){
if (!g_hash_table_contains(packages_struct.installed_list,package)){
g_hash_table_add(packages_struct.installed_list,yon_char_new(package));
}
} else {
if (g_hash_table_contains(packages_struct.installed_list,package)){
g_hash_table_remove(packages_struct.installed_list,package);
}
}
free(command);
}
void yon_packages_update_package_is_updated(char *package){
char *command = update_package_updated_command(package);
if (!system(command)){
if (!g_hash_table_contains(packages_struct.updates_list,package)){
g_hash_table_add(packages_struct.updates_list,yon_char_new(package));
}
} else {
if (g_hash_table_contains(packages_struct.updates_list,package)){
g_hash_table_remove(packages_struct.updates_list,package);
}
}
free(command);
}
void yon_packages_update_package(char *package){
char *command = update_package_installed_command(package);
if (!system(command)){

@ -572,3 +572,5 @@ void yon_packages_finish();
void yon_packages_update_package(char *package);
int yon_packages_install(char *package);
int yon_packages_remove(char *package);
void yon_packages_update_package_is_installed(char *package);
void yon_packages_update_package_is_updated(char *package);
Loading…
Cancel
Save