From 55fceed402cd5d0f50e8e8ecbc58738fe2888f40 Mon Sep 17 00:00:00 2001 From: Rohit Jnagal Date: Fri, 9 Jan 2015 19:27:34 +0000 Subject: [PATCH] Add some more missing copyrights and script to verify copyright. Add to travis next. --- container/raw/container_hints_test.go | 14 ++++++++++++ fs/fs.go | 14 ++++++++++++ fs/fs_test.go | 14 ++++++++++++ fs/types.go | 14 ++++++++++++ hooks/boilerplate.go.txt | 13 +++++++++++ hooks/check_boilerplate.sh | 33 +++++++++++++++++++++++++++ pages/docker.go | 14 ++++++++++++ pages/pages.go | 14 ++++++++++++ 8 files changed, 130 insertions(+) create mode 100644 hooks/boilerplate.go.txt create mode 100755 hooks/check_boilerplate.sh diff --git a/container/raw/container_hints_test.go b/container/raw/container_hints_test.go index 6fa03475..83d32e74 100644 --- a/container/raw/container_hints_test.go +++ b/container/raw/container_hints_test.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package raw import ( diff --git a/fs/fs.go b/fs/fs.go index 684083e4..1cdd05ed 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // +build linux // Provides Filesystem Stats diff --git a/fs/fs_test.go b/fs/fs_test.go index 08c01755..1215ac00 100644 --- a/fs/fs_test.go +++ b/fs/fs_test.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fs import ( diff --git a/fs/types.go b/fs/types.go index 5e250d7b..9cba902b 100644 --- a/fs/types.go +++ b/fs/types.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fs type DeviceInfo struct { diff --git a/hooks/boilerplate.go.txt b/hooks/boilerplate.go.txt new file mode 100644 index 00000000..5804195f --- /dev/null +++ b/hooks/boilerplate.go.txt @@ -0,0 +1,13 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. diff --git a/hooks/check_boilerplate.sh b/hooks/check_boilerplate.sh new file mode 100755 index 00000000..fb7e59f7 --- /dev/null +++ b/hooks/check_boilerplate.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +REF_FILE="./hooks/boilerplate.go.txt" +if [ ! -e $REF_FILE ]; then + echo "Missing reference file: " ${REF_FILE} + exit 1 +fi + +LINES=$(cat "${REF_FILE}" | wc -l | tr -d ' ') +GO_FILES=$(find . -not -wholename "*Godeps*" -name "*.go") + +for FILE in ${GO_FILES}; do + DIFFER=$(cat "${FILE}" | sed 's/2015/2014/g' | head "-${LINES}" | diff -q - "${REF_FILE}") + + if [[ ! -z "${DIFFER}" ]]; then + echo "${FILE} does not have the correct copyright notice." + exit 1 + fi +done diff --git a/pages/docker.go b/pages/docker.go index 30a1b19f..594b12a1 100644 --- a/pages/docker.go +++ b/pages/docker.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package pages import ( diff --git a/pages/pages.go b/pages/pages.go index c136949a..8d028ee1 100644 --- a/pages/pages.go +++ b/pages/pages.go @@ -1,3 +1,17 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package pages import (