Package: maven-debian-helper
Version: 2.0.6
Severity: wishlist

Dear Maintainer,

The attached patch adds a non-interactive option to mh_make.

This will be useful when planning the work required to package a library. It
allows the prospective packager to quickly determine what dependencies may
first require packaging and get a sense of how challenging the package may be.

Thank you.

Christopher Hoskin



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages maven-debian-helper depends on:
ii  default-jdk                     2:1.8-57
ii  libmaven-clean-plugin-java      2.5-1
ii  libmaven-compiler-plugin-java   3.2-5
ii  libmaven-jar-plugin-java        2.4-1
ii  libmaven-resources-plugin-java  2.6-1
ii  libmaven-site-plugin-java       2.1-4
ii  libplexus-velocity-java         1.1.8-1
ii  libsurefire-java                2.17-2
ii  libxml2-utils                   2.9.3+dfsg1-1
ii  maven                           3.3.9-4
ii  maven-repo-helper               1.8.12
ii  unzip                           6.0-20
ii  velocity                        1.7-4

maven-debian-helper recommends no packages.

Versions of packages maven-debian-helper suggests:
ii  apt-file                      3.0
ii  devscripts                    2.16.4
ii  libmaven-javadoc-plugin-java  2.10.3-2
ii  subversion                    1.9.4-1

-- no debconf information
diff --git a/bin/mh_make b/bin/mh_make
index 2bcf4ff..14dd825 100755
--- a/bin/mh_make
+++ b/bin/mh_make
@@ -21,6 +21,7 @@ syntax()
    echo -e "\t-t<true|false> --run-tests=<true|false>: include or not the tests"
    echo -e "\t-d<true|false> --javadoc=<true|false>: include or not the javadoc"
    echo -e "\t  during the build"
+   echo -e "\t-n --non-interactive: non interactive mode, don't ask questions"
    echo -e "\t--cdbs: use CDBS as the build helper instead of DH"
    echo -e "\t-a --ant: use Ant for the packaging instead of Maven"
    echo -e "\t-v --verbose: show more information while running"
@@ -39,7 +40,7 @@ syntax()
    exit 1
 }
 
-ARGS="p package b bin-package t run-tests d javadoc a ant v verbose s from-svn cdbs" parseargs "$@"
+ARGS="p package b bin-package t run-tests d javadoc a ant v verbose n non-interactive s from-svn cdbs" parseargs "$@"
 
 if [ -z "$DEBFULLNAME" ]; then
   echo "Please define the environment variable DEBFULLNAME, e.g."
@@ -71,6 +72,7 @@ ANT=$(getarg a ant)
 CDBS=$(getarg cdbs)
 FROM_SVN=$(getarg s from-svn)
 VERBOSE=$(getarg v verbose)
+NON_INTERACTIVE=$(getarg n non-interactive)
 
 if [ "$FROM_SVN" == "true" ]; then
 	echo "The syntax for the --from-svn option is --from-svn=<url>, please try again"
@@ -83,11 +85,15 @@ if [ -z "$PACKAGE" ]; then
 	PACKAGE=$(echo "$FROM_SVN" | sed 's/-[0-9].*//')
         PACKAGE=$(echo "$PACKAGE" | sed 's|.*/||' )
     fi
-    echo
-    echo "Enter the name of the new Debian source package:"
-    read -p "[$PACKAGE] > " USER_PACKAGE
-    if [ -n "$USER_PACKAGE" ]; then
-        PACKAGE=$USER_PACKAGE
+    if [ "$NON_INTERACTIVE" != true ]; then
+        echo
+        echo "Enter the name of the new Debian source package:"
+        read -p "[$PACKAGE] > " USER_PACKAGE
+        if [ -n "$USER_PACKAGE" ]; then
+            PACKAGE=$USER_PACKAGE
+        fi
+    else
+        echo "Using source package name $PACKAGE, override with option --package=<package>."
     fi
 fi
 
@@ -98,31 +104,43 @@ if [ -z "$BIN_PACKAGE" ]; then
     else
         BIN_PACKAGE="lib${PACKAGE}-java"
     fi
+    if [ "$NON_INTERACTIVE" != true ]; then
 	echo
-    echo "Enter the name of the binary package:"
-    read -p "[$BIN_PACKAGE] > " USER_PACKAGE
-    if [ -n "$USER_PACKAGE" ]; then
-        BIN_PACKAGE=$USER_PACKAGE
+        echo "Enter the name of the binary package:"
+        read -p "[$BIN_PACKAGE] > " USER_PACKAGE
+        if [ -n "$USER_PACKAGE" ]; then
+            BIN_PACKAGE=$USER_PACKAGE
+        fi
+    else
+        echo "Using binary package name $PACKAGE, override with option --bin-package=<package>."
     fi
 fi
 
 if [ -z "$RUN_TESTS" ]; then
-	echo
-    echo "Run tests while building the package?"
-    read -p "[Y/n] > " RUN
     RUN_TESTS="true"
-    if [ "$RUN" == "n" ]; then
-        RUN_TESTS=
+    if [ "$NON_INTERACTIVE" != true ]; then
+        echo
+        echo "Run tests while building the package?"
+        read -p "[Y/n] > " RUN
+        if [ "$RUN" == "n" ]; then
+            RUN_TESTS=
+        fi
+    else
+	echo "Tests will be run whilst building the package, override with option --run-tests=false."
     fi
 fi
 
 if [ -z "$GEN_JAVADOC" ]; then
-	echo
-    echo "Generate the Javadoc while building the package?"
-    read -p "[Y/n] > " GEN
     GEN_JAVADOC="true"
-    if [ "$GEN" == "n" ]; then
-        GEN_JAVADOC=
+    if [ "$NON_INTERACTIVE" != true ]; then
+	echo
+        echo "Generate the Javadoc while building the package?"
+        read -p "[Y/n] > " GEN
+        if [ "$GEN" == "n" ]; then
+            GEN_JAVADOC=
+        fi
+    else
+        echo "Javadoc will be generated whilst building the package, override with option --javadoc=false."
     fi
 fi
 
@@ -183,7 +201,7 @@ if [ -f debian/patches/series ]; then
 fi
 
 echo
-java -cp /usr/share/java/maven-project.jar:/usr/share/java/maven-repo-helper.jar:/usr/share/java/maven-packager-utils.jar:/usr/share/maven2/lib/maven-debian-uber.jar org.debian.maven.packager.DependenciesSolver --verbose --package="$BIN_PACKAGE" ${ANT:+--ant} ${GEN_JAVADOC:+--generate-javadoc} ${RUN_TESTS:+--run-tests} ${VERBOSE:+--verbose} --maven-repo=/usr/share/maven-repo
+java -cp /usr/share/java/maven-project.jar:/usr/share/java/maven-repo-helper.jar:/usr/share/java/maven-packager-utils.jar:/usr/share/maven2/lib/maven-debian-uber.jar org.debian.maven.packager.DependenciesSolver --verbose --package="$BIN_PACKAGE" ${ANT:+--ant} ${GEN_JAVADOC:+--generate-javadoc} ${RUN_TESTS:+--run-tests} ${VERBOSE:+--verbose} ${NON_INTERACTIVE:+--non-interactive} --maven-repo=/usr/share/maven-repo
 
 if [ $? != 0 ]; then
     if [ -f debian/patches/series ]; then
__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to