Your message dated Sat, 04 Jun 2011 10:48:22 +0000
with message-id <e1qsop0-0008lm...@franck.debian.org>
and subject line Bug#609674: fixed in kdevelop 4:4.2.2-1
has caused the Debian Bug report #609674,
regarding kdevelop: does not correct parse CMake (GLOB and GLOB_RECURSE)
variables
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
609674: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609674
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: kdevelop
Version: 4:4.0.1-1.1
Severity: normal
Tags: squeeze
Incorrect parse CMake FILE command if there is GLOB or GLOB_RECURSE, like
this:
FILE(GLOB_RECURSE SOURCES "../../../src/*.cpp" )
This issue is already fixed in 4.1.2 and 4.2 branches of kdevelop
(http://git.reviewboard.kde.org/r/100283/)
In attach patch witch fix this issue.
It is little bit adapted to 4.0 branch.
I test and use it :) Please commit it(or rework original patch) to testing :)
-- System Information:
Debian Release: 6.0
APT prefers testing
APT policy: (500, 'testing'), (111, 'unstable'), (110, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=uk_UA.UTF-8, LC_CTYPE=uk_UA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages kdevelop depends on:
ii kdebase-runtime 4:4.4.5-1 runtime components from the offici
ii kdevelop-data 4:4.0.1-1.1 data files for the KDevelop IDE
ii kdevplatform1-libs 1.0.1-1 shared libraries for the KDevelop
ii lcov 1.8-2 Summarise Code coverage
informatio
ii libc6 2.11.2-7 Embedded GNU C Library: Shared
lib
ii libgcc1 1:4.4.5-8 GCC support library
ii libkdecore5 4:4.4.5-2 the KDE Platform Core Library
ii libkdeui5 4:4.4.5-2 the KDE Platform User Interface
Li
ii libkio5 4:4.4.5-2 the Network-enabled File
Managemen
ii libkparts4 4:4.4.5-2 the Framework for the KDE
Platform
ii libktexteditor4 4:4.4.5-2 the KTextEditor interfaces for
the
ii libprocessui4a 4:4.4.5-6 library for ksysguard process
user
ii libqt4-dbus 4:4.6.3-4 Qt 4 D-Bus module
ii libqt4-help 4:4.6.3-4 Qt 4 help module
ii libqt4-network 4:4.6.3-4 Qt 4 network module
ii libqt4-script 4:4.6.3-4 Qt 4 script module
ii libqt4-webkit 4:4.6.3-4 Qt 4 WebKit module
ii libqtcore4 4:4.6.3-4 Qt 4 core module
ii libqtgui4 4:4.6.3-4 Qt 4 GUI module
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libsublime1 1.0.1-1 an user interface library
ii libthreadweaver4 4:4.4.5-2 the ThreadWeaver Library for the
K
Versions of packages kdevelop recommends:
ii gdb 7.0.1-2+b1 The GNU Debugger
ii valgrind 1:3.6.0~svn11254+nmu1 A memory debugger and profiler
Versions of packages kdevelop suggests:
ii cmake 2.8.2-2 a cross-platform, open-source
make
ii kdevelop-l10n-uk [kdevelop-l 4:4.0.1-1.1 Ukrainian (uk) localization files
-- no debconf information
diff --git a/projectmanagers/cmake/parser/cmakeast.cpp b/projectmanagers/cmake/parser/cmakeast.cpp
index 7e40013..2b6bc5d 100644
--- a/projectmanagers/cmake/parser/cmakeast.cpp
+++ b/projectmanagers/cmake/parser/cmakeast.cpp
@@ -1080,9 +1080,26 @@ bool FileAst::parseFunctionInfo( const CMakeFunctionDesc& func )
addOutputArgument(func.arguments[2]);
break;
case Glob:
+ addOutputArgument(func.arguments[1]);
+ m_variable = func.arguments[1].value;
+ it=func.arguments.constBegin()+2;
+ itEnd=func.arguments.constEnd();
+
+ for(; it!=itEnd; ++it) {
+ if(it->value=="RELATIVE") {
+ it++;
+ if(it==itEnd)
+ return false;
+ else
+ m_path = it->value;
+ } else
+ m_globbingExpressions << it->value;
+ }
+ break;
case GlobRecurse:
addOutputArgument(func.arguments[1]);
m_variable = func.arguments[1].value;
+ m_isFollowingSymlinks = false;
it=func.arguments.constBegin()+2;
itEnd=func.arguments.constEnd();
@@ -1093,6 +1110,8 @@ bool FileAst::parseFunctionInfo( const CMakeFunctionDesc& func )
return false;
else
m_path = it->value;
+ } else if(it->value=="FOLLOW_SYMLINKS") {
+ m_isFollowingSymlinks = true;
} else
m_globbingExpressions << it->value;
}
diff --git a/projectmanagers/cmake/parser/cmakeast.h b/projectmanagers/cmake/parser/cmakeast.h
index 54a52d0..a305f7d 100644
--- a/projectmanagers/cmake/parser/cmakeast.h
+++ b/projectmanagers/cmake/parser/cmakeast.h
@@ -252,6 +252,7 @@ CMAKE_ADD_AST_MEMBER( QString, variable )
CMAKE_ADD_AST_MEMBER( QString, directory )
CMAKE_ADD_AST_MEMBER( QString, message )
CMAKE_ADD_AST_MEMBER( QStringList, globbingExpressions )
+CMAKE_ADD_AST_MEMBER( bool, isFollowingSymlinks )
CMAKE_ADD_AST_MEMBER( QStringList, directories )
CMAKE_ADD_AST_MEMBER( KUrl, url )
diff --git a/projectmanagers/cmake/parser/cmakedebugvisitor.cpp b/projectmanagers/cmake/parser/cmakedebugvisitor.cpp
index 03a0d8c..09a6854 100644
--- a/projectmanagers/cmake/parser/cmakedebugvisitor.cpp
+++ b/projectmanagers/cmake/parser/cmakedebugvisitor.cpp
@@ -96,7 +96,7 @@ int CMakeAstDebugVisitor::visit( const MessageAst * ast )
int CMakeAstDebugVisitor::visit( const FileAst * ast )
{
- WRITEOUT << "FILE: " << "(type,variable,directory,path,globbingExpressions,message,directories) = (" << ast->type() << "," << ast->variable() << "," << ast->directory() << "," << ast->path() << "," << ast->globbingExpressions() << "," << ast->message() << "," << ast->directories() << ")";
+ WRITEOUT << "FILE: " << "(type,variable,directory,path,globbingExpressions,message,directories,followSymlinks) = (" << ast->type() << "," << ast->variable() << "," << ast->directory() << "," << ast->path() << "," << ast->globbingExpressions() << "," << ast->message() << "," << ast->directories() << "," << ast->isFollowingSymlinks() << ")";
return 1;
}
diff --git a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
index e2f16d1..96bc00c 100644
--- a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
+++ b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
@@ -1396,53 +1396,52 @@ int CMakeProjectVisitor::visit(const FileAst *file)
kDebug(9042) << "FileAst: read ";
}
break;
- case FileAst::Glob: {
+ case FileAst::Glob:
+ case FileAst::GlobRecurse: {
QStringList matches;
- QString relative=file->path();
- foreach(const QString& glob, file->globbingExpressions())
+ foreach(QString expr, file->globbingExpressions())
{
- QStringList globs;
- QString current;
- if(KUrl::isRelativeUrl(glob)) {
- KUrl urlGlob(glob);
- current=urlGlob.upUrl().path();
-
- globs.append(urlGlob.fileName());
- } else if(!relative.isEmpty()) {
- current=relative;
- globs.append(glob);
- } else {
- current=m_vars->value("CMAKE_CURRENT_SOURCE_DIR").first();
- globs.append(glob);
- }
-
- QDir d(current);
- matches+=d.entryList(globs, QDir::NoDotAndDotDot | QDir::AllEntries);
+ if (expr.isEmpty())
+ continue;
+ QString startPath;
+ if (QDir::isRelativePath(expr))
+ startPath = m_vars->value("CMAKE_CURRENT_SOURCE_DIR").first();
+ // startPath must start from '/' if not empty when calling traverseRecursiveGlob()
+ if (expr[0] == '/')
+ {
+ //moving slash to startPath (it should be empty before)
+ expr = expr.mid(1);
+ startPath += '/';
+ }
+ else
+ {
+ if (!startPath.isEmpty())
+ startPath += '/';
+ }
+ if (file->type() == FileAst::Glob)
+ {
+ matches.append(traverseGlob(startPath, expr));
+ }
+ else
+ {
+ matches.append(traverseGlob(startPath, expr, true, file->isFollowingSymlinks()));
+ }
}
- m_vars->insert(file->variable(), matches);
- kDebug(9042) << "file glob" << file->path() << file->globbingExpressions() << matches;
- } break;
- case FileAst::GlobRecurse: {
- QString current;
- if(file->path().isEmpty())
- current=m_vars->value("CMAKE_CURRENT_SOURCE_DIR").first();
- else
- current=file->path();
- QQueue<QString> candidates;
- candidates.enqueue(current);
- QStringList directories;
- while(!candidates.isEmpty())
- {
- QString dir=candidates.dequeue();
- directories.append(dir);
- QDir direc(dir);
- candidates += direc.entryList(QDir::NoDotAndDotDot | QDir::Dirs);
+ if (!file->path().isEmpty())
+ {
+ // RELATIVE was specified, so we need to make all paths relative to file->path()
+ QDir relative(file->path());
+ QStringList::iterator endIt = matches.end();
+ for(QStringList::iterator it = matches.begin(); it != endIt; ++it)
+ {
+ *it = relative.relativeFilePath(*it);
+ }
}
-
- QDir d(current);
- QStringList matches=d.entryList(file->globbingExpressions(), QDir::NoDotAndDotDot | QDir::AllEntries);
m_vars->insert(file->variable(), matches);
- kDebug(9042) << "file glob_recurse" << file->path() << file->globbingExpressions() << matches;
+ if (file->type() == FileAst::Glob)
+ kDebug(9042) << "file glob" << file->path() << file->globbingExpressions() << matches;
+ else
+ kDebug(9042) << "file glob_recurse" << file->path() << file->globbingExpressions() << matches;
} break;
case FileAst::Remove:
case FileAst::RemoveRecurse:
@@ -2237,3 +2236,90 @@ QStringList CMakeProjectVisitor::resolveDependencies(const QStringList & files)
return ret;
}
+QStringList CMakeProjectVisitor::traverseGlob(const QString& startPath,
+ const QString& expression, bool recursive, bool followSymlinks)
+{
+ kDebug(9042) << "Starting from (" << startPath << ", " << expression << ", " << followSymlinks << ")";
+ QString expr = expression;
+ int firstSlash = expr.indexOf('/');
+ int slashShift = 0;
+ while (firstSlash == slashShift)
+ {
+ slashShift++;
+ firstSlash = expr.indexOf('/', slashShift);
+ }
+ expr = expr.mid(slashShift);
+ if (firstSlash == -1)
+ {
+ kDebug(9042) << "Matching files in " << startPath << " with glob " << expr;
+ //We're here. Lets match files from startPath dir.
+ QStringList nameFilters;
+ nameFilters << expr;
+ QStringList dirsToSearch;
+ if (recursive)
+ {
+ QDir::Filters dirFilters = QDir::NoDotAndDotDot | QDir::Dirs;
+ if (!followSymlinks)
+ dirFilters |= QDir::NoSymLinks;
+ QQueue<QString> dirsToExpand;
+ dirsToExpand.enqueue(startPath);
+ while (!dirsToExpand.empty())
+ {
+ QString dir = dirsToExpand.dequeue();
+ kDebug(9042) << "Enqueueing " << dir;
+ dirsToSearch << dir;
+ QDir d(dir);
+ QStringList dirNames = d.entryList(dirFilters);
+ foreach(QString dirName, dirNames)
+ {
+ dirsToExpand << d.filePath(dirName);
+ }
+ }
+ }
+ else
+ dirsToSearch << startPath;
+ QStringList filePaths;
+ foreach (QString dirToSearch, dirsToSearch)
+ {
+ QDir dir(dirToSearch);
+ QStringList fileNames;
+ fileNames = dir.entryList(nameFilters, QDir::Files);
+ foreach (QString fileName, fileNames)
+ {
+ filePaths << dir.filePath(fileName);
+ }
+ }
+ return filePaths;
+ }
+ firstSlash -= slashShift;
+ QString dirGlob = expr.left(firstSlash);
+ QString rightExpression = expr.mid(firstSlash + 1);
+ //Now we must find match for a directory specified in dirGlob
+ QStringList matchedDirs;
+ if (dirGlob.contains('*') || dirGlob.contains('?') || dirGlob.contains('['))
+ {
+ kDebug(9042) << "Got a dir glob " << dirGlob;
+ if (startPath.isEmpty())
+ return QStringList();
+ //it's really a glob, not just dir name
+ QStringList nameFilters;
+ nameFilters << dirGlob;
+ matchedDirs = QDir(startPath).entryList(nameFilters, QDir::NoDotAndDotDot | QDir::Dirs);
+ }
+ else
+ {
+ //just a directory name. Add it as a match.
+ kDebug(9042) << "Got a simple folder " << dirGlob;
+ matchedDirs << dirGlob;
+ }
+ QStringList matches;
+ QString path = startPath;
+ if (!path.isEmpty() && !path.endsWith('/'))
+ path += '/';
+ foreach(QString dirName, matchedDirs)
+ {
+ kDebug(9042) << "Going resursive into " << path + dirName << " and glob " << rightExpression;
+ matches.append(traverseGlob(path + dirName, rightExpression, recursive, followSymlinks));
+ }
+ return matches;
+}
diff --git a/projectmanagers/cmake/parser/cmakeprojectvisitor.h b/projectmanagers/cmake/parser/cmakeprojectvisitor.h
index a825d2b..63f82c9 100644
--- a/projectmanagers/cmake/parser/cmakeprojectvisitor.h
+++ b/projectmanagers/cmake/parser/cmakeprojectvisitor.h
@@ -175,6 +175,9 @@ class KDEVCMAKECOMMON_EXPORT CMakeProjectVisitor : CMakeAstVisitor
QStringList dependees(const QString& s) const;
int declareFunction(Macro m, const CMakeFileContent& content, int initial, const QString& end);
+ QStringList traverseGlob(const QString& startPath, const QString& expression,
+ bool recursive = false, bool followSymlinks = false);
+
CMakeProperties m_props;
QStringList m_modulePath;
QString m_projectName;
--- End Message ---
--- Begin Message ---
Source: kdevelop
Source-Version: 4:4.2.2-1
We believe that the bug you reported is fixed in the latest version of
kdevelop, which is due to be installed in the Debian FTP archive:
kdevelop-data_4.2.2-1_all.deb
to main/k/kdevelop/kdevelop-data_4.2.2-1_all.deb
kdevelop-dbg_4.2.2-1_amd64.deb
to main/k/kdevelop/kdevelop-dbg_4.2.2-1_amd64.deb
kdevelop-dev_4.2.2-1_amd64.deb
to main/k/kdevelop/kdevelop-dev_4.2.2-1_amd64.deb
kdevelop-l10n_4.2.2-1_all.deb
to main/k/kdevelop/kdevelop-l10n_4.2.2-1_all.deb
kdevelop_4.2.2-1.debian.tar.gz
to main/k/kdevelop/kdevelop_4.2.2-1.debian.tar.gz
kdevelop_4.2.2-1.dsc
to main/k/kdevelop/kdevelop_4.2.2-1.dsc
kdevelop_4.2.2-1_amd64.deb
to main/k/kdevelop/kdevelop_4.2.2-1_amd64.deb
kdevelop_4.2.2.orig.tar.bz2
to main/k/kdevelop/kdevelop_4.2.2.orig.tar.bz2
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 609...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Fathi Boudra <f...@debian.org> (supplier of updated kdevelop package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Thu, 02 Jun 2011 11:39:31 +0300
Source: kdevelop
Binary: kdevelop kdevelop-data kdevelop-dev kdevelop-dbg kdevelop-l10n
Architecture: source all amd64
Version: 4:4.2.2-1
Distribution: unstable
Urgency: low
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Changed-By: Fathi Boudra <f...@debian.org>
Description:
kdevelop - integrated development environment for KDE
kdevelop-data - data files for the KDevelop IDE
kdevelop-dbg - debugging symbols for KDevelop
kdevelop-dev - development files for the KDevelop IDE
kdevelop-l10n - Localization files for the KDevelop IDE
Closes: 593634 597642 603063 609674 618052
Changes:
kdevelop (4:4.2.2-1) unstable; urgency=low
.
* New upstream release (Closes: #603063):
- correctly parse CMake FILE command with GLOB or GLOB_RECURSE.
(Closes: #609674)
.
[ Andreas Cord-Landwehr ]
* Bump build dependency kdevplatform-dev to version 1.2.0
* Bump build dependency kdebase-workspace-dev to version 4:4.5.0
* Merged localization files into one package
- includes: Catalan (ca), Southern Catalan (cavalencia), Danish (da),
German (de), British English (engb), Spanish (es), Estonian (et),
French (fr), Italian (it), Norwegian Bookmal (nb),
Low Saxon (nds), Dutch (nl), Brazilian Portuguese (ptbr),
Portuguese (pt), Russian (ru), Slovenian (sl), Swedish (sv),
Thai (th), Ukrainian (uk), Chinese Simplified (zh_CN),
Chinese Traditional (zh_TW)
- add Breaks for all kdevelop-l10n-* packages
- add Replaces for all kdevelop-l10n-* packages
- change Recommends to kdevplatform-l10n
* Add build-dependency for okteta-dev.
* Add myself to Uploaders.
.
[ Nicolás Alvarez ]
* Add debian/watch file to track upstream versions.
* Add kdevelop-dbg package with KDevelop debugging symbols. (Closes: #593634)
.
[ George Kiagiadakis ]
* Add myself to uploaders.
* Drop quilt build dependency and build-depend on pkg-kde-tools 0.9.0
to be able to build without it.
* Bump build dependency on kdevplatform-dev to version 1.1.0.
* Change the Vcs-* fields in debian/control to point to git.
* Disable the french localization package; not shipped in this release.
* Update installed files.
* Bump Standards-Version to 3.9.2 (no changes needed).
.
[ Pino Toscano ]
* Modify depends, recommends and suggests for kdevelop:
- recommend gcc, g++, make. (Closes: #597642)
- suggest kapptemplate
- remove lcov, valgrind
.
[ Fathi Boudra ]
* Add libqtwebkit-dev build dependency. (Closes: #618052)
Checksums-Sha1:
7856ab9df51631fced4725ac7fb0934b1b01eb1b 1683 kdevelop_4.2.2-1.dsc
943f86edd0f353bfa4c614972af222a1c7075755 4984161 kdevelop_4.2.2.orig.tar.bz2
4591f97b62c5d884107ed7b668889c10336985f8 18020 kdevelop_4.2.2-1.debian.tar.gz
6796872dd332e1469dcc3dca4eb61ccead6a193d 1990294 kdevelop-data_4.2.2-1_all.deb
a2905e6c46502bd89be390fce089199aeda6ee37 531872 kdevelop-l10n_4.2.2-1_all.deb
67de415e6dcdd46ee4f6f4bc87b9385b2538859e 1675494 kdevelop_4.2.2-1_amd64.deb
5d9806711ae33e161b0a5bb49b9ab16d3c98a753 17388 kdevelop-dev_4.2.2-1_amd64.deb
cbf9f0066ac1a10e24251552d806a5863a948fe0 17046022
kdevelop-dbg_4.2.2-1_amd64.deb
Checksums-Sha256:
0378a4f710e532033beb5faafa76cb098aa5f2759d9b1df0279a5c6b51198016 1683
kdevelop_4.2.2-1.dsc
e713567fc1b4faa3f7a1077d9b48005c41f623bdab78c831e3f7efc5a90268e7 4984161
kdevelop_4.2.2.orig.tar.bz2
d1616343a9c056c917f03bcfb13ba38a62c2b7e630365ac372f23969b60d703f 18020
kdevelop_4.2.2-1.debian.tar.gz
2d64edc4c2703c9b5a3c39d6fa88b1c517e1d19e18f3f1597ba5ab7d9dd4e454 1990294
kdevelop-data_4.2.2-1_all.deb
02e07beb4375b100e6ac9050a96c653f21f73270a271e43eb4c96c710f595e8a 531872
kdevelop-l10n_4.2.2-1_all.deb
7b0bb6a556e93aa7432f56bcbc845f14e63d2d176e986db90b72b19e19746e8f 1675494
kdevelop_4.2.2-1_amd64.deb
c51279707e57291b0d86da58f349f4492f1615b3ced395bc55c4187c7947dcc3 17388
kdevelop-dev_4.2.2-1_amd64.deb
4d401a211a9bab669a4d5125d450fdf70dd2ec91c9837843b5f9a465f759dd4c 17046022
kdevelop-dbg_4.2.2-1_amd64.deb
Files:
88a0f1f4b48ce31dcb98f8ee0322ea7a 1683 devel optional kdevelop_4.2.2-1.dsc
4040e71f464b4849539877e750ffab26 4984161 devel optional
kdevelop_4.2.2.orig.tar.bz2
edade42ba99234991134fba4ad63b7d8 18020 devel optional
kdevelop_4.2.2-1.debian.tar.gz
afc7c807870ef6903e5f9eaedd1880c0 1990294 devel optional
kdevelop-data_4.2.2-1_all.deb
ee47677bb0858dbdc4fba4505fdaf19e 531872 localization optional
kdevelop-l10n_4.2.2-1_all.deb
7cbd3db52a8834ea4bf8b37bb9c21e39 1675494 devel optional
kdevelop_4.2.2-1_amd64.deb
204aba81b33cb7688894dd26ed06225c 17388 devel optional
kdevelop-dev_4.2.2-1_amd64.deb
ed6dbbbc5c1a800797bddcf8c44e78f3 17046022 debug extra
kdevelop-dbg_4.2.2-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iJwEAQECAAYFAk3p1h0ACgkQjPU19mqlcvcDkAP+Pm54wT+u5QVmTOHxrxXJtUBa
qIZidsvUEhI4XLnHGb/aRxeEQdLP1JxVcqo9vXhq1v9IXuMMEAe+mvkbVUbnIxcn
ZuUvTwn/jMvIGxkvNnR0R7/UoBU/LE4a8Aw3Q1ty+liiH226pGm7QSFkIAkhIPIH
7B26d1do4R2S7rN0fXE=
=weOv
-----END PGP SIGNATURE-----
--- End Message ---