File: check_copyright.sh

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (16 lines) | stat: -rwxr-xr-x 489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# Copyright (c) 2022-2024, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause

REF="$1"

export YEAR=$(date +%Y)

REPLARG="-S 1024"
if !(xargs $REPLARG 2>/dev/null); then
    # xargs doesn't support -S argument, so do not use it
    REPLARG=""
fi

# List files with Copyright whether they have up-to-date date.
git diff --name-only "$REF" | xargs -I {} $REPLARG bash -c 'test -f {} && (grep -q "Copyright.*$YEAR" {} || (grep -q Copyright {} && echo {}))' | ( ! grep ^ )