]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script to push shared files to kclient repo
authorSage Weil <sage@newdream.net>
Tue, 6 Oct 2009 19:20:01 +0000 (12:20 -0700)
committerSage Weil <sage@newdream.net>
Tue, 6 Oct 2009 21:00:54 +0000 (14:00 -0700)
src/push_to_kclient.pl [new file with mode: 0755]

diff --git a/src/push_to_kclient.pl b/src/push_to_kclient.pl
new file mode 100755 (executable)
index 0000000..0c038b9
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $usage = "./push_to_client.pl <path_to_kernel_git_tree>\n";
+
+my $kernel = shift @ARGV || die $usage;
+die $usage unless -d $kernel;
+die $usage unless -e "$kernel/fs/ceph/README";
+
+die "not in a git tree" unless `git-rev-parse HEAD`;
+
+my $dir = '.';
+until (-d "$dir/.git") {
+    $dir .= "/..";
+}
+
+print "copy changed shared files from $dir to $kernel...\n";
+my @files = split(/\n/, `cat $kernel/fs/ceph/README`);
+for (@files) {
+    next if /^#/;
+    my ($orig, $new) = split(/\s+/, $_);
+    #print "$dir/$orig -> $new\n";
+    system "cp -uv $dir/$orig $kernel/$new";
+}
+
+print "done.\n";
+