setup: Add a helper function to lint a package directly
Change-Id: Ica9a0368b9c8e33f43d06e86e274f9bc53c68c64
diff --git a/setup.sh b/setup.sh
index ef265cf..65df7fa 100755
--- a/setup.sh
+++ b/setup.sh
@@ -90,6 +90,27 @@
popd >/dev/null
}
+function lint-package
+{
+ local packagename="${1}"; shift
+
+ if [[ -z "$packagename" ]]; then
+ echo "Usage: lint-package <packagename>"
+ return 1
+ fi
+
+ pushd "${ROOTDIR}/packages/$packagename" >/dev/null
+ dpkg-buildpackage -tc -us -ui -uc
+
+ echo; echo ===== lintian run below =====
+ lintian --include-dir=$ROOTDIR/build/lintian --fail-on-warnings --profile=mendel
+ local exitcode=$?
+
+ popd >/dev/null
+
+ return $?
+}
+
function safe-abandon
{
local branch="${1}"; shift