Package: laptop-detect Version: 0.12.1 Severity: normal Tags: patch Attached is the diff for my laptop-detect 0.12.1-0.1 NMU. I have uploaded this to the 10 day delayed queue. Since the package is apparently not being maintained I went ahead and fixed all the obvious stuff.
-- see shy jo
diff -Nru /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/changelog /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/changelog
--- /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/changelog 2005-06-14 06:38:52.000000000 -0400
+++ /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/changelog 2007-02-27 20:40:19.000000000 -0500
@@ -1,3 +1,17 @@
+laptop-detect (0.12.1-0.1) unstable; urgency=low
+
+ * NMU
+ * Merge changes from Ubuntu:
+ - Check that '/dev/mem' is readable before running 'dmidecode'
+ - Add support for looking for an APM battery
+ Closes: #314874
+ * Current standards-version.
+ * Add a man page contributed by Franklin PIAT, modified to not include
+ options not yet present in the program. Closes: #396637
+ * Use debhelper's udeb support.
+
+ -- Joey Hess <[EMAIL PROTECTED]> Tue, 27 Feb 2007 20:20:54 -0500
+
laptop-detect (0.12.1) unstable; urgency=low
* First upload to Debian. Add Otavio Salvador as an Uploader.
diff -Nru /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/control /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/control
--- /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/control 2005-06-14 06:38:05.000000000 -0400
+++ /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/control 2007-02-27 20:39:17.000000000 -0500
@@ -3,8 +3,8 @@
Priority: optional
Maintainer: Thom May <[EMAIL PROTECTED]>
Uploaders: Otavio Salvador <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 4.1.16)
-Standards-Version: 3.6.10
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
Package: laptop-detect
Architecture: any
@@ -18,7 +18,7 @@
Priority: extra
Architecture: any
XC-Package-Type: udeb
-Depends: ${dmidecode-depends}
+Depends: ${dmidecode-udeb-depends}
Description: attempt to detect a laptop
Laptop mode attempts to determine whether it is being run on a laptop or a
desktop and appraises its caller of this.
diff -Nru /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/rules /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/rules
--- /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/debian/rules 2005-06-14 06:37:13.000000000 -0400
+++ /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/debian/rules 2007-02-27 20:39:59.000000000 -0500
@@ -2,23 +2,15 @@
#export DH_VERBOSE=1
-
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifeq ($(DEB_HOST_ARCH),i386)
-dmidecode-depends := -V'dmidecode-depends=dmidecode'
-dmidecode-udeb-depends := -V'dmidecode-depends=dmidecode-udeb'
+dmidecode-depends := -V'dmidecode-depends=dmidecode' -V'dmidecode-udeb-depends=dmidecode-udeb'
endif
ifeq ($(DEB_HOST_ARCH),amd64)
-dmidecode-depends := -V'dmidecode-depends=dmidecode'
-dmidecode-udeb-depends := -V'dmidecode-depends=dmidecode-udeb'
+dmidecode-depends := -V'dmidecode-depends=dmidecode' -V'dmidecode-udeb-depends=dmidecode-udeb'
endif
-PACKAGE=$(shell dh_listpackages | grep -- -udeb$$)
-VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
-UFILENAME=$(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb
-
-
clean:
dh_testdir
dh_clean
@@ -34,18 +26,9 @@
install -m 755 laptop-detect.sh debian/laptop-detect/usr/sbin/laptop-detect
install -m 755 laptop-detect.sh debian/laptop-detect-udeb/usr/sbin/laptop-detect
-binary-indep:
+ dh_installman laptop-detect.8
-binary-udeb: DH_OPTIONS=-plaptop-detect-udeb
-binary-udeb: build install
- dh_testdir
- dh_testroot
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol -- -fdebian/files~ $(dmidecode-udeb-depends)
- dpkg-distaddfile $(UFILENAME) debian-installer extra
- dh_builddeb --filename=$(UFILENAME)
+binary-indep:
binary-arch: build install
dh_testdir
@@ -59,4 +42,4 @@
dh_md5sums
dh_builddeb
-binary: binary-indep binary-arch binary-udeb
+binary: binary-indep binary-arch
diff -Nru /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/laptop-detect.8 /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/laptop-detect.8
--- /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/laptop-detect.8 1969-12-31 19:00:00.000000000 -0500
+++ /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/laptop-detect.8 2007-02-27 20:27:39.000000000 -0500
@@ -0,0 +1,43 @@
+.\" '\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 2006, Franklin PIAT
+.\"
+.\" This manpage is licensed under the BSD license. For further
+.\" information see the copying that comes with the laptop-detect
+.\" distribution.
+.\"
+.\"
+.\" Wed Nov 1 16:43:02 CET 2006 Franklin PIAT ([EMAIL PROTECTED])
+.\"
+.\" .pc
+.TH "laptop-detect" "8" "0.12" "Franklin PIAT" "System administration commands"
+.SH "NAME"
+.LP
+laptop\-detect \- attempt to detect a laptop
+.SH "SYNOPSIS"
+.LP
+laptop\-detect
+.SH "DESCRIPTION"
+.LP
+laptop\-detect attempts to determine whether it is being run on a laptop or
+a desktop and returns true if its is a laptop.
+.SH "EXIT STATUS"
+.br
+.nf
+\fB0\fR most likely running on a laptop
+\fB1\fR most likely NOT running on a laptop
+.SH "FILES"
+.LP
+\fI/proc/acpi/battery\fP
+.br
+\fI/proc/pmu/info\fP
+.br
+\fI/proc/apm\fP
+.SH "AUTHORS"
+.LP
+Program by Thom May, this man page by Franklin PIAT <[EMAIL PROTECTED]>
+.SH "SEE ALSO"
+.LP
+dmidecode(8)
diff -Nru /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/laptop-detect.sh /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/laptop-detect.sh
--- /home/joey/tmp/bKGldmxW60/laptop-detect-0.12.1/laptop-detect.sh 2005-06-14 06:37:13.000000000 -0400
+++ /home/joey/tmp/7Zg4Vsq0zD/laptop-detect-0.12.1/laptop-detect.sh 2007-02-27 20:27:54.000000000 -0500
@@ -10,7 +10,7 @@
exit 1
fi
-if [ -x /usr/sbin/dmidecode ]; then
+if [ -r /dev/mem -a -x /usr/sbin/dmidecode ]; then
# dmidecode to grab the Chassis type
dmitype=$(dmidecode|grep Chassis -A 10|grep -m1 Type|sed -e 's/.*Type: \(.*\)/\1/')
@@ -33,5 +33,15 @@
fi
fi
+# check for APM batteries. This sucks, because we'll only get a valid response
+# if the laptop has a battery fitted at the time
+if [ -f /proc/apm ]; then
+ battery=`awk '{print $6}' </proc/apm`
+ if [ "$battery" != "0xff" ] && [ "$battery" != "0x80" ]; then
+ # There's a battery
+ exit 0;
+ fi
+fi
+
#probably not a laptop; exit
exit 1
signature.asc
Description: Digital signature

