Date: Saturday, December 29, 2012 @ 12:22:11 Author: andrea Revision: 173953
upgpkg: nepomuk-core 4.9.95-2 Fix the nepomukindexer segfault when indexing JPEG files Added: nepomuk-core/kde-unstable/fix-segfault.patch Modified: nepomuk-core/kde-unstable/PKGBUILD --------------------+ PKGBUILD | 15 +++- fix-segfault.patch | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2012-12-29 16:02:27 UTC (rev 173952) +++ PKGBUILD 2012-12-29 17:22:11 UTC (rev 173953) @@ -3,17 +3,24 @@ pkgname=nepomuk-core pkgver=4.9.95 -pkgrel=1 +pkgrel=2 pkgdesc="Contains the central Nepomuk services like file indexing, file system monitoring, query, storage, client libraries" url="https://projects.kde.org/projects/kde/kdelibs/nepomuk-core" arch=('i686' 'x86_64') license=('GPL' 'LGPL' 'FDL') depends=('kdelibs' 'poppler-qt' 'taglib' 'ffmpeg') makedepends=('cmake' 'automoc4' 'doxygen') -source=("http://download.kde.org/unstable/${pkgver}/src/${pkgname}-${pkgver}.tar.xz") -sha1sums=('98bee83019e469e28772da24cbec05d7744e6e44') +source=("http://download.kde.org/unstable/${pkgver}/src/${pkgname}-${pkgver}.tar.xz" + 'fix-segfault.patch') +sha1sums=('98bee83019e469e28772da24cbec05d7744e6e44' + 'de0588164a4ae3ea89278675564a55e7e78ae4aa') build() { + cd ${pkgname}-${pkgver} + # KDEBUG#312148 + patch -p1 -i "${srcdir}"/fix-segfault.patch + cd ../ + mkdir build cd build cmake ../${pkgname}-${pkgver} \ @@ -30,3 +37,5 @@ sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \ "${pkgdir}"/usr/bin/nepomuk-simpleresource-rcgen } +sha1sums=('98bee83019e469e28772da24cbec05d7744e6e44' + 'cfb1420dee81922e13952f81c0dde3450e99cf02') Added: fix-segfault.patch =================================================================== --- fix-segfault.patch (rev 0) +++ fix-segfault.patch 2012-12-29 17:22:11 UTC (rev 173953) @@ -0,0 +1,188 @@ +--- a/services/fileindexer/indexer/exiv2extractor.cpp ++++ b/services/fileindexer/indexer/exiv2extractor.cpp +@@ -63,19 +63,45 @@ + } + + namespace { ++ QString toString(const Exiv2::Value& value) { ++ std::string str = value.toString(); ++ return QString::fromUtf8( str.c_str(), str.length() ); ++ } ++ + QVariant toVariantLong(const Exiv2::Value& value) { +- qlonglong l = value.toLong(); +- return QVariant(l); ++ if( value.typeId() == Exiv2::unsignedLong || value.typeId() == Exiv2::signedLong ) { ++ qlonglong val = value.toLong(); ++ return QVariant( val ); ++ } ++ ++ QString str( toString(value) ); ++ bool ok = false; ++ int val = str.toInt(&ok); ++ if( ok ) ++ return QVariant( val ); ++ ++ return QVariant(); + } + + QVariant toVariantFloat(const Exiv2::Value& value) { +- double f = value.toFloat(); +- return QVariant(f); ++ if( value.typeId() == Exiv2::tiffFloat || value.typeId() == Exiv2::tiffDouble ) ++ return QVariant( value.toFloat() ); ++ ++ QString str( toString(value) ); ++ bool ok = false; ++ float val = str.toFloat(&ok); ++ if( ok ) ++ return QVariant( val ); ++ ++ return QVariant(); + } + + QVariant toVariantString(const Exiv2::Value& value) { +- std::string str = value.toString(); +- return QVariant( QString::fromUtf8( str.c_str(), str.length() ) ); ++ QString str = toString(value); ++ if( !str.isEmpty() ) ++ return QVariant( str ); ++ ++ return QVariant(); + } + } + +@@ -122,27 +148,37 @@ + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.Flash") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::flash(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::flash(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.PixelXDimension") ); + if( it != data.end() ) { +- fileRes.setProperty( NFO::width(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NFO::width(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.PixelYDimension") ); + if( it != data.end() ) { +- fileRes.setProperty( NFO::height(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NFO::height(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Image.Make") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::make(), toVariantString( it->value() ) ); ++ QVariant value = toVariantString( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::make(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Image.Model") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::model(), toVariantString( it->value() ) ); ++ QVariant value = toVariantString( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::model(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Image.DateTime") ); +@@ -153,57 +189,79 @@ + + it = data.findKey( Exiv2::ExifKey("Exif.Image.Orientation") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::orientation(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::orientation(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.FocalLength") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::focalLength(), toVariantFloat( it->value() ) ); ++ QVariant value = toVariantFloat( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::focalLength(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.FocalLengthIn35mmFilm") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::focalLengthIn35mmFilm(), toVariantFloat( it->value() ) ); ++ QVariant value = toVariantFloat( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::focalLengthIn35mmFilm(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.ExposureTime") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::exposureTime(), toVariantFloat( it->value() ) ); ++ QVariant value = toVariantFloat( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::exposureTime(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.ApertureValue") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::apertureValue(), toVariantFloat( it->value() ) ); ++ QVariant value = toVariantFloat( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::apertureValue(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.ExposureBiasValue") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::exposureBiasValue(), toVariantFloat( it->value() ) ); ++ QVariant value = toVariantFloat( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::exposureBiasValue(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.WhiteBalance") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::whiteBalance(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::whiteBalance(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.MeteringMode") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::meteringMode(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::meteringMode(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.ISOSpeedRatings") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::isoSpeedRatings(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::isoSpeedRatings(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.Saturation") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::saturation(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::saturation(), value ); + } + + it = data.findKey( Exiv2::ExifKey("Exif.Photo.Sharpness") ); + if( it != data.end() ) { +- fileRes.setProperty( NEXIF::sharpness(), toVariantLong( it->value() ) ); ++ QVariant value = toVariantLong( it->value() ); ++ if( !value.isNull() ) ++ fileRes.setProperty( NEXIF::sharpness(), value ); + } + + fileRes.addType( NEXIF::Photo() );
