From 6444170853205dadd8862ae79a86e99d83d58a85 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 10 Jun 2012 21:06:32 +0100 Subject: [PATCH] rename xacpi-simple --- .gitignore | 2 +- cprogs/Makefile | 4 ++-- cprogs/{xacpi-simple.c => xbatmon-simple.c} | 13 ++++++++++--- debian/changelog | 11 +++++++++++ debian/chiark-utils-bin.links | 1 + debian/control | 4 ++-- debian/copyright | 4 ++-- debian/rules | 3 ++- 8 files changed, 31 insertions(+), 11 deletions(-) rename cprogs/{xacpi-simple.c => xbatmon-simple.c} (98%) create mode 100644 debian/chiark-utils-bin.links diff --git a/.gitignore b/.gitignore index 26ff752..e6b1bc4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ cprogs/writebuffer cprogs/trivsoundd cprogs/really cprogs/with-lock-ex -cprogs/xacpi-simple +cprogs/xbatmon-simple cprogs/mcastsoundd cprogs/summer cprogs/watershed diff --git a/cprogs/Makefile b/cprogs/Makefile index a936e64..d328bf5 100644 --- a/cprogs/Makefile +++ b/cprogs/Makefile @@ -27,7 +27,7 @@ include ../settings.make RWBUFFER_SIZE_MB=16 -PROGRAMS= readbuffer writebuffer with-lock-ex xacpi-simple \ +PROGRAMS= readbuffer writebuffer with-lock-ex xbatmon-simple \ summer watershed rcopy-repeatedly SUIDSBINPROGRAMS= really DAEMONS= trivsoundd @@ -48,7 +48,7 @@ really: really.o myopt.o really.o myopt.o rcopy-repeatedly.o: myopt.h readbuffer.o writebuffer.o rwbuffer.o wrbufcore.o trivsoundd.o: rwbuffer.h -xacpi-simple: xacpi-simple.o +xbatmon-simple: xbatmon-simple.o $(CC) -o $@ $< -L/usr/X11R6/lib -lX11 -lm summer: summer.o diff --git a/cprogs/xacpi-simple.c b/cprogs/xbatmon-simple.c similarity index 98% rename from cprogs/xacpi-simple.c rename to cprogs/xbatmon-simple.c index 7324080..62a7f25 100644 --- a/cprogs/xacpi-simple.c +++ b/cprogs/xbatmon-simple.c @@ -61,7 +61,7 @@ #define TIMEOUT 5000 /* milliseconds */ #define TIMEOUT_ONERROR 3333 /* milliseconds */ -static const char program_name[]= "xacpi-simple"; +static const char program_name[]= "xbatmon-simple"; static int debug=-1, alarmlevel; /*---------- general utility stuff and declarations ----------*/ @@ -521,13 +521,20 @@ static const char *getresource(const char *want) { int r; assert(strlen(want) < 128); + + sprintf(name_buf,"xbatmon-simple.%s",want); + sprintf(class_buf,"Xbatmon-Simple.%s",want); + + r= XrmGetResource(xrm, name_buf,class_buf, &rep_type_dummy, &val); + if (r) return val.addr; + sprintf(name_buf,"xacpi-simple.%s",want); sprintf(class_buf,"Xacpi-Simple.%s",want); r= XrmGetResource(xrm, name_buf,class_buf, &rep_type_dummy, &val); - if (!r) return 0; + if (!r) return val.addr; - return val.addr; + return 0; } static int getresource_bool(const char *want, int def, int *cache) { diff --git a/debian/changelog b/debian/changelog index 62f6098..b7ab51a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +chiark-utils (4.2.0~~iwj) unstable; urgency=low + + * Rename `xacpi-simple' to `xbatmon-simple': + - rename source file + - change program name in Makefiles, .gitignore, rules, etc. + - change program's idea of its own name for usage message + - look for X resources under both old ane new names + - provide a compatibility symlink (using dh_link) + + -- Ian Jackson Sun, 10 Jun 2012 20:19:39 +0100 + chiark-utils (4.1.32) unstable; urgency=medium xacpi-simple improvements: diff --git a/debian/chiark-utils-bin.links b/debian/chiark-utils-bin.links new file mode 100644 index 0000000..becff8f --- /dev/null +++ b/debian/chiark-utils-bin.links @@ -0,0 +1 @@ +/usr/bin/xbatmon-simple /usr/bin/xacpi-simple diff --git a/debian/control b/debian/control index 4e2ea92..f99a656 100644 --- a/debian/control +++ b/debian/control @@ -93,7 +93,7 @@ Description: chiark system administration utilities summer: a tool for reporting complete details about a filesystem tree in a parseable format, including checksums. . - xacpi-simple: a very simple X client for displaying battery + xbatmon-simple: a very simple X client for displaying battery charge status. . watershed: a utility for saving on superfluous executions of an @@ -105,7 +105,7 @@ Description: chiark system administration utilities host to another, to keep a copy constantly up to date. . summer and watershed require the installation of the Recommended - crypto libraries; xacpi-simple needs the Suggested X libraries. + crypto libraries; xbatmon-simple needs the Suggested X libraries. Package: chiark-really Section: admin diff --git a/debian/copyright b/debian/copyright index 15338e0..2d0cbc9 100644 --- a/debian/copyright +++ b/debian/copyright @@ -29,8 +29,8 @@ nameserver configurations. It is: watershed, a tool for optimising runs of idempotent commands, is Copyright 2007 Canonical Ltd -xacpi-simple, a simple X client for displaying ACPI battery status - Copyright 2004 Ian Jackson +xbatmon-simple, a simple X client for displaying ACPI battery status + Copyright 2004,2012 Ian Jackson summer, a tool for reporting complete details about a filesystem tree Copyright 2003-2007 Ian Jackson diff --git a/debian/rules b/debian/rules index 3cf0afa..62d84cf 100755 --- a/debian/rules +++ b/debian/rules @@ -102,6 +102,7 @@ binary-one: cp debian/$p/$$f $t/$p/DEBIAN/$$f; \ chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \ done + dh_link -p$p -Pdebian/tmp/$p dpkg-gencontrol -isp -p$p -P$t/$p -Tdebian/sv-$p chown -R root.root debian/tmp chmod -R g-ws debian/tmp @@ -122,7 +123,7 @@ binary-arch: checkroot build binary-prep $t/chiark-really/usr/sbin/* set -e; for f in $t/chiark-utils-bin/usr/bin/*; do \ case "$$f" in \ - */xacpi-simple) d=Suggests ;; \ + */xbatmon-simple) d=Suggests ;; \ */watershed|*/summer) d=Recommends ;; \ *) d=Depends ;; \ esac; \ -- 2.30.2