From be94c90d43be82a8311ddc485e0b11984d4ff9cd70a41dd49915d7dbc5ba5ab9 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 24 Feb 2013 22:57:44 +0000 Subject: [PATCH] Restore READCD support 2 OBS-URL: https://build.opensuse.org/package/show/filesystems/libmirage?expand=0&rev=11 --- ...-Parser-readcd-from-cdrtools-appears.patch | 39 +++++++++++++++++++ libmirage.changes | 1 + libmirage.spec | 3 +- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch diff --git a/0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch b/0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch new file mode 100644 index 0000000..019b5ec --- /dev/null +++ b/0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch @@ -0,0 +1,39 @@ +From ce6f8c419a3b6f81d9045a5cf36f625c8a229405 Mon Sep 17 00:00:00 2001 +From: Rok Mandeljc +Date: Sun, 24 Feb 2013 23:46:48 +0100 +Subject: [PATCH] libMirage: READCD Parser: readcd from cdrtools appears to + pad odd TOC lengths to make them even, whereas readcd from + cdrkit does not. Make the .toc validation take this into + account. + +--- + libmirage/src/parsers/image-readcd/image-readcd-parser.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libmirage/src/parsers/image-readcd/image-readcd-parser.c b/libmirage/src/parsers/image-readcd/image-readcd-parser.c +index 9b8a76b..68dc820 100644 +--- a/libmirage/src/parsers/image-readcd/image-readcd-parser.c ++++ b/libmirage/src/parsers/image-readcd/image-readcd-parser.c +@@ -55,7 +55,6 @@ static gboolean mirage_parser_readcd_is_file_valid (MirageParserReadcd *self, GI + return FALSE; + } + +- + /* First 4 bytes of TOC are its header; and first 2 bytes of that indicate + the length */ + g_seekable_seek(G_SEEKABLE(stream), 0, G_SEEK_SET, NULL, NULL); +@@ -70,7 +69,10 @@ static gboolean mirage_parser_readcd_is_file_valid (MirageParserReadcd *self, GI + g_seekable_seek(G_SEEKABLE(stream), 0, G_SEEK_END, NULL, NULL); + file_size = g_seekable_tell(G_SEEKABLE(stream)); + +- if (file_size - 2 == toc_len + 2) { ++ /* readcd from cdrdtools appears to pad odd TOC lengths to make them ++ even, whereas readcd from cdrkit does not. So we account for both ++ cases. */ ++ if ((file_size == 2 + toc_len + 2) || (file_size == 2 + toc_len + 3)) { + return TRUE; + } + +-- +1.7.10.4 + diff --git a/libmirage.changes b/libmirage.changes index dde6b7e..2424d34 100644 --- a/libmirage.changes +++ b/libmirage.changes @@ -2,6 +2,7 @@ Sun Feb 24 20:08:18 UTC 2013 - jengelh@inai.de - Add 0001-libMirage-READCD-Parser-when-verifying-the-file-don-.patch + 0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch to make images created by readcd(1) usable again ------------------------------------------------------------------- diff --git a/libmirage.spec b/libmirage.spec index 17dd453..e34201b 100644 --- a/libmirage.spec +++ b/libmirage.spec @@ -31,6 +31,7 @@ Url: http://cdemu.sf.net/ Source: http://downloads.sf.net/cdemu/%name-%version.tar.bz2 Patch1: 0001-libMirage-CMake-fix-SOVERSION-which-should-be-set-to.patch Patch2: 0001-libMirage-READCD-Parser-when-verifying-the-file-don-.patch +Patch3: 0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake >= 2.8.5 BuildRequires: pkgconfig >= 0.16 @@ -130,7 +131,7 @@ This package provides the GObject Introspection bindings for libmirage. %prep %setup -Tcqa0 -%patch -P 1 -P 2 -p2 +%patch -P 1 -P 2 -P 3 -p2 %build # gir is busted on 12.1