[DRE-commits] [ruby-magic] 01/01: Fix code and test assumptions to work with newer libmagic versions
Antonio Terceiro
terceiro at moszumanska.debian.org
Mon Mar 31 15:50:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-magic.
commit 2d14142622b6dd6081e7dac959fa735a7a255d14
Author: Antonio Terceiro <terceiro at debian.org>
Date: Mon Mar 31 12:00:30 2014 -0300
Fix code and test assumptions to work with newer libmagic versions
---
debian/changelog | 9 +++++++++
debian/patches/fix-against-new-libmagic.diff | 23 +++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 33 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 06137d7..8cf7b74 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+ruby-magic (0.2.6-3) UNRELEASED; urgency=medium
+
+ * Team upload.
+ * Fix code and test assumptions to work with newer libmagic versions
+ Patch: debian/patches/fix-against-new-libmagic.diff
+ (Closes: #741815)
+
+ -- Antonio Terceiro <terceiro at debian.org> Mon, 31 Mar 2014 11:58:12 -0300
+
ruby-magic (0.2.6-2) unstable; urgency=low
* Team upload.
diff --git a/debian/patches/fix-against-new-libmagic.diff b/debian/patches/fix-against-new-libmagic.diff
new file mode 100644
index 0000000..2bdcbb3
--- /dev/null
+++ b/debian/patches/fix-against-new-libmagic.diff
@@ -0,0 +1,23 @@
+--- a/lib/magic/database.rb
++++ b/lib/magic/database.rb
+@@ -29,6 +29,9 @@ module Magic
+
+ # Determine type of a file at given path
+ def file(filename)
++ if !File.exists?(filename)
++ raise Exception, "#{filename}: No such file or directory"
++ end
+ result = Api.magic_file(@magic_set, filename.to_s)
+ if result.null?
+ raise Exception, error
+--- a/test/test_magic.rb
++++ b/test/test_magic.rb
+@@ -38,7 +38,7 @@ class TestMagic < Test::Unit::TestCase
+ end
+
+ test "guess filelogo.jpg mime with empty database" do
+- assert_equal "application/octet-stream; charset=binary", Magic.guess_file_mime(fixture("filelogo.jpg"), :database => fixture("magic_empty"))
++ assert_equal "binary; charset=binary", Magic.guess_file_mime(fixture("filelogo.jpg"), :database => fixture("magic_empty"))
+ end
+
+ test "guess with block" do
diff --git a/debian/patches/series b/debian/patches/series
index 73d56bf..2f8b89c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-remove-rubygems-usage-require-test_declarative.patch
0001-Fix-Magic.guess_string_mime_encoding.patch
+fix-against-new-libmagic.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-magic.git
More information about the Pkg-ruby-extras-commits
mailing list