[kup] 08/18: Add support for the "info" subcommand

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Apr 9 02:47:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository kup.

commit 48fc44f497dfe8886dc2ff90123ae6ffb4821157
Author: Konstantin Ryabitsev <konstantin at linuxfoundation.org>
Date:   Tue Mar 28 13:05:39 2017 -0400

    Add support for the "info" subcommand
    
    Currently, it only outputs the kup server version, but can be used for
    other purposes in the future (such as to give quota info, etc).
    
    Signed-off-by: Konstantin Ryabitsev <konstantin at linuxfoundation.org>
---
 ChangeLog  | 12 ++++++++----
 kup        |  9 +++++++++
 kup-server |  9 +++++++++
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8be93b9..0ae0823 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,16 @@
+2017-03-28 Konstantin Ryabitsev <mricon at kernel.org> - 0.3.6
+	* Change kup-server so that separate compress/decompress commands can be
+	  specified for each compressor. This allows us to use parallelizing
+	  compressors such as pigz and pixz without impacting our ability to
+	  decompress incoming tarballs.
+	* Add support for the "info" subcommand that outputs the kup server
+	  version (plus any additional information, in the future).
+
 2017-03-14 Konstantin Ryabitsev <mricon at kernel.org> - 0.3.5
 	* Add support for "subcmd" option for kup client, for cases where
 	  kup is used with another authZ system relying on ssh (specifically,
 	  gitolite).
 	* Small typo fixes
-	* Change kup-server so that separate compress/decompress commands can be
-	  specified for each compressor. This allows us to use parallelizing
-	  compressors such as pigz and pixz without impacting our ability to
-	  decompress incoming tarballs.
 
 2012-12-10 Konstantin Ryabitsev <mricon at kernel.org> - 0.3.4
 	* Calculate and log sha256sums of all uploaded files for forensic
diff --git a/kup b/kup
index aa97789..f9e620b 100755
--- a/kup
+++ b/kup
@@ -98,6 +98,7 @@ sub usage($) {
 	print STDERR "   ln|link old_path new_path\n";
 	print STDERR "   rm|del|delete old_path\n";
 	print STDERR "   ls|dir path...\n";
+	print STDERR "   info\n";
 
 	exit $err;
 }
@@ -580,6 +581,12 @@ sub cmd_dir()
 	}
 }
 
+# INFO command (no arguments)
+sub cmd_info()
+{
+	command('INFO');
+}
+
 # Process commands
 sub process_commands()
 {
@@ -604,6 +611,8 @@ sub process_commands()
 			cmd_delete();
 		} elsif ($cmd eq 'ls' || $cmd eq 'dir') {
 			cmd_dir();
+		} elsif ($cmd eq 'info') {
+			cmd_info();
 		} else {
 			die "$0: unknown command: $cmd\n";
 		}
diff --git a/kup-server b/kup-server
index 8ecf167..8bdab50 100755
--- a/kup-server
+++ b/kup-server
@@ -68,6 +68,8 @@ use Git;
 
 use Digest::SHA;
 
+my $VERSION = '0.3.6';
+
 # Scrub the environment completely
 %ENV = ('PATH' => '/bin:/usr/bin',
 		'LANG' => 'C',
@@ -1257,6 +1259,11 @@ sub do_dir(@)
 	STDOUT->autoflush(0);
 }
 
+sub do_info()
+{
+	print "kup-server $VERSION\n";
+}
+
 sub get_command()
 {
 	local $SIG{'ALRM'} = sub { fatal("Timeout waiting for command"); };
@@ -1306,6 +1313,8 @@ while (defined($line = get_command())) {
 		delete_path(@args);
 	} elsif ($cmd eq 'DIR') {
 		do_dir(@args);
+	} elsif ($cmd eq 'INFO') {
+		do_info();
 	} elsif ($cmd eq 'DONE') {
 		last;
 	} else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/kup.git



More information about the Kernel-svn-changes mailing list