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 26ff752..e6b1bc4 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 a936e64..d328bf5 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 7324080..62a7f25 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 62f6098..b7ab51a 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 4e2ea92..f99a656 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 15338e0..2d0cbc9 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 3cf0afa..62d84cf 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; \