summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-06-07 21:34:10 -0400
committerJason Woodward2010-06-09 00:54:32 -0400
commitff5fd961da578f0ba6b05cf194491060d1759661 (patch)
treed628557d0f0fa4e18b38312a1840dd48f587434a
parenta78c577f6a28ac881c2a10278e24fb776fdd5be8 (diff)
downloadgslapt-ff5fd961da578f0ba6b05cf194491060d1759661.tar.gz
added reinstall notification
-rw-r--r--ChangeLog3
-rw-r--r--configure.in6
-rw-r--r--src/callbacks.c52
3 files changed, 53 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 359f553..1873b8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
+0.5.3c June 07, 2010
+ * added reinstall notification
+
0.5.3b June 02, 2010
* fixed threading issue when destroying windows
* translation overhaul with help from George Vlahavas
diff --git a/configure.in b/configure.in
index 45f90e7..3a8d3b2 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([gslapt], [0.5.3b], [woodwardj@jaos.org])
+AC_INIT([gslapt], [0.5.3c], [woodwardj@jaos.org])
AC_CONFIG_SRCDIR([configure.in])
AM_INIT_AUTOMAKE([-Wall foreign])
AM_CONFIG_HEADER(config.h)
@@ -40,8 +40,8 @@ AC_CHECK_LIB(gpgme,gpgme_new, [
[AC_DEFINE(SLAPT_HAS_GPGME, 1, [libslapt has builtin gpgme support])],
[AC_MSG_WARN(libslapt does not have gpgme support)])
], [AC_MSG_WARN(gpg support disabled)])
-dnl AC_CHECK_MEMBER([slapt_rc_config.use_priority], [LIBS="$LIBS -lslapt"], [AC_MSG_ERROR([libslapt 0.10.2 or greater is required])], [[#include <slapt.h>]])
-AC_CHECK_LIB(slapt,slapt_disk_space_check, [], [AC_MSG_ERROR(libslapt 0.10.2b or greater is required)])
+AC_CHECK_MEMBER([slapt_pkg_upgrade_t.reinstall], [LIBS="$LIBS -lslapt"], [AC_MSG_ERROR([libslapt 0.10.2f or greater is required])], [[#include <slapt.h>]])
+dnl AC_CHECK_LIB(slapt,slapt_disk_space_check, [], [AC_MSG_ERROR(libslapt 0.10.2b or greater is required)])
glib_modules="glib-2.0 gthread-2.0"
diff --git a/src/callbacks.c b/src/callbacks.c
index 77d9446..6886079 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -399,7 +399,12 @@ void add_pkg_for_install (GtkWidget *gslapt, gpointer user_data)
}
}
}else{
- slapt_add_upgrade_to_transaction(trans,installed_pkg,pkg);
+
+ if (global_config->re_install == TRUE)
+ slapt_add_reinstall_to_transaction(trans,installed_pkg,pkg);
+ else
+ slapt_add_upgrade_to_transaction(trans,installed_pkg,pkg);
+
if (global_config->re_install == TRUE) {
if (ver_cmp == 0) {
set_iter_for_reinstall(model,&actual_iter,pkg);
@@ -1900,7 +1905,7 @@ static int populate_transaction_window (GtkWidget *trans_window)
}
}
- if ( trans->upgrade_pkgs->pkg_count > 0 ) {
+ if ( (trans->upgrade_pkgs->pkg_count - trans->upgrade_pkgs->reinstall_count) > 0 ) {
gtk_tree_store_append (store, &iter,NULL);
gtk_tree_store_set(store,&iter,0,_("Packages to be upgraded"),-1);
@@ -1911,6 +1916,37 @@ static int populate_transaction_window (GtkWidget *trans_window)
trans->upgrade_pkgs->pkgs[i]->upgrade->version
);
+ if (trans->upgrade_pkgs->pkgs[i]->reinstall == SLAPT_TRUE) {
+ g_free(detail);
+ continue;
+ }
+
+ gtk_tree_store_append (store, &child_iter, &iter);
+ gtk_tree_store_set(store, &child_iter, 0, detail, -1);
+
+ dl_size += trans->upgrade_pkgs->pkgs[i]->upgrade->size_c;
+ already_dl_size += slapt_get_pkg_file_size(global_config,trans->upgrade_pkgs->pkgs[i]->upgrade)/1024;
+ free_space += trans->upgrade_pkgs->pkgs[i]->upgrade->size_u;
+ free_space -= trans->upgrade_pkgs->pkgs[i]->installed->size_u;
+
+ g_free(detail);
+ }
+ }
+
+ if ( trans->upgrade_pkgs->reinstall_count > 0 ) {
+ gtk_tree_store_append (store, &iter,NULL);
+ gtk_tree_store_set(store,&iter,0,_("Packages to be reinstalled"),-1);
+ for (i = 0; i < trans->upgrade_pkgs->pkg_count;++i) {
+ gchar *detail = g_strdup_printf("%s %s",
+ trans->upgrade_pkgs->pkgs[i]->upgrade->name,
+ trans->upgrade_pkgs->pkgs[i]->upgrade->version
+ );
+
+ if (trans->upgrade_pkgs->pkgs[i]->reinstall == SLAPT_FALSE) {
+ g_free(detail);
+ continue;
+ }
+
gtk_tree_store_append (store, &child_iter, &iter);
gtk_tree_store_set(store, &child_iter, 0, detail, -1);
@@ -1949,8 +1985,9 @@ static int populate_transaction_window (GtkWidget *trans_window)
gtk_tree_view_column_set_sort_column_id (column, 0);
gtk_tree_view_append_column (GTK_TREE_VIEW(summary_treeview), column);
- snprintf(buf,512,(gchar *)_("%d upgraded, %d newly installed, %d to remove and %d not upgraded."),
- trans->upgrade_pkgs->pkg_count,
+ snprintf(buf,512,(gchar *)_("%d upgraded, %d reinstalled, %d newly installed, %d to remove and %d not upgraded."),
+ trans->upgrade_pkgs->pkg_count - trans->upgrade_pkgs->reinstall_count,
+ trans->upgrade_pkgs->reinstall_count,
trans->install_pkgs->pkg_count,
trans->remove_pkgs->pkg_count,
trans->exclude_pkgs->pkg_count
@@ -2059,7 +2096,12 @@ static void mark_upgrade_packages (void)
(ladd_deps_to_trans(trans,all,installed,update_pkg) == 0)
&& (conflicts->pkg_count == 0)
) {
- slapt_add_upgrade_to_transaction(trans,installed->pkgs[i],update_pkg);
+
+ if (global_config->re_install == TRUE)
+ slapt_add_reinstall_to_transaction(trans,installed->pkgs[i],update_pkg);
+ else
+ slapt_add_upgrade_to_transaction(trans,installed->pkgs[i],update_pkg);
+
if (set_iter_to_pkg(base_model,&iter,update_pkg)) {
set_iter_for_upgrade(base_model, &iter, update_pkg);
}