summaryrefslogtreecommitdiff
path: root/src/devtools/checkpkg.patch
blob: 2e3bb63e34e9c92e34b687dbf5263208cd59ac7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- checkpkg.in	2014-03-21 13:59:31.849658036 -0400
+++ checkpkg.ugly	2014-03-21 14:20:52.340291982 -0400
@@ -1,8 +1,30 @@
 #!/bin/bash
+# License: Unspecified
 
 shopt -s extglob
 
-m4_include(lib/common.sh)
+. $(librelib messages)
+
+usage() {
+	print 'Usage: %s [-h]' "${0##*/}"
+	print 'Compare a locally built a package with the one in the repositories.'
+	echo
+	prose 'This should be run from a directory containing a
+	       PKGBUILD.  It searches for a locally built package
+	       corresponding to the PKGBUILD, and downloads the last
+	       version of that package from the pacman repositories.
+	       It then compares the list of .so files provided by each
+	       version of the package.  It does this for each part of
+	       a split package.'
+}
+
+if [[ $1 = '-h' ]]; then
+	usage
+	exit 0
+elif [[ $# -gt 0 ]]; then
+	usage >&2
+	exit 1
+fi
 
 # Source makepkg.conf; fail if it is not found
 if [[ -r '/etc/makepkg.conf' ]]; then
@@ -17,7 +39,9 @@
 fi
 
 if [[ ! -f PKGBUILD ]]; then
-	die 'This must be run in the directory of a built package.'
+	error 'This must be run in the directory of a built package.'
+	usage >&2
+	exit 1
 fi
 
 . ./PKGBUILD