update-copyright.py: Add filters for D language sources

Message ID CABOHX+cuk44ko58y7=+8upgy7WFRR5YzEDmexDtescEWeQ5C0w@mail.gmail.com
State New
Headers show
Series
  • update-copyright.py: Add filters for D language sources
Related show

Commit Message

Iain Buclaw Nov. 13, 2018, 3:19 p.m.
Hi,

This adds filters for upstream dmd, druntime, and phobos libraries, so
that the update-copyright script doesn't complain or try to update the
copyright years for those files.

OK for trunk?
-- 
Iain

---
contrib/ChangeLog:

2018-11-13  Iain Buclaw  <ibuclaw@gdcproject.org>

        * update-copyright.py (TestsuiteFilter): Skip .d tests.
        (LibPhobosFilter): Add filter for upstream D sources.
        (GCCCopyright): Add D Language Foundation as external author.
        (GCCCmdLine): Add libphobos.

---

Comments

Iain Buclaw Nov. 26, 2018, 9:32 p.m. | #1
Hi,

This adds filters for upstream dmd, druntime, and phobos libraries, so
that the update-copyright script doesn't complain or try to update the
copyright years for those files.

OK for trunk?
--
Iain

---
contrib/ChangeLog:

2018-11-13  Iain Buclaw  <ibuclaw@gdcproject.org>

        * update-copyright.py (TestsuiteFilter): Skip .d tests.
        (LibPhobosFilter): Add filter for upstream D sources.
        (GCCCopyright): Add D Language Foundation as external author.
        (GCCCmdLine): Add libphobos.

---
Jakub Jelinek Nov. 26, 2018, 9:35 p.m. | #2
On Mon, Nov 26, 2018 at 10:32:40PM +0100, Iain Buclaw wrote:
> Hi,

> 

> This adds filters for upstream dmd, druntime, and phobos libraries, so

> that the update-copyright script doesn't complain or try to update the

> copyright years for those files.

> 

> OK for trunk?

> --

> Iain

> 

> ---

> contrib/ChangeLog:

> 

> 2018-11-13  Iain Buclaw  <ibuclaw@gdcproject.org>

> 

>         * update-copyright.py (TestsuiteFilter): Skip .d tests.

>         (LibPhobosFilter): Add filter for upstream D sources.

>         (GCCCopyright): Add D Language Foundation as external author.

>         (GCCCmdLine): Add libphobos.


Ok, thanks.

	Jakub

Patch

diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py
index 9295c6b8a30..67c21cab23c 100755
--- a/contrib/update-copyright.py
+++ b/contrib/update-copyright.py
@@ -574,6 +574,7 @@  class TestsuiteFilter (GenericFilter):
                 '.c',
                 '.C',
                 '.cc',
+                '.d',
                 '.h',
                 '.hs',
                 '.f',
@@ -616,6 +617,25 @@  class LibGCCFilter (GenericFilter):
                 'soft-fp',
                 ])
 
+class LibPhobosFilter (GenericFilter):
+    def __init__ (self):
+        GenericFilter.__init__ (self)
+
+        self.skip_files |= set ([
+                # Source module imported from upstream.
+                'object.d',
+                ])
+
+        self.skip_dirs |= set ([
+                # Contains sources imported from upstream.
+                'core',
+                'etc',
+                'gc',
+                'gcstub',
+                'rt',
+                'std',
+                ])
+
 class LibStdCxxFilter (GenericFilter):
     def __init__ (self):
         GenericFilter.__init__ (self)
@@ -682,6 +702,7 @@  class GCCCopyright (Copyright):
         self.add_external_author ('Silicon Graphics')
         self.add_external_author ('Stephen L. Moshier')
         self.add_external_author ('Sun Microsystems, Inc. All rights reserved.')
+        self.add_external_author ('The D Language Foundation, All Rights Reserved')
         self.add_external_author ('The Go Authors.  All rights reserved.')
         self.add_external_author ('The Go Authors. All rights reserved.')
         self.add_external_author ('The Go Authors.')
@@ -720,6 +741,7 @@  class GCCCmdLine (CmdLine):
         self.add_dir ('libitm')
         self.add_dir ('libobjc')
         # liboffloadmic is imported from upstream.
+        self.add_dir ('libphobos', LibPhobosFilter())
         self.add_dir ('libquadmath')
         # libsanitizer is imported from upstream.
         self.add_dir ('libssp')
@@ -745,6 +767,7 @@  class GCCCmdLine (CmdLine):
             'libiberty',
             'libitm',
             'libobjc',
+            'libphobos',
             'libssp',
             'libstdc++-v3',
             'libvtv',