rev 18384 - in kde-extras/k3b/trunk/debian: . patches
Fathi Boudra
fabo at alioth.debian.org
Sun Jun 20 17:51:45 UTC 2010
Author: fabo
Date: 2010-06-20 17:51:37 +0000 (Sun, 20 Jun 2010)
New Revision: 18384
Added:
kde-extras/k3b/trunk/debian/patches/01_dvd+rw-tools_format_parse_version.diff
kde-extras/k3b/trunk/debian/patches/02_dvd+rw-tools_format_parse_copyright.diff
kde-extras/k3b/trunk/debian/patches/03_dvd+rw-tools_booktype_parse_version.diff
Removed:
kde-extras/k3b/trunk/debian/patches/102_rename_dvd+rw-tools.diff
Modified:
kde-extras/k3b/trunk/debian/changelog
kde-extras/k3b/trunk/debian/patches/series
Log:
* Remove 102_rename_dvd+rw-tools.diff patch - useless.
* Add patches to improve dvd+rw-tools output parsing functions:
- 01_dvd+rw-tools_format_parse_version.diff
- 02_dvd+rw-tools_format_parse_copyright.diff
- 03_dvd+rw-tools_booktype_parse_version.diff
Modified: kde-extras/k3b/trunk/debian/changelog
===================================================================
--- kde-extras/k3b/trunk/debian/changelog 2010-06-20 09:57:45 UTC (rev 18383)
+++ kde-extras/k3b/trunk/debian/changelog 2010-06-20 17:51:37 UTC (rev 18384)
@@ -2,6 +2,11 @@
* New upstream release.
* Update debian/k3b-i18n.install: handbook moved to userbase.kde.org.
+ * Remove 102_rename_dvd+rw-tools.diff patch.
+ * Add patches to improve dvd+rw-tools output parsing functions:
+ - 01_dvd+rw-tools_format_parse_version.diff
+ - 02_dvd+rw-tools_format_parse_copyright.diff
+ - 03_dvd+rw-tools_booktype_parse_version.diff
-- Fathi Boudra <fabo at debian.org> Fri, 18 Jun 2010 21:25:46 +0300
Added: kde-extras/k3b/trunk/debian/patches/01_dvd+rw-tools_format_parse_version.diff
===================================================================
--- kde-extras/k3b/trunk/debian/patches/01_dvd+rw-tools_format_parse_version.diff (rev 0)
+++ kde-extras/k3b/trunk/debian/patches/01_dvd+rw-tools_format_parse_version.diff 2010-06-20 17:51:37 UTC (rev 18384)
@@ -0,0 +1,54 @@
+Description: parse dvd+rw-format output using a QStringList instead of QRegExp.
+ It simplifies DvdformatProgram::parseVersion() implementation.
+Author: Fathi Boudra <fabo at kde.org>
+
+--- a/libk3b/core/k3bdefaultexternalprograms.cpp
++++ b/libk3b/core/k3bdefaultexternalprograms.cpp
+@@ -22,7 +22,7 @@
+ #include <QDir>
+ #include <QFile>
+ #include <QFileInfo>
+-#include <QRegExp>
++#include <QStringList>
+ #include <QTextStream>
+
+ #include <KDebug>
+@@ -470,24 +470,21 @@ K3b::DvdformatProgram::DvdformatProgram(
+
+ K3b::Version K3b::DvdformatProgram::parseVersion( const QString& output, const ExternalBin& /*bin*/ ) const
+ {
+- // different locales make searching for the +- char difficult
+- // so we simply ignore it.
+- int pos = output.indexOf( QRegExp("DVD.*RW(/-RAM)? format utility") );
+- if( pos < 0 )
+- return Version();
+-
+- pos = output.indexOf( "version", pos );
+- if( pos < 0 )
+- return Version();
+-
+- pos += 8;
+-
+- // the version ends in a dot.
+- int endPos = output.indexOf( QRegExp("\\.\\D"), pos );
+- if( endPos < 0 )
+- return Version();
++ QString version;
++ // extract fields
++ QStringList outputList = output.split( " " );
++
++ for (int i = 0; i < outputList.size(); ++i) {
++ if ( outputList.at( i ) == "version" ) {
++ // extract version number
++ version = outputList.at( i + 1 );
++ // remove dot and spaces found at the end of the version
++ version = version.left( version.size() - 3 );
++ return version;
++ }
++ }
+
+- return output.mid( pos, endPos-pos );
++ return Version();
+ }
+
+ QString K3b::DvdformatProgram::parseCopyright( const QString& /*output*/, const ExternalBin& /*bin*/ ) const
Added: kde-extras/k3b/trunk/debian/patches/02_dvd+rw-tools_format_parse_copyright.diff
===================================================================
--- kde-extras/k3b/trunk/debian/patches/02_dvd+rw-tools_format_parse_copyright.diff (rev 0)
+++ kde-extras/k3b/trunk/debian/patches/02_dvd+rw-tools_format_parse_copyright.diff 2010-06-20 17:51:37 UTC (rev 18384)
@@ -0,0 +1,32 @@
+Description: avoid hardcoded author e-mail address in dvd+rw-format copyright string.
+Author: Fathi Boudra <fabo at kde.org>
+
+--- a/libk3b/core/k3bdefaultexternalprograms.cpp
++++ b/libk3b/core/k3bdefaultexternalprograms.cpp
+@@ -487,10 +487,23 @@ K3b::Version K3b::DvdformatProgram::pars
+ return Version();
+ }
+
+-QString K3b::DvdformatProgram::parseCopyright( const QString& /*output*/, const ExternalBin& /*bin*/ ) const
++
++QString K3b::DvdformatProgram::parseCopyright( const QString& output, const ExternalBin& /*bin*/ ) const
+ {
+- // fixed Copyright:
+- return QLatin1String( "Andy Polyakov <appro at fy.chalmers.se>" );
++ QString copyright = "Andy Polyakov ";
++ // extract fields
++ QStringList outputList = output.split( " " );
++
++ for (int i = 0; i < outputList.size(); ++i) {
++ if ( outputList.at( i ) == "by" ) {
++ // add missing author name
++ copyright.append( outputList.at( i + 1 ) );
++ // remove dot found at the end of the version
++ copyright = copyright.left( copyright.size() - 1 );
++ }
++ }
++
++ return copyright;
+ }
+
+
Added: kde-extras/k3b/trunk/debian/patches/03_dvd+rw-tools_booktype_parse_version.diff
===================================================================
--- kde-extras/k3b/trunk/debian/patches/03_dvd+rw-tools_booktype_parse_version.diff (rev 0)
+++ kde-extras/k3b/trunk/debian/patches/03_dvd+rw-tools_booktype_parse_version.diff 2010-06-20 17:51:37 UTC (rev 18384)
@@ -0,0 +1,17 @@
+Description: it makes sense to create a dummy version based on real data.
+Author: Fathi Boudra <fabo at kde.org>
+
+--- a/libk3b/core/k3bdefaultexternalprograms.cpp
++++ b/libk3b/core/k3bdefaultexternalprograms.cpp
+@@ -519,8 +519,9 @@ K3b::Version K3b::DvdBooktypeProgram::pa
+ if( pos < 0 )
+ return Version();
+
+- // No version information. Create dummy version
+- return K3b::Version( 1, 0, 0 );
++ // dvd+rw-booktype does not have version information
++ // create dummy version based on latest release (05-Mar-2008)
++ return K3b::Version( 7, 1 );
+ }
+
+
Modified: kde-extras/k3b/trunk/debian/patches/series
===================================================================
--- kde-extras/k3b/trunk/debian/patches/series 2010-06-20 09:57:45 UTC (rev 18383)
+++ kde-extras/k3b/trunk/debian/patches/series 2010-06-20 17:51:37 UTC (rev 18384)
@@ -1,5 +1,7 @@
+01_dvd+rw-tools_format_parse_version.diff
+02_dvd+rw-tools_format_parse_copyright.diff
+03_dvd+rw-tools_booktype_parse_version.diff
101_rename_normalize.diff
-#102_rename_dvd+rw-tools.diff
104_dont_require_suid_cdrecord_or_cdrdao.diff
110_disable_no_problems_found_popup.diff
111_advice_debian_libk3b3-extracodes.diff
More information about the pkg-kde-commits
mailing list