Skip to content

Add no-validate option and review parsing indent #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# read_yn <prompt>
read_yn() {
[[ $NO_VALIDATE ]] && return 0
local prompt="$1"
while true; do
read -e -n 1 -p "$prompt" reply
Expand Down Expand Up @@ -63,7 +64,7 @@ carefully. If you do not agree to the displayed license terms, the
package will not be built.

EOF
read -e -p "Press [Return] to continue: " dummy
[[ $NO_VALIDATE ]] || read -e -p "Press [Return] to continue: " dummy
echo
local extract_dir="$tmp/extract"
mkdir "$extract_dir"
Expand Down
55 changes: 29 additions & 26 deletions make-jpkg
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ The following options are recognized:
--source build a source package instead of a binary deb package
--with-system-certs integrate with the system's keystore
--jce-policy FILE Replace cryptography files with versions from FILE
--no-validate No asking stdout validate

--help display this help and exit
--version output version information and exit
Expand All @@ -115,43 +116,45 @@ EOF
# options
while [[ $# -gt 0 && "x$1" == x--* ]]; do
if [[ "x$1" == x--version ]]; then
echo "make-jpkg $version"
exit 0
echo "make-jpkg $version"
exit 0
elif [[ "x$1" == x--help ]]; then
print_usage
exit 0
print_usage
exit 0
elif [[ "x$1" == x--jce-policy ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
jce_archive="$1"
[ $# -le 1 ] && missing_argument "$1"
shift
jce_archive="$1"
elif [[ "x$1" == x--full-name ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
maintainer_name="$1"
[ $# -le 1 ] && missing_argument "$1"
shift
maintainer_name="$1"
elif [[ "x$1" == x--email ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
maintainer_email="$1"
[ $# -le 1 ] && missing_argument "$1"
shift
maintainer_email="$1"
elif [[ "x$1" == x--distribution ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
distribution="$1"
[ $# -le 1 ] && missing_argument "$1"
shift
distribution="$1"
elif [[ "x$1" == x--priority ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
priority_override="$1"
[ $# -le 1 ] && missing_argument "$1"
shift
priority_override="$1"
elif [[ "x$1" == x--revision ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
revision="-${1}"
[ $# -le 1 ] && missing_argument "$1"
shift
revision="-${1}"
elif [[ "x$1" == x--changes ]]; then
genchanges="true"
genchanges="true"
elif [[ "x$1" == x--source ]]; then
build_source="true"
build_source="true"
elif [[ "x$1" == x--with-system-certs ]]; then
create_cert_softlinks="true"
create_cert_softlinks="true"
elif [[ "x$1" == x--no-validate ]]; then
NO_VALIDATE=true
else
unrecognized_option "$1"
unrecognized_option "$1"
fi
shift
done
Expand Down