From bbcda40161c29c5561ada7c19b092ff59ad79039 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sun, 18 Nov 2007 08:31:37 +1300 Subject: [PATCH] Allow showing the version of the script. This has required slightly retooling how packages are created. There must be a better way. I was using sed on the tar stream, but caused issues. Back to the old fashioned way. --- ChangeLog | 3 +++ Makefile | 16 ++++++++++++---- bin/mythtv-status | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 485d0a8..93df33e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-11-18 Andrew Ruthven + Add support for showing the version of the script. + 2007-11-17 Andrew Ruthven Add support for printing colour in the encoder status display. diff --git a/Makefile b/Makefile index 4fc1fc5..51e6264 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,22 @@ $(tarball): @git-archive --format=tar --prefix=$(package)-$(version)/ $(version) `git-ls-tree --name-only $(version) | egrep -v "(.gitignore|debian|Makefile)"` | gzip > $(tarball) build/etch/$(deb): - @ssh build-etch-i386 "cd `pwd`; $(build)" + @rm -rf build/working &> /dev/null + @mkdir -p build/working + @git-archive --format=tar $(version) | (cd build/working; tar xf -) + @ssh build-etch-i386 "cd `pwd`/build/working; $(build)" @mkdir -p build/etch - @mv ../$(deb) build/etch + @mv build/$(deb) build/etch + @rm -rf build/working &> /dev/null build/sid/$(deb): - @ssh build-sid-i386 "cd `pwd`; $(build)" + @rm -rf build/working &> /dev/null + @mkdir -p build/working + @git-archive --format=tar $(version) | (cd build/working; tar xf -) + @ssh build-sid-i386 "cd `pwd`/build/working; $(build)" @mkdir -p build/sid - @mv ../$(deb) build/sid + @mv build/$(deb) build/sid + @rm -rf build/working &> /dev/null publish: $(RELEASE_FILES) for release in $(releases); do ars-add -r $$release -g main build/$$release/$(deb); done diff --git a/bin/mythtv-status b/bin/mythtv-status index 8e86545..f88dc55 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -21,12 +21,15 @@ my $description = undef; my $episode = undef; my $colour = undef; +my $VERSION = '0.5'; + GetOptions( 'c|colour|color' => \$colour, 'd|descripton' => \$description, 'e|episode' => \$episode, 'h|host=s' => \$host, 'p|port=s' => \$port, + 'v|version' => &print_version(), ); die "Sorry, port isn't a number.\n" @@ -157,6 +160,13 @@ for my $block (@blocks) { print "\n"; } +sub print_version { + print "mythtv-status, version $VERSION.\n"; + print "Written by Andrew Ruthven \n"; + print "\n"; + exit; +} + =head1 NAME mythtv-status - Display the status of a MythTV backend @@ -197,6 +207,10 @@ The host to check, defaults to localhost. The port to use when connecting to MythTV, defaults to 6544. +=item -B<-v, --version> + +Show the version of mythtv-status and then exit. + =back =head1 OUTPUT -- 2.30.2