Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit739e3f1

Browse files
committed
Implement src/tools/copyright as a Perl program, so anyone can run it.
David Fetter
1 parenta4b3fee commit739e3f1

File tree

2 files changed

+44
-14
lines changed

2 files changed

+44
-14
lines changed

‎src/tools/copyright

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎src/tools/copyright.pl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/perl
2+
#################################################################
3+
# copyright.pl -- update copyright notices throughout the source tree, idempotently.
4+
#
5+
# Copyright (c) 2011, PostgreSQL Global Development Group
6+
#
7+
# src/tools/copyright.pl
8+
#################################################################
9+
10+
use strict;
11+
use warnings;
12+
13+
use File::Find;
14+
15+
my$pgdg ='PostgreSQL Global Development Group';
16+
my$cc ='Copyright (c)';
17+
# year-1900 is what localtime(time) puts in element 5
18+
my$year = 1900 + ${[localtime(time)]}[5];
19+
20+
print"Using current year:$year\n";
21+
22+
find({wanted=> \&wanted,no_chdir=> 1},'.');
23+
24+
subwanted {
25+
returnunless-f$File::Find::name;
26+
27+
my@lines;
28+
tie@lines, Tie::File,$File::Find::name;
29+
30+
foreachmy$line (@lines) {
31+
# We only care about lines with a copyright notice.
32+
nextunless$line =~m/$cc.*$pgdg/;
33+
# We stop when we've done one substitution. This is both for
34+
# efficiency and, at least in the case of this program, for
35+
# correctness.
36+
lastif$line =~m/$cc.*$year.*$pgdg/;
37+
lastif$line =~s/($cc\d{4})(, $pgdg)/$1-$year$2/;
38+
lastif$line =~s/($cc\d{4})-\d{4}(, $pgdg)/$1-$year$2/;
39+
}
40+
untie@lines;
41+
}
42+
43+
print"Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too\n";
44+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp