From ada82c54e5948ae6353d7024151dcc429665a070 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Mar 2014 00:36:23 -0400 Subject: Add usage text to the commands in src/devtools --- src/devtools/checkpkg.patch | 43 ++++++++++++++++++++++++++++++++++++++ src/devtools/find-libdeps.patch | 46 +++++++++++++++++++++++++++++++++++++++++ src/devtools/finddeps.patch | 33 +++++++++++++++++++++++++++++ src/devtools/lddd.patch | 27 ++++++++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 src/devtools/checkpkg.patch create mode 100644 src/devtools/find-libdeps.patch create mode 100644 src/devtools/finddeps.patch create mode 100644 src/devtools/lddd.patch diff --git a/src/devtools/checkpkg.patch b/src/devtools/checkpkg.patch new file mode 100644 index 0000000..fe9568e --- /dev/null +++ b/src/devtools/checkpkg.patch @@ -0,0 +1,43 @@ +--- checkpkg.in 2014-03-20 15:55:50.091249246 -0400 ++++ checkpkg 2014-03-21 00:27:07.318339210 -0400 +@@ -2,7 +2,28 @@ + + 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 +38,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 diff --git a/src/devtools/find-libdeps.patch b/src/devtools/find-libdeps.patch new file mode 100644 index 0000000..2b2ce2a --- /dev/null +++ b/src/devtools/find-libdeps.patch @@ -0,0 +1,46 @@ +--- find-libdeps.in 2014-03-20 15:55:50.107915156 -0400 ++++ find-libdeps 2014-03-21 00:09:03.855031377 -0400 +@@ -1,6 +1,6 @@ + #!/bin/bash + +-m4_include(lib/common.sh) ++. $(librelib messages) + + set -e + shopt -s extglob +@@ -19,12 +19,32 @@ + *) die "Unknown mode %s" "$script_mode" ;; + esac + ++usage() { ++ print "Usage: find-lib(deps|provides) [options] " ++ print "Find library dependencies or provides of a package." ++ echo ++ prose 'Prints a list of library dependencies in the format:' ++ echo ++ print ' =-' ++ echo ++ prose 'Where is the shared library version, or ++ repeated if there is no version attached; and ++ is the architecture of the library (either `32` ++ or `64`, based on the ELF Class).' ++ echo ++ print "Options:" ++ flag "--ignore-internal" "Ignore internal libraries; libraries ++ without a version attached" ++ flag "-h" "Show this message" ++} + if [[ -z $1 ]]; then +- echo "${0##*/} [options] " +- echo "Options:" +- echo " --ignore-internal ignore internal libraries" ++ usage >&2 + exit 1 + fi ++if [[ $1 = '-h' ]]; then ++ usage ++ exit 0 ++fi + + if [[ -d $1 ]]; then + pushd $1 >/dev/null diff --git a/src/devtools/finddeps.patch b/src/devtools/finddeps.patch new file mode 100644 index 0000000..a960ac1 --- /dev/null +++ b/src/devtools/finddeps.patch @@ -0,0 +1,33 @@ +--- finddeps.in 2014-03-20 15:55:50.121247884 -0400 ++++ finddeps 2014-03-21 00:11:02.573978735 -0400 +@@ -3,18 +3,24 @@ + # finddeps - find packages that depend on a given depname + # + +-m4_include(lib/common.sh) ++. $(librelib messages) + + match=$1 + ++usage() { ++ print 'Usage: %s ' "${0##*/}" ++ print 'Find packages that depend on a given depname.' ++ echo ++ prose 'Run this script from the top-level directory of your ABS tree.' ++} + if [[ -z $match ]]; then +- echo 'Usage: finddeps ' +- echo '' +- echo 'Find packages that depend on a given depname.' +- echo 'Run this script from the top-level directory of your ABS tree.' +- echo '' ++ usage >&2 + exit 1 + fi ++if [[ $match = '-h' ]]; then ++ usage ++ exit 0 ++fi + + find . -type d | while read d; do + if [[ -f "$d/PKGBUILD" ]]; then diff --git a/src/devtools/lddd.patch b/src/devtools/lddd.patch new file mode 100644 index 0000000..7ae1679 --- /dev/null +++ b/src/devtools/lddd.patch @@ -0,0 +1,27 @@ +--- lddd.in 2014-03-20 15:55:50.154579704 -0400 ++++ lddd 2014-03-21 00:35:07.167279204 -0400 +@@ -3,7 +3,23 @@ + # lddd - find broken library links on your machine + # + +-m4_include(lib/common.sh) ++. $(librelib messages) ++ ++usage() { ++ print "Usage: %s [-h]" "${0##*/}" ++ print "Find broken library links on your machine." ++ echo ++ prose 'Scans $PATH and library directories for ELF files with ++ references to missing shared libraries.' ++} ++ ++if [[ $1 = '-h' ]]; then ++ usage ++ exit 0 ++elif [[ $# -gt 0 ]]; then ++ usage >&2 ++ exit 1 ++fi + + ifs=$IFS + IFS="${IFS}:" -- cgit v1.2.3-54-g00ecf