Get rid of the workaround for mtpz debug message by compiling libmtp with --disable-mtpz

This commit is contained in:
Kovid Goyal 2013-11-24 09:44:37 +05:30
parent 89a2900f1b
commit 984c29c1e2
2 changed files with 13 additions and 13 deletions

View File

@ -21,10 +21,11 @@ SITE_PACKAGES = ['PIL', 'dateutil', 'dns', 'PyQt4', 'mechanize',
QTDIR = '/usr/lib/qt4'
QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml', 'QtWebKit', 'QtDBus', 'QtXmlPatterns')
MAGICK_PREFIX = '/usr'
is64bit = platform.architecture()[0] == '64bit'
binary_includes = [
'/usr/bin/pdftohtml',
'/usr/bin/pdfinfo',
'/usr/lib/libusb-1.0.so.0',
'/usr/lib/libusb-1.0.so.0' if is64bit else '/lib/libusb-1.0.so.0',
'/usr/lib/libmtp.so.9',
'/usr/lib/libglib-2.0.so.0',
'/usr/bin/pdftoppm',
@ -69,7 +70,6 @@ binary_includes = [
]
binary_includes += [os.path.join(QTDIR, 'lib%s.so.4'%x) for x in QTDLLS]
is64bit = platform.architecture()[0] == '64bit'
arch = 'x86_64' if is64bit else 'i686'

View File

@ -725,18 +725,18 @@ initlibmtp(void) {
// Redirect stdout to get rid of the annoying message about mtpz. Really,
// who designs a library without anyway to control/redirect the debugging
// output, and hardcoded paths that cannot be changed?
int bak, new;
fprintf(stdout, "\n"); // This is needed, without it, for some odd reason the code below causes stdout to buffer all output after it is restored, rather than using line buffering, and setlinebuf does not work.
fflush(stdout);
bak = dup(STDOUT_FILENO);
new = open("/dev/null", O_WRONLY);
dup2(new, STDOUT_FILENO);
close(new);
// output, and hardcoded paths that cannot be changed? Compiling libmtp without the crypt use flag disables mtpz support in libmtp
/* int bak, new; */
/* fprintf(stdout, "\n"); // This is needed, without it, for some odd reason the code below causes stdout to buffer all output after it is restored, rather than using line buffering, and setlinebuf does not work. */
/* fflush(stdout); */
/* bak = dup(STDOUT_FILENO); */
/* new = open("/dev/null", O_WRONLY); */
/* dup2(new, STDOUT_FILENO); */
/* close(new); */
LIBMTP_Init();
fflush(stdout);
dup2(bak, STDOUT_FILENO);
close(bak);
/* fflush(stdout); */
/* dup2(bak, STDOUT_FILENO); */
/* close(bak); */
LIBMTP_Set_Debug(LIBMTP_DEBUG_NONE);