~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to src/gdu.c

  • Committer: Michael Vogt
  • Date: 2011-03-09 14:55:26 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110309145526-nw50jprtrfnpgppr
* data/apt-cdrom-check, data/cddistupgrader:
  - support upgrades from filesystems without the "stable" and 
    "ubuntu" symlinks (like vfat)
* src/gdu.c:
  - check all removable devices for a upgrader
  - when detecting a upgrade CD skip the "Run package manager"
    step as its recommended to use the release upgrader

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
      gtk_dialog_add_buttons(GTK_DIALOG(dialog), 
74
74
                             GTK_STOCK_CANCEL,
75
75
                             GTK_RESPONSE_REJECT,
76
 
                             _("Start package manager"), 
77
 
                             RES_START_PM,
78
76
                             _("Run upgrade"), 
79
77
                             RES_DIST_UPGRADER,
80
78
                             NULL);
153
151
      return;
154
152
 
155
153
   char *ubuntu_dir = g_strdup_printf("%s/ubuntu",mount_point);
 
154
   char *cdromupgrade = g_strdup_printf("%s/cdromupgrade",mount_point);
156
155
   char *aptoncd_file = g_strdup_printf("%s/aptoncd.info",mount_point);
157
156
   if(! (g_file_test (ubuntu_dir, G_FILE_TEST_IS_SYMLINK) ||
 
157
         g_file_test (cdromupgrade, G_FILE_TEST_EXISTS) ||
158
158
         g_file_test (aptoncd_file, G_FILE_TEST_IS_REGULAR) )) {
159
159
      g_free(ubuntu_dir);
 
160
      g_free(cdromupgrade);
160
161
      g_free(aptoncd_file);
161
162
      return;
162
163
   }
163
164
   g_free(ubuntu_dir);
 
165
   g_free(cdromupgrade);
164
166
   g_free(aptoncd_file);
165
167
 
166
168
   /* this looks like a ubuntu CD, run the checker script to verify
191
193
{
192
194
   //g_print("up_device_changed %s\n", gdu_device_get_device_file (device));
193
195
 
 
196
   // if its a partition, do the removable check on the parent
 
197
   GduDevice *removable = NULL;
 
198
   if (gdu_device_is_partition(device))
 
199
      removable = gdu_device_find_parent(device);
 
200
   else
 
201
      removable = device;
 
202
 
194
203
   // check if that is a removable device
195
 
   if (!gdu_device_is_removable(device))
 
204
   if (!gdu_device_is_removable(removable))
196
205
      return;
197
206
 
198
207
   // we only care about the first mount point