diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index 8bf57c1..dfbd007 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -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)){ diff --git a/source/libublsettings-gtk3.h b/source/libublsettings-gtk3.h index 799c438..0dd9268 100644 --- a/source/libublsettings-gtk3.h +++ b/source/libublsettings-gtk3.h @@ -571,4 +571,6 @@ int yon_packages_check_updates(char *package); void yon_packages_finish(); void yon_packages_update_package(char *package); int yon_packages_install(char *package); -int yon_packages_remove(char *package); \ No newline at end of file +int yon_packages_remove(char *package); +void yon_packages_update_package_is_installed(char *package); +void yon_packages_update_package_is_updated(char *package); \ No newline at end of file