public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sebastian Parborg" <darkdefende@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ebuildgen:master commit in: /, filetypes/
Date: Sun, 14 Aug 2011 22:17:48 +0000 (UTC)	[thread overview]
Message-ID: <356d71a0dfbb61c1564aa3d602ecd80cfa96edfd.darkdefender@gentoo> (raw)

commit:     356d71a0dfbb61c1564aa3d602ecd80cfa96edfd
Author:     Sebastian Parborg <darkdefende <AT> gmail <DOT> com>
AuthorDate: Tue Aug  9 22:02:42 2011 +0000
Commit:     Sebastian Parborg <darkdefende <AT> gmail <DOT> com>
CommitDate: Tue Aug  9 22:02:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/ebuildgen.git;a=commit;h=356d71a0

fixed bogus deps in the moc project

---
 filetypes/automake.py   |    5 ++++-
 filetypes/ctypefiles.py |   24 +++++++++++++++++-------
 linkdeps.py             |    2 +-
 scanfiles.py            |    4 ++--
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/filetypes/automake.py b/filetypes/automake.py
index 3bd061e..c4ca432 100644
--- a/filetypes/automake.py
+++ b/filetypes/automake.py
@@ -288,7 +288,7 @@ def initscan(amfile,iflst):
                             if item.split(".")[0] == src.split(".")[0]:
                                 sources += [src]
 
-                if variable.split("_")[-1] == "CFLAGS":
+                if variable.split("_")[-1] == "CFLAGS" or variable == "DEFAULT_INCLUDES":
                     for item in amlist[0][variable]:
                         if item[:2] == "-I":
                             if item[2:] == "$(top_srcdir)" or item[2:] == "$(srcdir)":
@@ -298,6 +298,9 @@ def initscan(amfile,iflst):
                             else:
                                 incflags += [curdir + item[2:]]
 
+            if not "DEFAULT_INCLUDES" in amlist[0]:
+                incflags += [curdir,top_dir]
+
             if "SUBDIRS" in amlist[0]:
                 for dir in amlist[0]["SUBDIRS"]:
                     sources += scan(curdir + dir + "/Makefile.am")

diff --git a/filetypes/ctypefiles.py b/filetypes/ctypefiles.py
index e6b9624..dac3e0d 100644
--- a/filetypes/ctypefiles.py
+++ b/filetypes/ctypefiles.py
@@ -96,14 +96,18 @@ def scanincludes(string,inclst,curdir,incpaths):
         """
         includes : includes ginc
         """
-        p[1][0].add(p[2])
+        if islocalinc(p[2],curdir,incpaths):
+            p[1][1].add(p[2])
+        else:
+            p[1][0].add(p[2])
         p[0] = p[1]
 
     def p_lincludes(p):
         """
         includes : includes linc
         """
-        if islocalinc(p[2],curdir,incpaths):
+        locincpaths = incpaths + [curdir + "/"]
+        if islocalinc(p[2],curdir,locincpaths):
             p[1][1].add(p[2])
         else:
             p[1][0].add(p[2])
@@ -136,13 +140,17 @@ def scanincludes(string,inclst,curdir,incpaths):
         "includes : ginc"
         globinc = set()
         globinc.add(p[1])
-        p[0] = [globinc,set(),{}]
+        if islocalinc(p[1], curdir, incpaths):
+            p[0] = [set(),globinc,{}]
+        else:
+            p[0] = [globinc,set(),{}]
 
     def p_linc(p):
         "includes : linc"
         locinc = set()
         locinc.add(p[1])
-        if islocalinc(p[1], curdir, incpaths):
+        locincpaths = incpaths + [curdir + "/"]
+        if islocalinc(p[1], curdir, locincpaths):
             p[0] = [set(),locinc,{}]
         else:
             p[0] = [locinc,set(),{}]
@@ -174,11 +182,13 @@ def islocalinc(inc, curdir, incpaths):
     Checks if the file can be found with the path that is supplied.
     If not this is probably a global include and thus return False
     """
-    incpaths += [curdir + "/"]
 
     for incpath in incpaths:
-        if not glob.glob(incpath + inc) == []:
-            return True
+        #check if the path for a local inc is correct.
+        #The work dir is in /tmp.
+        if incpath[:4] == "/tmp":
+            if not glob.glob(incpath + inc) == []:
+                return True
 
     return False
 

diff --git a/linkdeps.py b/linkdeps.py
index f9902c8..bf44391 100644
--- a/linkdeps.py
+++ b/linkdeps.py
@@ -13,7 +13,7 @@ def qfiletopackage(dep,addpaths):
     """
 
     print(dep)
-    (statuscode,outstr) = getstatusoutput("`gcc -print-prog-name=cc1` -v ^C")
+    (statuscode,outstr) = getstatusoutput('echo "" | `gcc -print-prog-name=cc1` -v')
     #"`gcc -print-prog-name=cc1plus` -v" for cpp
     outlst = outstr.split("\n")
     incpaths = []

diff --git a/scanfiles.py b/scanfiles.py
index b0cd7aa..6ebe92b 100644
--- a/scanfiles.py
+++ b/scanfiles.py
@@ -145,7 +145,7 @@ def scanproject(dir,projecttype):
     """
     if projecttype == "guess":
         filestolookfor = ["Makefile","makefile",
-	"configure.ac","configure.in"] #add more later
+    "configure.ac","configure.in"] #add more later
     elif projecttype == "makefile":
         filestolookfor = ["Makefile","makefile"]
     elif projecttype == "autotools":
@@ -155,7 +155,7 @@ def scanproject(dir,projecttype):
     print(mfile)
     if mfile == "Makefile" or mfile == "makefile":
         (scanlist,binaries,incflags,targets) = scanmakefiledeps(mfile)
-	#this is broken now... rewrite
+    #this is broken now... rewrite
         return scanfilelist(scanlist),binaries,incflags,targets
 
     else:



             reply	other threads:[~2011-08-14 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-14 22:17 Sebastian Parborg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-09  9:41 [gentoo-commits] proj/ebuildgen:master commit in: /, filetypes/ Sebastian Parborg
2011-08-09  9:41 Sebastian Parborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=356d71a0dfbb61c1564aa3d602ecd80cfa96edfd.darkdefender@gentoo \
    --to=darkdefende@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox