chiark / gitweb /
rename xacpi-simple
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 10 Jun 2012 20:06:32 +0000 (21:06 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 10 Jun 2012 20:06:32 +0000 (21:06 +0100)
.gitignore
cprogs/Makefile
cprogs/xbatmon-simple.c [moved from cprogs/xacpi-simple.c with 98% similarity]
debian/changelog
debian/chiark-utils-bin.links [new file with mode: 0644]
debian/control
debian/copyright
debian/rules

index 26ff7529d04a9e6570566111d87ae726939150a4..e6b1bc4002eceacfaa3f3d7ba12948e4538e3d65 100644 (file)
@@ -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
index a936e642f60a741c6a2f57220ff40e3ccb6159d7..d328bf52416535031e6fb416e428ed7b9feafe34 100644 (file)
@@ -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
similarity index 98%
rename from cprogs/xacpi-simple.c
rename to cprogs/xbatmon-simple.c
index 7324080353fb518ac1330b83d14e54133edb4f24..62a7f258fbb6590ba7318eb786cb7c0cb7bfd7eb 100644 (file)
@@ -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) {
index 62f609877ed396508f482ba722bc04fd78ca7d83..b7ab51ac25ea67abbf7a7d77f6aad26f237bc0e7 100644 (file)
@@ -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 <ijackson@chiark.greenend.org.uk>  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 (file)
index 0000000..becff8f
--- /dev/null
@@ -0,0 +1 @@
+/usr/bin/xbatmon-simple /usr/bin/xacpi-simple
index 4e2ea92b341727f92014c1d40fd8bbda880ea448..f99a656c75155ee86139127da1c61e5252786047 100644 (file)
@@ -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
index 15338e025e697819435da3c42685b618678109db..2d0cbc9b105114ce1daaaf8ccddb993dee7d296c 100644 (file)
@@ -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 <ian@chiark.greenend.org.uk>
+xbatmon-simple, a simple X client for displaying ACPI battery status
+ Copyright 2004,2012 Ian Jackson <ian@chiark.greenend.org.uk>
 
 summer, a tool for reporting complete details about a filesystem tree
  Copyright 2003-2007 Ian Jackson <ian@chiark.greenend.org.uk>
index 3cf0afa9387b0364dd1ea999ed07b5f386057a46..62d84cfccfdc115b37bdda682985667e2c980c76 100755 (executable)
@@ -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; \