]> git.proxmox.com Git - ceph.git/blame - ceph/src/script/add_header.pl
import quincy beta 17.1.0
[ceph.git] / ceph / src / script / add_header.pl
CommitLineData
7c673cae
FG
1#!/usr/bin/perl
2
3use strict;
4my $fn = shift @ARGV;
5my $old = `cat $fn`;
6
7my $header = `cat doc/header.txt`;
8
9# strip existing header
10my $new = $old;
11if ($new =~ /^(.*)\* Ceph - scalable distributed file system/s) {
12 my ($a,@b) = split(/\*\/\n/, $new);
13 $new = join("*/\n",@b);
14}
15$new = $header . $new;
16
17if ($new ne $old) {
18 open(O, ">$fn.new");
19 print O $new;
20 close O;
21 system "diff $fn $fn.new";
22 rename "$fn.new", $fn;
23 #unlink "$fn.new";
24
25}
26