~ubuntu-branches/ubuntu/intrepid/moin/intrepid-updates

« back to all changes in this revision

Viewing changes to debian/cdbs/1/rules/copyright-check.mk

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-14 16:09:24 UTC
  • mfrom: (0.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20060214160924-fyrx3gvknzqvt4vj
Tags: 1.5.2-1ubuntu1
Drop python2.3 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: makefile; coding: utf-8 -*-
 
2
# Copyright © 2005-2006 Jonas Smedegaard <dr@jones.dk>
 
3
# Description: Check for changes to copyright notices in source
 
4
#
 
5
# This program is free software; you can redistribute it and/or
 
6
# modify it under the terms of the GNU General Public License as
 
7
# published by the Free Software Foundation; either version 2, or (at
 
8
# your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful, but
 
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
# General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program; if not, write to the Free Software
 
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
18
# 02111-1307 USA.
 
19
 
 
20
ifndef _cdbs_bootstrap
 
21
_cdbs_scripts_path ?= /usr/lib/cdbs
 
22
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
 
23
_cdbs_class_path ?= /usr/share/cdbs/1/class
 
24
endif
 
25
 
 
26
ifndef _cdbs_rules_copyright-check
 
27
_cdbs_rules_copyright-check := 1
 
28
 
 
29
include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 
30
 
 
31
cdbs_copyright-check_find_opts := -not -regex '\./debian/.*'
 
32
 
 
33
clean::
 
34
        @echo 'Scanning upstream source for new/changed copyright notices...'
 
35
        @echo '(the debian/ subdir is _not_ examined - do that manually!)'
 
36
        find . -type f $(cdbs_copyright-check_find_opts) -exec cat '{}' ';' \
 
37
                | egrep --text -rih 'copyright.*[0-9]{4}' \
 
38
                | sed -e 's/^[[:space:]*#]*//' -e 's/[[:space:]]*$$//' \
 
39
                | LC_ALL=C sort -u \
 
40
                > debian/copyright_newhints
 
41
        if [ ! -f debian/copyright_hints ]; then touch debian/copyright_hints; fi
 
42
        @echo "diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'"
 
43
        @diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'; \
 
44
                if [ "$$?" -eq "0" ]; then \
 
45
                        echo "New or changed copyright notices discovered! Do this:"; \
 
46
                        echo "  1) Search source for each of the above lines ('grep -r' is your friend)"; \
 
47
                        echo "  2) Update debian/copyright as needed"; \
 
48
                        echo "  3) Replace debian/copyright_hints with debian/copyright_newhints"; \
 
49
                        exit 1; \
 
50
                fi
 
51
        
 
52
        @echo 'No new copyright notices found - assuming no news is good news...'
 
53
        rm -f debian/copyright_newhints
 
54
 
 
55
endif