debian/0000775000000000000000000000000012321502415007163 5ustar debian/compat0000664000000000000000000000000212227023614010365 0ustar 9 debian/patches/0000775000000000000000000000000012321501633010613 5ustar debian/patches/git_xid_check.patch0000664000000000000000000000233412263563676014446 0ustar From 62253c54e8c7136e6f2dc9de70c68b7af7c3cd64 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 08 Jan 2014 23:51:53 +0000 Subject: Be more careful with XIDs When an invalid XID is specified, we end up calling gdk_window_set_transient_for with a NULL window. This leads to a crash, so don't do it, and instead silently ignore the invalid XID. https://bugzilla.gnome.org/show_bug.cgi?id=721278 --- diff --git a/src/disks/gduformatvolumedialog.c b/src/disks/gduformatvolumedialog.c index c737cb0..f741ade 100644 --- a/src/disks/gduformatvolumedialog.c +++ b/src/disks/gduformatvolumedialog.c @@ -181,7 +181,8 @@ gdu_format_volume_dialog_show_internal (UDisksClient *client, GdkWindow *foreign_window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), parent_xid); if (!gtk_widget_get_realized (data->dialog)) gtk_widget_realize (data->dialog); - gdk_window_set_transient_for (gtk_widget_get_window (data->dialog), foreign_window); + if (foreign_window != NULL) + gdk_window_set_transient_for (gtk_widget_get_window (data->dialog), foreign_window); } gtk_dialog_set_default_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK); -- cgit v0.9.2 debian/patches/series0000664000000000000000000000023012321501401012014 0ustar # Debian patches for gnome-disk-utility dont-use-libdvdread.patch git_xid_check.patch git_xid_working.patch git_header_update.patch window-height-700px debian/patches/git_xid_working.patch0000664000000000000000000000702012263563742015040 0ustar From 0eb951641aae2740fac8565852ea2291d1007f22 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 09 Jan 2014 00:25:03 +0000 Subject: Make dialog work with --xid again When triggering an async operation from a GApplicationCommandline, we must use g_application_hold/release to ensure the application instance stays around until the operation is done. https://bugzilla.gnome.org/show_bug.cgi?id=721278 --- diff --git a/src/disks/gduapplication.c b/src/disks/gduapplication.c index 4d0938a..8984c56 100644 --- a/src/disks/gduapplication.c +++ b/src/disks/gduapplication.c @@ -265,7 +265,9 @@ gdu_application_command_line (GApplication *_app, } else if (opt_format) { - gdu_format_volume_dialog_show_for_xid (app->client, opt_xid, object_to_select); + g_application_hold (_app); + gdu_format_volume_dialog_show_for_xid (app->client, opt_xid, object_to_select, + (GCallback)g_application_release, _app); } if (opt_restore_disk_image != NULL) diff --git a/src/disks/gduformatvolumedialog.c b/src/disks/gduformatvolumedialog.c index f741ade..2e0ca79 100644 --- a/src/disks/gduformatvolumedialog.c +++ b/src/disks/gduformatvolumedialog.c @@ -33,11 +33,16 @@ typedef struct GtkWidget *contents_box; GtkWidget *create_filesystem_widget; + + GCallback finished_cb; + gpointer cb_data; } FormatVolumeData; static void format_volume_data_free (FormatVolumeData *data) { + if (data->finished_cb) + ((GDestroyNotify) data->finished_cb) (data->cb_data); g_clear_object (&data->parent_window); g_object_unref (data->object); g_object_unref (data->block); @@ -144,13 +149,17 @@ static void gdu_format_volume_dialog_show_internal (UDisksClient *client, GtkWindow *parent_window, gint parent_xid, - UDisksObject *object) + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data) { GduApplication *app = GDU_APPLICATION (g_application_get_default ()); FormatVolumeData *data; gint response; data = g_new0 (FormatVolumeData, 1); + data->finished_cb = finished_cb; + data->cb_data = cb_data; data->parent_window = (parent_window != NULL) ? g_object_ref (parent_window) : NULL; data->object = g_object_ref (object); data->block = udisks_object_get_block (object); @@ -250,9 +259,11 @@ gdu_format_volume_dialog_show_internal (UDisksClient *client, void gdu_format_volume_dialog_show_for_xid (UDisksClient *client, gint xid, - UDisksObject *object) + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data) { - gdu_format_volume_dialog_show_internal (client, NULL, xid, object); + gdu_format_volume_dialog_show_internal (client, NULL, xid, object, finished_cb, cb_data); } void @@ -260,5 +271,5 @@ gdu_format_volume_dialog_show (GduWindow *window, UDisksObject *object) { gdu_format_volume_dialog_show_internal (gdu_window_get_client (window), GTK_WINDOW (window), - -1, object); + -1, object, NULL, NULL); } -- cgit v0.9.2 debian/patches/git_header_update.patch0000664000000000000000000000203712263565052015305 0ustar From b8bbedf7507aba48258685d07d314ee391876cf9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 09 Jan 2014 18:26:34 +0000 Subject: Forgotten header update This was supposed to be in the previous commit. --- diff --git a/src/disks/gduformatvolumedialog.h b/src/disks/gduformatvolumedialog.h index 62a43ef..3721fbb 100644 --- a/src/disks/gduformatvolumedialog.h +++ b/src/disks/gduformatvolumedialog.h @@ -19,7 +19,9 @@ void gdu_format_volume_dialog_show (GduWindow *window, UDisksObject *object); void gdu_format_volume_dialog_show_for_xid (UDisksClient *client, gint xid, - UDisksObject *object); + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data); G_END_DECLS -- cgit v0.9.2 debian/patches/window-height-700px0000664000000000000000000000156012321501633014171 0ustar Description: 900px is too tall. Not all window managers will resize such a window. Use 700. Author: Iain Lane Origin: upstream, dd6c6bd4df9cf71f6e4875125760c1700067fa2d Index: b/src/disks/gduwindow.c =================================================================== --- a/src/disks/gduwindow.c +++ b/src/disks/gduwindow.c @@ -1275,8 +1275,7 @@ gtk_widget_reparent (window->main_hpane, GTK_WIDGET (window)); gtk_window_set_title (GTK_WINDOW (window), _("Disks")); - /* Fortunately the window manager resizes the window if it's too tall for the monitor.. so 900 pixels is fine */ - gtk_window_set_default_size (GTK_WINDOW (window), 800, 900); + gtk_window_set_default_size (GTK_WINDOW (window), 800, 700); gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER); gtk_container_set_border_width (GTK_CONTAINER (window), 12); debian/patches/dont-use-libdvdread.patch0000664000000000000000000006007112243666015015505 0ustar From cb3afaea9c2f61a736871a4881945fb746c8c1ff Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sat, 20 Oct 2012 01:36:48 +0000 Subject: Use libdvdcss for creating disk images of DVDs, if available Without this change, the archive process may fail for some DVD video discs with "Add. Sense: Read of scrambled sector without authentication". This commit does NOT add a hard dependency on libdvdcss (which would be bad as this library isn't even shipped in most OSes) since it's accessed via dlopen(). If libdvdcss is not available on the system, we simply fall back to reading data using the standard libc interfaces (e.g. read(2)). License-wise there is no problem with this approach: libdvdcss is licensed under the GPLv2+ which is exactly the same license as Disks itself. This dlopen() approach is nothing new - it's also used in Brasero, VLC, mplayer, Totem and many other applications. Signed-off-by: David Zeuthen --- Index: gnome-disk-utility-3.10.0/configure.ac =================================================================== --- gnome-disk-utility-3.10.0.orig/configure.ac 2013-11-22 15:36:57.915978999 +0100 +++ gnome-disk-utility-3.10.0/configure.ac 2013-11-22 15:36:57.903978998 +0100 @@ -108,7 +108,6 @@ LIBSECRET1_REQUIRED=0.7 PWQUALITY_REQUIRED=1.0.0 CANBERRA_REQUIRED=0.1 -LIBDVDREAD_REQUIRED=4.2.0 GSD_PLUGIN_REQUIRED=3.6 LIBNOTIFY_REQUIRED=0.7 LIBLZMA_REQUIRED=5.0.5 @@ -119,7 +118,6 @@ PKG_CHECK_MODULES(LIBSECRET1, [libsecret-1 >= $LIBSECRET1_REQUIRED]) PKG_CHECK_MODULES(PWQUALITY, [pwquality >= $PWQUALITY_REQUIRED]) PKG_CHECK_MODULES(CANBERRA, [libcanberra-gtk3 >= $CANBERRA_REQUIRED]) -PKG_CHECK_MODULES(LIBDVDREAD, [dvdread >= $LIBDVDREAD_REQUIRED]) PKG_CHECK_MODULES(GSD_PLUGIN, [gnome-settings-daemon >= $GSD_PLUGIN_REQUIRED]) PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= $LIBNOTIFY_REQUIRED]) PKG_CHECK_MODULES(LIBLZMA, [liblzma >= $LIBLZMA_REQUIRED]) Index: gnome-disk-utility-3.10.0/src/disks/Makefile.am =================================================================== --- gnome-disk-utility-3.10.0.orig/src/disks/Makefile.am 2013-11-22 15:36:57.915978999 +0100 +++ gnome-disk-utility-3.10.0/src/disks/Makefile.am 2013-11-22 15:36:57.903978998 +0100 @@ -50,7 +50,6 @@ gdumdraiddisksdialog.h gdumdraiddisksdialog.c \ gducreateraidarraydialog.h gducreateraidarraydialog.c \ gduerasemultipledisksdialog.h gduerasemultipledisksdialog.c \ - gdudvdsupport.h gdudvdsupport.c \ gdulocaljob.h gdulocaljob.c \ gduxzdecompressor.h gduxzdecompressor.c \ $(enum_built_sources) \ @@ -72,7 +71,6 @@ $(LIBSYSTEMD_LOGIN_CFLAGS) \ $(PWQUALITY_CFLAGS) \ $(CANBERRA_CFLAGS) \ - $(LIBDVDREAD_CFLAGS) \ $(LIBLZMA_CFLAGS) \ $(WARN_CFLAGS) \ -lm \ @@ -86,7 +84,6 @@ $(LIBSYSTEMD_LOGIN_LIBS) \ $(PWQUALITY_LIBS) \ $(CANBERRA_LIBS) \ - $(LIBDVDREAD_LIBS) \ $(LIBLZMA_LIBS) \ $(top_builddir)/src/libgdu/libgdu.la \ $(NULL) Index: gnome-disk-utility-3.10.0/src/disks/gducreatediskimagedialog.c =================================================================== --- gnome-disk-utility-3.10.0.orig/src/disks/gducreatediskimagedialog.c 2013-11-22 15:36:57.915978999 +0100 +++ gnome-disk-utility-3.10.0/src/disks/gducreatediskimagedialog.c 2013-11-22 15:36:57.907978998 +0100 @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -31,8 +32,6 @@ #include "gduestimator.h" #include "gdulocaljob.h" -#include "gdudvdsupport.h" - /* TODOs / ideas for Disk Image creation * * - Be tolerant of I/O errors like dd_rescue(1), see http://www.gnu.org/s/ddrescue/ddrescue.html @@ -76,7 +75,6 @@ GduEstimator *estimator; gboolean allocating_file; - gboolean retrieving_dvd_keys; guint64 num_error_bytes; gint64 start_time_usec; gint64 end_time_usec; @@ -343,10 +341,6 @@ { extra_markup = g_strdup (_("Allocating Disk Image")); } - else if (data->retrieving_dvd_keys) - { - extra_markup = g_strdup (_("Retrieving DVD keys")); - } if (num_error_bytes > 0) { @@ -533,7 +527,6 @@ guint64 size, guchar *buffer, gboolean pad_with_zeroes, - GduDVDSupport *dvd_support, GCancellable *cancellable, GError **error) { @@ -547,45 +540,35 @@ g_return_val_if_fail (-1, cancellable == NULL || G_IS_CANCELLABLE (cancellable)); g_return_val_if_fail (-1, error == NULL || *error == NULL); - if (dvd_support != NULL) + if (lseek (fd, offset, SEEK_SET) == (off_t) -1) { - num_bytes_read = gdu_dvd_support_read (dvd_support, fd, buffer, offset, size); + g_set_error (error, + G_IO_ERROR, g_io_error_from_errno (errno), + "Error seeking to offset %" G_GUINT64_FORMAT ": %s", + offset, strerror (errno)); + goto out; + } + + copy_read_again: + num_bytes_read = read (fd, buffer, size); + if (num_bytes_read < 0) + { + if (errno == EAGAIN || errno == EINTR) + goto copy_read_again; + /* do not consider this an error - treat as zero bytes read */ + num_bytes_read = 0; } else { - if (lseek (fd, offset, SEEK_SET) == (off_t) -1) + /* EOF */ + if (num_bytes_read == 0) { g_set_error (error, - G_IO_ERROR, g_io_error_from_errno (errno), - "Error seeking to offset %" G_GUINT64_FORMAT ": %s", - offset, strerror (errno)); + G_IO_ERROR, G_IO_ERROR_FAILED, + "Reading from offset %" G_GUINT64_FORMAT " returned zero bytes", + offset); goto out; } - read_again: - num_bytes_read = read (fd, buffer, size); - if (num_bytes_read < 0) - { - if (errno == EAGAIN || errno == EINTR) - goto read_again; - } - else - { - /* EOF */ - if (num_bytes_read == 0) - { - g_set_error (error, - G_IO_ERROR, G_IO_ERROR_FAILED, - "Reading from offset %" G_GUINT64_FORMAT " returned zero bytes", - offset); - goto out; - } - } - } - - if (num_bytes_read < 0) - { - /* do not consider this an error - treat as zero bytes read */ - num_bytes_read = 0; } num_bytes_to_write = num_bytes_read; @@ -634,7 +617,6 @@ copy_thread_func (gpointer user_data) { DialogData *data = user_data; - GduDVDSupport *dvd_support = NULL; guchar *buffer_unaligned = NULL; guchar *buffer = NULL; guint64 block_device_size = 0; @@ -659,29 +641,7 @@ */ if (g_str_has_prefix (udisks_block_get_device (data->block), "/dev/sr")) { - const gchar *device_file = udisks_block_get_device (data->block); - fd = open (device_file, O_RDONLY); - - /* Use libdvdcss (if available on the system) on DVDs with UDF - * filesystems - otherwise the backup process may fail because - * of unreadable/scrambled sectors - */ - if (g_strcmp0 (udisks_block_get_id_usage (data->block), "filesystem") == 0 && - g_strcmp0 (udisks_block_get_id_type (data->block), "udf") == 0 && - g_str_has_prefix (udisks_drive_get_media (data->drive), "optical_dvd")) - { - g_mutex_lock (&data->copy_lock); - data->retrieving_dvd_keys = TRUE; - g_mutex_unlock (&data->copy_lock); - g_idle_add (on_update_job, dialog_data_ref (data)); - - dvd_support = gdu_dvd_support_new (device_file, udisks_block_get_size (data->block)); - - g_mutex_lock (&data->copy_lock); - data->retrieving_dvd_keys = FALSE; - g_mutex_unlock (&data->copy_lock); - g_idle_add (on_update_job, dialog_data_ref (data)); - } + fd = open (udisks_block_get_device (data->block), O_RDONLY); } /* Otherwise, request the fd from udisks */ @@ -818,7 +778,6 @@ num_bytes_to_read, buffer, TRUE, /* pad_with_zeroes */ - dvd_support, data->cancellable, &error); if (num_bytes_read < 0) @@ -840,9 +799,6 @@ } out: - if (dvd_support != NULL) - gdu_dvd_support_free (dvd_support); - data->end_time_usec = g_get_real_time (); /* in either case, close the stream */ Index: gnome-disk-utility-3.10.0/src/disks/gdudvdsupport.c =================================================================== --- gnome-disk-utility-3.10.0.orig/src/disks/gdudvdsupport.c 2013-11-22 15:36:57.915978999 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,460 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2008-2013 Red Hat, Inc. - * - * Licensed under GPL version 2 or later. - * - * Author: David Zeuthen - */ - -#include "config.h" - -#include -#include -#include -#include - -#include -#include - -#include "gdudvdsupport.h" - - -/* ---------------------------------------------------------------------------------------------------- */ -/* libdvdcss support - see http://www.videolan.org/developers/libdvdcss.html */ - -#define DVDCSS_BLOCK_SIZE 2048 -#define DVDCSS_READ_DECRYPT (1 << 0) -#define DVDCSS_SEEK_KEY (1 << 1) - -struct dvdcss_s; -typedef struct dvdcss_s* dvdcss_t; - -static dvdcss_t (*dvdcss_open) (const char *psz_target) = NULL; -static int (*dvdcss_close) (dvdcss_t ctx) = NULL; -static int (*dvdcss_seek) (dvdcss_t ctx, - int i_blocks, - int i_flags ) = NULL; -static int (*dvdcss_read) (dvdcss_t ctx, - void *p_buffer, - int i_blocks, - int i_flags ) = NULL; -static int (*dvdcss_readv) (dvdcss_t ctx, - void *p_iovec, - int i_blocks, - int i_flags ) = NULL; -static char * (*dvdcss_error) (dvdcss_t ctx) = NULL; - -static gboolean -have_dvdcss (void) -{ - static gsize once = 0; - static gboolean available = FALSE; - - if (g_once_init_enter (&once)) - { - GModule *module = NULL; - - module = g_module_open ("libdvdcss.so.2", G_MODULE_BIND_LOCAL); - if (module == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_open", (gpointer*) &dvdcss_open) || dvdcss_open == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_close", (gpointer*) &dvdcss_close) || dvdcss_close == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_seek", (gpointer*) &dvdcss_seek) || dvdcss_seek == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_read", (gpointer*) &dvdcss_read) || dvdcss_read == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_readv", (gpointer*) &dvdcss_readv) || dvdcss_readv == NULL) - goto out; - if (!g_module_symbol (module, "dvdcss_error", (gpointer*) &dvdcss_error) || dvdcss_error == NULL) - goto out; - - available = TRUE; - - out: - if (!available) - { - if (module != NULL) - g_module_close (module); - } - g_once_init_leave (&once, (gsize) 1); - } - return available; -} - -/* ---------------------------------------------------------------------------------------------------- */ - -typedef struct Range -{ - guint64 start; - guint64 end; - gboolean scrambled; -} Range; - -static gint -range_compare_func (Range *a, - Range *b) -{ - if (a->start > b->start) - return 1; - else if (a->start < b->start) - return -1; - return 0; -} - -/* ---------------------------------------------------------------------------------------------------- */ - -struct GduDVDSupport -{ - dvd_reader_t *dvd; - dvdcss_t dvdcss; - - gboolean debug; - - Range *ranges; - guint num_ranges; - - Range *last_read_range; -}; - -/* ---------------------------------------------------------------------------------------------------- */ - -GduDVDSupport * -gdu_dvd_support_new (const gchar *device_file, - guint64 device_size) -{ - GduDVDSupport *support = NULL; - guint title; - GList *scrambled_ranges = NULL; - GList *l; - guint64 pos; - GArray *a; - - /* We use dlopen() to access libdvdcss since it's normally not - * shipped (so we can't hard-depend on it) but it may be installed - * on the user's system anyway - */ - if (!have_dvdcss ()) - goto out; - - support = g_new0 (GduDVDSupport, 1); - - if (g_getenv ("GDU_DEBUG") != NULL) - support->debug = TRUE; - - support->dvd = DVDOpen (device_file); - if (support->dvd == NULL) - goto fail; - - support->dvdcss = dvdcss_open (device_file); - if (support->dvdcss == NULL) - goto fail; - - /* It follows from "6.9.1 Constraints imposed on UDF by DVD-Video" - * of the OSTA UDF 2.60 spec (March 1, 2005) that - * - * o Video DVDs are using UDF 1.0.2 - * o Only VOB files are encrypted - * o All VOB files of interest are in the VIDEO_TS/ directory - * o VOB files are at most 2^30 bytes = 1.0 GB - * o VOB files are a single extent. - * o The same key is used everywhere in a VOB files - * - * This means we can simply go through all VOB files in the - * VIDEO_TS/ directory and get their on-disc offset. Then for each - * file, we retrieve the CSS key at said offset. We then build a - * simple array of ranges - * - * {range_start, range_end, range_is_scrambled} - * - * that covers the entire disc. Then when we're reading we can - * consult this array to figure out when to change the key. Since - * keys are cached, no slowdown will happen. - * - * This approach was inspired by Brasero's dvdcss plug-in, see - * - * http://git.gnome.org/browse/brasero/tree/plugins/dvdcss/burn-dvdcss.c?id=BRASERO_3_6_0 - * - * For the 'ls -l VIDEO_TS⁄*.VOB' part, we take advantage of the - * fact that VOB files are in a known format, e.g. title 0 is always - * VIDEO_TS.VOB and title 1 through 99 are always of the form - * VTS_NN_M.VOB where 01 <= N <= 99 and 0 <= M <= 9. This way we can - * simply use libdvdread's UDFFindFile() function on all 991 - * possible filenames... - * - * See http://en.wikipedia.org/wiki/VOB for how VOB files work. - */ - for (title = 0; title <= 99; title++) - { - gint part; - Range *range; - - for (part = 0; part <= 9; part++) - { - gchar vob_filename[64]; - uint32_t vob_sector_offset; - uint32_t vob_size; - guint64 rounded_vob_size; - - if (title == 0) - { - if (part > 0) - break; - snprintf (vob_filename, sizeof vob_filename, "/VIDEO_TS/VIDEO_TS.VOB"); - } - else - { - snprintf (vob_filename, sizeof vob_filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, part); - } - - vob_sector_offset = UDFFindFile (support->dvd, vob_filename, &vob_size); - if (vob_sector_offset == 0) - continue; - - if (dvdcss_seek (support->dvdcss, vob_sector_offset, DVDCSS_SEEK_KEY) != (int) vob_sector_offset) - goto fail; - - if (vob_size == 0) - continue; - - /* round up VOB size to nearest 2048-byte sector */ - rounded_vob_size = vob_size + 0x7ff; - rounded_vob_size &= ~0x7ff; - - range = g_new0 (Range, 1); - range->start = vob_sector_offset * 2048ULL; - range->end = range->start + rounded_vob_size; - range->scrambled = TRUE; - - /*g_print ("%s: %10" G_GUINT64_FORMAT " -> %10" G_GUINT64_FORMAT ": scrambled=%d\n", - vob_filename, range->start, range->end, range->scrambled);*/ - - scrambled_ranges = g_list_prepend (scrambled_ranges, range); - } - } - - /* If there are no VOB files on the disc, we don't need to decrypt - just bail */ - if (scrambled_ranges == NULL) - goto fail; - - /* Otherwise, build an array of ranges - * - * TODO: ensure ranges are not overlapping - */ - scrambled_ranges = g_list_sort (scrambled_ranges, (GCompareFunc) range_compare_func); - a = g_array_new (FALSE, /* zero-terminated */ - FALSE, /* clear */ - sizeof (Range)); - pos = 0; - for (l = scrambled_ranges; l != NULL; l = l->next) - { - Range *range = l->data; - if (pos < range->start) - { - Range unscrambled_range = {0}; - unscrambled_range.start = pos; - unscrambled_range.end = range->start; - g_array_append_val (a, unscrambled_range); - } - g_array_append_val (a, *range); - pos = range->end; - } - if (pos < device_size) - { - Range unscrambled_range = {0}; - unscrambled_range.start = pos; - unscrambled_range.end = device_size; - g_array_append_val (a, unscrambled_range); - } - support->num_ranges = a->len; - support->ranges = (Range*) g_array_free (a, FALSE); - - if (G_UNLIKELY (support->debug)) - { - guint n; - for (n = 0; n < support->num_ranges; n++) - { - Range *range = support->ranges + n; - g_print ("range %02d: %10" G_GUINT64_FORMAT " -> %10" G_GUINT64_FORMAT ": scrambled=%d\n", - n, range->start, range->end, range->scrambled); - } - } - - out: - g_list_free_full (scrambled_ranges, g_free); - return support; - - fail: - gdu_dvd_support_free (support); - support = NULL; - goto out; -} - -void -gdu_dvd_support_free (GduDVDSupport *support) -{ - g_free (support->ranges); - if (support->dvdcss != NULL) - dvdcss_close (support->dvdcss); - if (support->dvd != NULL) - DVDClose (support->dvd); - g_free (support); -} - -/* ---------------------------------------------------------------------------------------------------- */ - -gssize -gdu_dvd_support_read (GduDVDSupport *support, - int fd, - guchar *buffer, - guint64 offset, - guint64 size) -{ - guint n; - gssize ret = -1; - guint64 cur_offset = offset; - guint64 num_left = size; - guchar *cur_buffer = buffer; - - g_assert ((offset & 0x7ff) == 0); - - /* First find the range we're in - * - * Since callers are typically looping sequentially over the entire - * data surface, first check if last used range still works - */ - if (support->last_read_range != NULL && - offset >= support->last_read_range->start && - offset < support->last_read_range->end) - { - n = support->last_read_range - support->ranges; - } - else - { - /* Otherwise look through all ranges, starting form the first */ - for (n = 0; n < support->num_ranges; n++) - { - if (offset >= support->ranges[n].start && - offset < support->ranges[n].end) - break; - } - } - - /* Break the read request into multiple requests not crossing any of - * the ranges... we only want to use dvdcss_read() for the encrypted - * bits - */ - while (num_left > 0) - { - Range *r; - guint64 num_left_in_range; - guint64 num_to_read_in_range; - ssize_t num_bytes_read; - - if (G_UNLIKELY (n == support->num_ranges)) - { - g_warning ("Requested offset %" G_GUINT64_FORMAT " is out of range", offset); - ret = -1; - goto out; - } - - r = support->ranges + n; - - g_assert (cur_offset >= r->start && cur_offset < r->end); - num_left_in_range = r->end - cur_offset; - - num_to_read_in_range = MIN (num_left_in_range, num_left); - - if (G_UNLIKELY (support->debug)) - { - g_print ("reading %" G_GUINT64_FORMAT " from %" G_GUINT64_FORMAT " (scrambled=%d) from range %d\n", - num_to_read_in_range, cur_offset, r->scrambled, n); - } - - /* now read @num_to_read_in_range from @cur_offset into @cur_buffer */ - if (r->scrambled) - { - int flags = 0; - int block_offset = cur_offset / 2048; - int num_blocks_to_request = num_to_read_in_range / 2048; - int num_blocks_read; - - g_assert ((cur_offset & 0x7ff) == 0); - g_assert ((num_to_read_in_range & 0x7ff) == 0); - - /* see if we need to change the key? */ - if (support->last_read_range != r) - { - if (G_UNLIKELY (support->debug)) - { - g_print ("setting CSS key at offset %" G_GUINT64_FORMAT "\n", cur_offset); - } - flags |= DVDCSS_SEEK_KEY; - support->last_read_range = r; - } - - if (dvdcss_seek (support->dvdcss, block_offset, flags) != block_offset) - goto out; - - dvdcss_read_again: - num_blocks_read = dvdcss_read (support->dvdcss, - cur_buffer, - num_blocks_to_request, - DVDCSS_READ_DECRYPT); - if (num_blocks_read < 0) - { - if (errno == EAGAIN || errno == EINTR) - goto dvdcss_read_again; - /* treat as partial read */ - ret = size - num_left; - goto out; - } - if (num_blocks_read == 0) - { - /* treat as partial read */ - ret = size - num_left; - goto out; - } - g_assert (num_blocks_read <= num_blocks_to_request); - num_bytes_read = num_blocks_read * 2048; - } - else - { - if (lseek (fd, cur_offset, SEEK_SET) == (off_t) -1) - goto out; - read_again: - num_bytes_read = read (fd, cur_buffer, num_to_read_in_range); - if (num_bytes_read < 0) - { - if (errno == EAGAIN || errno == EINTR) - goto read_again; - /* treat as partial read */ - ret = size - num_left; - goto out; - } - if (num_bytes_read == 0) - { - /* treat as partial read */ - ret = size - num_left; - goto out; - } - } - - cur_offset += num_bytes_read; - cur_buffer += num_bytes_read; - num_left -= num_bytes_read; - - /* the read could have been partial, in which case we're still in the same range */ - if (cur_offset >= r->end) - n++; - } - - ret = size - num_left; - - out: - return ret; -} - -/* ---------------------------------------------------------------------------------------------------- */ Index: gnome-disk-utility-3.10.0/src/disks/gdudvdsupport.h =================================================================== --- gnome-disk-utility-3.10.0.orig/src/disks/gdudvdsupport.h 2013-11-22 15:36:57.915978999 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2008-2013 Red Hat, Inc. - * - * Licensed under GPL version 2 or later. - * - * Author: David Zeuthen - */ - -#ifndef __GDU_DVD_SUPPORT_H__ -#define __GDU_DVD_SUPPORT_H__ - -#include -#include "gdutypes.h" - -G_BEGIN_DECLS - -GduDVDSupport *gdu_dvd_support_new (const gchar *device_file, - guint64 device_size); - -void gdu_dvd_support_free (GduDVDSupport *support); - -gssize gdu_dvd_support_read (GduDVDSupport *support, - int fd, - guchar *buffer, - guint64 offset, - guint64 size); - -G_END_DECLS - -#endif /* __GDU_DVD_SUPPORT_H__ */ debian/rules0000775000000000000000000000123712243667244010265 0ustar #!/usr/bin/make -f %: dh $@ --with autoreconf,translations override_dh_install: dh_install # when building for Ubuntu, move menu entry from Apps → System Tools # (which Ubuntu tries to avoid) to System → Administration. if dpkg-vendor --is ubuntu; then \ sed -i '/^Categories=/ s/$$/Settings;HardwareSettings;/' debian/gnome-disk-utility/usr/share/applications/*.desktop; \ fi # delete .la files. find $(CURDIR)/debian/gnome-disk-utility/usr \( -name '*.la' -o -name '*.a' \) -delete override_dh_auto_test: override_dh_builddeb: dh_builddeb -- -Zxz override_dh_makeshlibs: dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/gnome-settings-daemon-3.0/ debian/gnome-disk-utility.docs0000664000000000000000000000002512227023614013574 0ustar AUTHORS NEWS README debian/source/0000775000000000000000000000000012227023614010467 5ustar debian/source/format0000664000000000000000000000001412227023614011675 0ustar 3.0 (quilt) debian/watch0000664000000000000000000000017312227023614010221 0ustar version=3 http://ftp.gnome.org/pub/GNOME/sources/gnome-disk-utility/([\d\.]+\d)/ \ gnome-disk-utility-(.*)\.tar\.xz debian/control0000664000000000000000000000262012243666747010614 0ustar Source: gnome-disk-utility Section: admin Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Utopia Maintenance Team Uploaders: Michael Biebl , Martin Pitt , Sjoerd Simons Build-Depends: debhelper (>= 9), pkg-config, dh-autoreconf, dh-translations, gnome-common, libglib2.0-dev (>= 2.31.0), libgtk-3-dev (>= 3.5.8), libudisks2-dev (>= 2.1.1), libsecret-1-dev (>= 0.7), libpwquality-dev (>= 1.0.0), libcanberra-gtk3-dev (>= 0.1), gnome-settings-daemon-dev (>= 3.6), libnotify-dev (>= 0.7), libsystemd-login-dev (>= 44), liblzma-dev (>= 5.0.5), xsltproc, docbook-xsl, intltool Standards-Version: 3.9.4 Vcs-Git: git://git.debian.org/git/pkg-utopia/gnome-disk-utility.git Vcs-Browser: http://git.debian.org/?p=pkg-utopia/gnome-disk-utility.git;a=summary Homepage: http://git.gnome.org/cgit/gnome-disk-utility/ Package: gnome-disk-utility Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, udisks2 (>= 2.1.1), gnome-icon-theme-symbolic Pre-Depends: ${misc:Pre-Depends} Description: manage and configure disk drives and media GNOME Disks is a tool to manage disk drives and media: . * Format and partition drives. * Mount and unmount partitions. * Query S.M.A.R.T. attributes. . It utilizes udisks. debian/gbp.conf0000664000000000000000000000006512227023614010607 0ustar [DEFAULT] pristine-tar = True debian-branch = master debian/gnome-disk-utility.maintscript0000664000000000000000000000013312227023614015201 0ustar rm_conffile /etc/xdg/autostart/gdu-notification-daemon.desktop 3.6.1-1~ gnome-disk-utility debian/copyright0000664000000000000000000000221112227023614011116 0ustar Name: gnome-disk-utility Maintainer: David Zeuthen Source: http://ftp.gnome.org/pub/GNOME/sources/gnome-disk-utility/ Files: * Copyright: 2007-2012 David Zeuthen License: GPL-2+ Files: data/icons/* Copyright: 2008 David Zeuthen License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/changelog0000664000000000000000000003214012321502413011033 0ustar gnome-disk-utility (3.10.0-1ubuntu3) trusty; urgency=medium * debian/patches/window-height-700px: Set window height to 700px; 900 is too small and causes the window to start off screen. -- Iain Lane Thu, 10 Apr 2014 12:29:30 +0100 gnome-disk-utility (3.10.0-1ubuntu2) trusty; urgency=medium * debian/patches/git_xid_check.patch, debian/patches/git_xid_working.patch, debian/patches/git_header_update.patch: - backport fixes to make the nautilus format option work (lp: #1227440) -- Sebastien Bacher Thu, 09 Jan 2014 19:18:32 +0100 gnome-disk-utility (3.10.0-1ubuntu1) trusty; urgency=low * Resynchronize on Debian, remaining changes: * Build-depend on and run dh-translations * debian/control: - Depend on gnome-icon-theme-symbolic * debian/patches/dont-use-libdvdread: - Revert commit that depends on libdvdread since it's in universe -- Sebastien Bacher Fri, 22 Nov 2013 15:26:06 +0100 gnome-disk-utility (3.10.0-1) unstable; urgency=low * New upstream release. * Bump required version of udisks2 to (>= 2.1.1). * Add Build-Depends on liblzma-dev (>= 5.0.5) to get support for restoring XZ compressed disk images. * Remove debian/patches/02-fix-ftbfs-format.patch, merged upstream. * Re-enable gnome-settings-daemon plugin. (Closes: #726334) -- Michael Biebl Mon, 14 Oct 2013 19:18:54 +0200 gnome-disk-utility (3.8.2-3) unstable; urgency=low * Team upload. * debian/patches/02-fix-ftbfs-format.patch: Fix FTBFS on several architectures (cherrypick from upstream) -- Laurent Bigonville Sat, 12 Oct 2013 17:06:45 -0400 gnome-disk-utility (3.8.2-2) unstable; urgency=low * Upload to unstable. * Disable the gnome-setting-daemon plugin for now until we have a recent enough version of gnome-settings-daemon in unstable. * Bump Depends on udisks2 to (>= 2.1.0). -- Michael Biebl Wed, 18 Sep 2013 03:55:18 +0200 gnome-disk-utility (3.8.2-1) experimental; urgency=low * New upstream release. * Bump Standards-Version to 3.9.4. No further changes. * Exclude the g-s-d plugin when running dh_makeshlibs. -- Michael Biebl Fri, 14 Jun 2013 01:21:20 +0200 gnome-disk-utility (3.8.0-1) experimental; urgency=low * Team upload. * Imported Upstream version 3.8.0 * Bump udisks2 build-dependency to >= 2.1.0 according to configure.ac * Add new build-dependencies according to configure.ac - canberra, libdvdread, gnome-settings-daemon, libnotify * Don't ship any *.la files * Bump gsd to >= 3.8 according to https://bugzilla.gnome.org/697146 * Add libsystemd-login-dev build-dependency to enable multiseat support -- Andreas Henriksson Sat, 25 May 2013 16:20:41 +0200 gnome-disk-utility (3.6.1-1) experimental; urgency=low * New upstream release. (Closes: #671494) - Major rewrite. - Renamed to GNOME Disks or simply Disks. - The libgdu library has been removed in favour of libudisks2. * Use xz compression for source tarballs. * Drop all binary packages besides gnome-disk-utility. (Closes: #646204) * Drop all patches, they are obsolete. * Bump debhelper compat level to 9. * Bump Standards-Version to 3.9.3. * Update Build-Depends according to configure.ac. * Make gnome-disk-utility depend on udisks2. * Remove the obsolete /etc/xdg/autostart/gdu-notification-daemon.desktop conffile on upgrades using the dh_installdeb maintscript facility. * Remove obsolete configure switch. * Update package description: palimpsest → GNOME Disks. * Update debian/copyright. -- Michael Biebl Tue, 13 Nov 2012 08:05:15 +0100 gnome-disk-utility (3.0.2-3) unstable; urgency=low [ Ansgar Burchardt ] * debian/rules: Use xz compression for binary packages. (Closes: #683841) -- Michael Biebl Fri, 24 Aug 2012 15:08:55 +0200 gnome-disk-utility (3.0.2-2) unstable; urgency=low * Upload to unstable. * Update debian/libgdu0.symbols. -- Michael Biebl Thu, 13 Oct 2011 18:53:23 +0200 gnome-disk-utility (3.0.2-1) experimental; urgency=low * New upstream release. -- Michael Biebl Fri, 08 Jul 2011 18:55:46 +0200 gnome-disk-utility (3.0.0-2) experimental; urgency=low [ Martin Pitt ] * debian/watch: Update for new upstream URL. [ Michael Biebl ] * Merge changes from unstable branch. * Refresh debian/patches/00git-palimpsest-small-screens.patch. * Avoid partial upgrades involving gnome-disk-utility and libgdu-gtk. Bump the symbol versions in libgdu-gtk0.symbols to 3.0.0 and add Breaks: gnome-disk-utility (<< 3.0.0) to libgdu-gtk0 as a workaround for libgdu-gtk building against GTK3 (which changes its ABI) but not bumping the soname. (Closes: #626821) -- Michael Biebl Fri, 20 May 2011 00:06:40 +0200 gnome-disk-utility (3.0.0-1) experimental; urgency=low * New upstream release * debian/patches/01_delay_autostart.patch: Updated * debian/control: Update build-depends * debian/gbp.conf: Change tarball compression to bz2 * debian/libgdu-dev.install: Don't try to install gtk-doc documentation, it's not available anymore * Update symbols files -- Sjoerd Simons Sat, 14 May 2011 21:33:56 +0100 gnome-disk-utility (2.32.0-1) unstable; urgency=low [ Martin Pitt ] * New upstream release. - Lots of translation updates. - Use accessor functions instead direct access, for GTK 3 compliance. - Nuke gtk-doc usage for now. It was never really set up correctly and it's causing issues with autotools and dist checking. - Note that we keep 00git-palimpsest-small-screens.patch. It was reverted upstream for now, since it is not a perfect solution; but it does improve matters on small screens. [ Michael Biebl ] * Use dpkg-vendor instead of lsb_release. * Stop installing gtk-doc API documentation. It has been removed upstream. - Update debian/libgdu-dev.install. - Drop Conflicts/Replaces from libgdu-dev as it no longer necessary. * Bump debhelper compatibility level to 8. Update Build-Depends accordingly. * Bump Standards-Version to 3.9.2. No further changes. * Switch from cdbs to dh - Drop Build-Depends on cdbs. - Convert debian/rules to use dh. - Override dh_auto_test to disable test suite. - Add debian/gnome-disk-utility.docs. -- Michael Biebl Thu, 19 May 2011 22:51:56 +0200 gnome-disk-utility (2.30.1-2) unstable; urgency=low * Add 00git-palimpsest-small-screens.patch: Add scrollbars to the right pane if the window is smaller than the contents. This makes palimpsest working on small screens. (Closes: #589502, LP: #414107, GNOME #594088) * debian/control: Bump Standards-Version to 3.9.1 (no changes necessary). * Convert source package to "3.0 (quilt)" format. -- Martin Pitt Thu, 19 Aug 2010 14:55:27 +0200 gnome-disk-utility (2.30.1-1) unstable; urgency=low * New upstream release: - Fix crash in gdu_adapter_get_object_path. - Fix broken rendering for some part of application. - Translation updates. -- Michael Biebl Sun, 04 Apr 2010 23:58:54 +0200 gnome-disk-utility (2.30.0-1) unstable; urgency=low * New upstream release. - Various translation updates. - Fix theming for the volume grid widget. - Don't include non-working Help menu item. (Closes: #573910) - Initial support for loop devices. * debian/patches/01_delay_autostart.patch - Don't patch data/gdu-notification-daemon.desktop.in. It's an autogenerated file and will be overwritten anyway. * Update symbols files for new API additions. -- Michael Biebl Tue, 16 Mar 2010 14:56:07 +0100 gnome-disk-utility (2.29.90-2) experimental; urgency=low [ Michael Biebl ] * debian/libgdu-gtk0.symbols - Bump symbol versions to 2.29.90 for all symbols that were added after version 2.28.1. * debian/control - Bump Build-Depends on libglib2.0-dev to (>= 2.22). [ Martin Pitt ] * Move gtk-doc files (which describe the API, not the palimpsest program) from gnome-disk-utility to libgdu-dev. Add an appropriate Conflicts/Replaces. (LP: #517698) -- Martin Pitt Thu, 04 Mar 2010 16:23:53 +0100 gnome-disk-utility (2.29.90-1) experimental; urgency=low * New upstream release. * 01_delay_autostart.patch: Refresh for new release. * debian/libgdu0.symbols: Add new symbol from this release, and bump symbol versions from previous git snapshot versions to 2.29.90. -- Martin Pitt Wed, 24 Feb 2010 00:00:55 +0100 gnome-disk-utility (2.29.0~git20100222.e85476-1) experimental; urgency=low [ Michael Biebl ] * Git snapshot of the upcoming 2.29.0 release: - Port to udisks. - Grid based UI for palimpsest. - Initial support for LVM2. * Remove patches - debian/patches/01-reiserfs-support.patch (merged upstream) - debian/patches/02-link-against-libx11-for-xkb.patch (merged upstream) - debian/patches/99-autoreconf.patch (no longer required) * debian/control - Update package descriptions for the DeviceKit-disks → udisks renaming. - Add Build-Depends on libavahi-ui-dev (>= 0.6.25), and replace devicekit-disks (>= 007) Build-Depends with udisks (>= 1.0.0~). - Replace Depends on devicekit-disks (>= 007) with udisks (>= 1.0.0~), udisks (<< 1.1.0). - Bump Standards-Version to 3.8.4. No further changes. * debian/*.symbols - Update symbols files for libgdu0 and libgdu-gtk0. [ Martin Pitt ] * Add 01_delay_autostart.patch: Delay autostart of the gdu daemon for 10 seconds. It is not needed immediately (thus no need to slow down initial session startup) and is not visible permanently (thus it won't cause visual disruptions later on). This depends on the patch in GNOME #608402, and will be a no-op if that's not available. * debian/control: Move udisks dependency from g-d-u to libgdu0, since it's really the library which talks to it. Otherwise you could not install g-d-u and get crashes in GNOME. (LP: #523634) -- Martin Pitt Tue, 23 Feb 2010 12:04:01 +0100 gnome-disk-utility (2.28.1-3) unstable; urgency=medium * debian/control - Move devicekit-disks dependency from g-d-u to libgdu0, since it's really the library which talks to it. Also, other packages using libgdu0, like gvfs, should not have to add an explicit dependency on devicekit-disks as it's libgdu0's responsibility to depend on the correct backend. -- Michael Biebl Mon, 08 Mar 2010 01:29:57 +0100 gnome-disk-utility (2.28.1-2) unstable; urgency=low * debian/patches/01-reiserfs-support.patch - Add support for ReiserFS. * debian/patches/02-link-against-libx11-for-xkb.patch - Explicitly link against libX11 as g-d-u uses Xkb* functions and it otherwise fails to build with binutils-gold. (Closes: #554650) * debian/patches/99-autoreconf.patch - Run autoreconf for the changes in 02-link-against-libx11-for-xkb.patch. -- Michael Biebl Tue, 17 Nov 2009 13:01:13 -0600 gnome-disk-utility (2.28.1-1) unstable; urgency=low * New upstream bug fix release. * debian/rules: Enable quilt patch system. Add quilt build dependency. -- Martin Pitt Tue, 03 Nov 2009 15:28:15 +0100 gnome-disk-utility (2.28.0-1) unstable; urgency=low * New upstream version: - Port to PolicyKit-1 (which essentially means to drop all the PK code). - Follow GNOME release cycle now. - Lots of bug fixes and translation updates. - Land new ATA SMART user interface (requires DK-disks 007). * debian/control: - Drop old libpolkit*-dev build and binary dependencies. - Bump devicekit-disks build/binary dependency to >= 007. - Bump libgtk2.0-dev and libatasmart-dev build dependencies as required by upstream. - Drop libsexy-dev build dependency, not necessary any more. * debian/control: Add alternative build dependency "rarian-compat", the successor of scrollkeeper. * debian/libgdu0.symbols, debian/libgdu-gtk0.symbols: Update for new release. * debian/control: Bump Standards-Version to 3.8.3 (no changes necessary). * debian/rules: When building for Ubuntu, update palimpsest .desktop's Category field to appear in System → Administration instead of Apps → System Tools. * debian/*.install: Drop debian/tmp/ prefix, since we use dh compat 7. Also, simplify and sort the file lists. * debian/control: Added myself to uploaders, with Michael's consent. -- Martin Pitt Mon, 28 Sep 2009 17:15:02 +0200 gnome-disk-utility (0.3-2) experimental; urgency=low * debian/copyright - Add Name, Maintainer and Source field as recommended by DEP-5. * debian/control - Add missing Build-Depends on gnome-doc-utils, scrollkeeper and libnautilus-extension-dev (>= 2.24). (Closes: #529589) -- Michael Biebl Wed, 20 May 2009 18:27:27 +0200 gnome-disk-utility (0.3-1) experimental; urgency=low * Initial release. (Closes: #521365) -- Michael Biebl Mon, 18 May 2009 10:49:51 +0200