Bump to file 5.28 74/77174/2 submit/tizen_base/20160629.051908 submit/tizen_base/20160720.022352
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 29 Jun 2016 04:08:21 +0000 (13:08 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Wed, 29 Jun 2016 05:11:28 +0000 (14:11 +0900)
[Model] ALL
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] Bump to file 5.28
[Cause & Measure] Bump to file 5.28
[Checking Method] N/A

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: I7dd77b07335b3544a509fb7359a0f3ce0cd9bc16
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
packaging/file.spec
packaging/python-magic-rpmlintrc [new file with mode: 0644]
packaging/python-magic.spec
python/magic.py
src/readcdf.c

index 8ddd7bc..90bca5b 100644 (file)
@@ -5,7 +5,7 @@ BuildRequires:  findutils
 BuildRequires:  libtool
 BuildRequires:  zlib-devel
 Url:            http://www.darwinsys.com/file/
-Version:        5.18
+Version:        5.28
 Release:        0
 Summary:        A Tool to Determine File Types
 License:        BSD-2-Clause
diff --git a/packaging/python-magic-rpmlintrc b/packaging/python-magic-rpmlintrc
new file mode 100644 (file)
index 0000000..1b4d915
--- /dev/null
@@ -0,0 +1 @@
+addFilter("E: non-standard-group");
index 0f7c422..fe32d44 100644 (file)
@@ -5,9 +5,10 @@ Name:           python-magic
 BuildRequires:  findutils
 BuildRequires:  libtool
 BuildRequires:  python-devel
+BuildRequires:  python-setuptools
 BuildRequires:  zlib-devel
 Url:            http://www.darwinsys.com/file/
-Version:        5.18
+Version:        5.28
 Release:        0
 Summary:        Python module to use libmagic
 License:        BSD-3-Clause and BSD-4-Clause
index 3c7a1b2..c48f7d5 100644 (file)
@@ -123,11 +123,18 @@ class Magic(object):
         as a filename or None if an error occurred and the MAGIC_ERROR flag
         is set.  A call to errno() will return the numeric error code.
         """
-        try: # attempt python3 approach first
-            bi = bytes(filename, 'utf-8')
-            return str(_file(self._magic_t, bi), 'utf-8')
-        except:
-            return _file(self._magic_t, filename)
+        if isinstance(filename, bytes):
+            bi = filename
+        else:
+            try:  # keep Python 2 compatibility
+                bi = bytes(filename, 'utf-8')
+            except TypeError:
+                bi = bytes(filename)
+        r = _file(self._magic_t, bi)
+        if isinstance(r, str):
+            return r
+        else:
+            return str(r).encode('utf-8')
 
     def descriptor(self, fd):
         """
index 9883045..f62dad4 100644 (file)
@@ -26,7 +26,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.42 2014/05/07 10:13:12 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -80,7 +80,7 @@ static const struct cv {
        const char *mime;
 } clsid2mime[] = {
        {
-               { 0x00000000000c1084LLU, 0x46000000000000c0LLU  },
+               { 0x00000000000c1084ULL, 0x46000000000000c0ULL  },
                "x-msi",
        },
        {       { 0,                     0                      },
@@ -88,7 +88,7 @@ static const struct cv {
        },
 }, clsid2desc[] = {
        {
-               { 0x00000000000c1084LLU, 0x46000000000000c0LLU  },
+               { 0x00000000000c1084ULL, 0x46000000000000c0ULL  },
                "MSI Installer",
        },
        {       { 0,                     0                      },