copy needed includes
authorJohannes Berg <johannes@sipsolutions.net>
Sat, 30 Mar 2013 22:06:52 +0000 (23:06 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Sat, 30 Mar 2013 22:06:52 +0000 (23:06 +0100)
Copy the necessary include files for the different
components, without them obviously nothing builds.

This necessitated using an own copytree() implementation
that doesn't error when a target directory already exists.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
copy-list
gentree.py

index 01cef65d2429847ac649d2ed22f01948ab3c8453..cff6240f15d7829c864bf4bb10d1df4c3b37cc20 100644 (file)
--- a/copy-list
+++ b/copy-list
@@ -7,8 +7,17 @@
 #
 
 # wireless stack
+include/linux/ieee80211.h
+
 net/wireless/
+include/net/cfg80211.h
+include/net/cfg80211-wext.h
+include/net/ieee80211_radiotap.h
+include/net/regulatory.h
+include/uapi/linux/nl80211.h
+
 net/mac80211/
+include/net/mac80211.h
 
 # always needed if any wireless drivers are needed
 drivers/net/wireless/Kconfig
index 8643f8a62f4527eaaefa4afe290aa581d1ce4034..dbc09b56b5809528e4817be2c0c0dfa04356dbdb 100755 (executable)
@@ -42,10 +42,49 @@ def check_output_dir(d, clean):
         if e.errno != errno.ENOENT:
             raise
 
+def copytree(src, dst, symlinks=False, ignore=None):
+    names = os.listdir(src)
+    if ignore is not None:
+        ignored_names = ignore(src, names)
+    else:
+        ignored_names = set()
+
+    if not os.path.isdir(dst):
+        os.makedirs(dst)
+    errors = []
+    for name in names:
+        if name in ignored_names:
+            continue
+        srcname = os.path.join(src, name)
+        dstname = os.path.join(dst, name)
+        try:
+            if symlinks and os.path.islink(srcname):
+                linkto = os.readlink(srcname)
+                os.symlink(linkto, dstname)
+            elif os.path.isdir(srcname):
+                copytree(srcname, dstname, symlinks, ignore)
+            else:
+                shutil.copy2(srcname, dstname)
+        except (IOError, os.error) as why:
+            errors.append((srcname, dstname, str(why)))
+        # catch the Error from the recursive copytree so that we can
+        # continue with other files
+        except shutil.Error as err:
+            errors.extend(err.args[0])
+    try:
+        shutil.copystat(src, dst)
+    except WindowsError:
+        # can't copy file access times on Windows
+        pass
+    except OSError as why:
+        errors.extend((src, dst, str(why)))
+    if errors:
+        raise shutil.Error(errors)
+
 def copy_files(copy_list, outdir):
     for src, tgt in copy_list:
         if tgt == '':
-            shutil.copytree(src, outdir, ignore=shutil.ignore_patterns('*~'))
+            copytree(src, outdir, ignore=shutil.ignore_patterns('*~'))
         elif tgt[-1] == '/':
             def copy_ignore(dir, entries):
                 r = []
@@ -56,9 +95,9 @@ def copy_files(copy_list, outdir):
                         not os.path.isdir(os.path.join(dir, i))):
                         r.append(i)
                 return r
-            shutil.copytree(os.path.join(src, tgt),
-                            os.path.join(outdir, tgt),
-                            ignore=copy_ignore)
+            copytree(os.path.join(src, tgt),
+                     os.path.join(outdir, tgt),
+                     ignore=copy_ignore)
         else:
             try:
                 os.makedirs(os.path.join(outdir, os.path.dirname(tgt)))