Ai
1 Star 0 Fork 0

如醉清风/log4cplus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
update_copyrights.sh 744 Bytes
一键复制 编辑 原始数据 按行查看 历史
Vaclav Haisman 提交于 2017-02-02 05:57 +08:00 . Update copyright years.
#!/bin/sh
find_files() {
find . \( \( \! -path './objdir*' \) \
\( -name '*.h' -o -name '*.hxx' -o -name '*.cxx' \) \)
}
find_files | while read file ; do
echo "modifying file $file";
perl -wn -i.bak -e '
use strict;
my $YEAR = 2017;
my $sep = qr/[\s,;]/;
if (/copyright/i)
{
print STDERR;
}
if (/(copyright $sep+ (?:\(c\) $sep+)? (?:\d{4})) (\s* - \s*) (\d{4})/ixgp)
{
#print STDERR "($1) ($2) ($3)\n";
#print STDERR "${^PREMATCH}$1$2$YEAR${^POSTMATCH}";
print "${^PREMATCH}$1$2$YEAR${^POSTMATCH}";
}
elsif (/(copyright $sep+ (?:\(c\) $sep+)? (\d{4}))/ixgp)
{
#print STDERR "($1)\n";
#print STDERR "${^PREMATCH}$1-$YEAR${^POSTMATCH}";
print "${^PREMATCH}$1-$YEAR${^POSTMATCH}";
}
else
{
print;
}
' $file;
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lug009/log4cplus.git
git@gitee.com:lug009/log4cplus.git
lug009
log4cplus
log4cplus
master

搜索帮助