From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qqip1-0000Bg-Ly for garchives@archives.gentoo.org; Tue, 09 Aug 2011 09:42:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF9C521C06A; Tue, 9 Aug 2011 09:41:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B3B1821C06A for ; Tue, 9 Aug 2011 09:41:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 351021B404B for ; Tue, 9 Aug 2011 09:41:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CF70180043 for ; Tue, 9 Aug 2011 09:41:44 +0000 (UTC) From: "Sebastian Parborg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Parborg" Message-ID: Subject: [gentoo-commits] proj/ebuildgen:master commit in: / X-VCS-Repository: proj/ebuildgen X-VCS-Files: linkdeps.py X-VCS-Directories: / X-VCS-Committer: darkdefender X-VCS-Committer-Name: Sebastian Parborg X-VCS-Revision: e3e320251e15bb4a574eb4e3201d375eb897166b Date: Tue, 9 Aug 2011 09:41:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ee12aa2fd9c2d6a8df67226fb76478c1 commit: e3e320251e15bb4a574eb4e3201d375eb897166b Author: Sebastian Parborg gmail com> AuthorDate: Sun Aug 7 19:52:46 2011 +0000 Commit: Sebastian Parborg gmail com> CommitDate: Sun Aug 7 19:52:46 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/ebuildgen.git= ;a=3Dcommit;h=3De3e32025 Added automatic detection of the default incpaths! --- linkdeps.py | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/linkdeps.py b/linkdeps.py index edf9c7a..d498a88 100644 --- a/linkdeps.py +++ b/linkdeps.py @@ -13,13 +13,19 @@ def qfiletopackage(dep,addpaths): """ =20 print(dep) - incpaths =3D ["/usr/include", "/usr/local/include"] + (statuscode,outstr) =3D getstatusoutput("`gcc -print-prog-name=3Dcc1= ` -v ^C") + #"`gcc -print-prog-name=3Dcc1plus` -v" for cpp + outlst =3D outstr.split("\n") + incpaths =3D [] + for item in outlst: + if item[:2] =3D=3D " /": + incpaths +=3D [item[1:]] incpaths +=3D addpaths depname =3D os.path.split(dep)[1] =20 (statuscode,packagestr) =3D getstatusoutput("qfile -C " + depname) if not statuscode =3D=3D 0: - package =3D pfltopackage(dep,addpaths) + package =3D pfltopackage(dep,incpaths) =20 else: packagelst =3D packagestr.split() @@ -35,7 +41,7 @@ def qfiletopackage(dep,addpaths): print("more than one matching package where found!") =20 if not package: - package =3D pfltopackage(dep,addpaths) + package =3D pfltopackage(dep,incpaths) =20 print(package) return package @@ -46,8 +52,7 @@ def pfltopackage(dep,addpaths): """ =20 print(dep) - incpaths =3D ["/usr/include", "/usr/local/include"] - incpaths +=3D addpaths + incpaths =3D addpaths =20 url_lines =3D [] depname =3D os.path.split(dep)[1] @@ -80,4 +85,4 @@ def pfltopackage(dep,addpaths): =20 return [matching_packages.pop()] =20 -#pfltopackage("ncurses.h",[]) +#qfiletopackage("jack/ringbuffer.h",[])