diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-03-11 13:44:56 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-03-11 13:44:56 +0100 |
commit | b0281c1f85742068f4bc39726c9346e08bc80925 (patch) | |
tree | 1f51f3cf13c2fd6695c6703c1f177c35f3a2bef6 /scripts | |
parent | e361399f928fcaa3aa63e021e71d508b321201fa (diff) | |
download | ptxdist-b0281c1f85742068f4bc39726c9346e08bc80925.tar.gz ptxdist-b0281c1f85742068f4bc39726c9346e08bc80925.tar.xz |
[libptxdist] remove ptxd_generic_option_parser
The only user "make_archive.sh" has been removed, so remove this, too.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/libptxdist.sh | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 4d9ff5c45..57cf517c4 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -648,98 +648,3 @@ ptxd_ipkg_rev_smaller() { ptxd_error "packets $1 and $2 have the same revision" } - - - -# -# create generic option parser -# <stdin> --> Option List: -# SYMBOL NAME HELPTEXT -# -# proof of concept / test implementation -# FIXME: This should be read and written -# without tmpfiles and it is nasty anyway ;-) -# -# Use at your own risk - -ptxd_generic_option_parser(){ -TMPDIR=`mktemp -d /tmp/ptxdist.XXXXXX` || exit 1 -INFILE=$TMPDIR/infile -OUTFILE=$TMPDIR/outfile -while read line ; do - echo $line >> $INFILE -done -cat << EOF > $OUTFILE - -check_argument(){ -case "\$1" in - --*|"") - ptxd_debug "missing argument" - return 1 - ;; - [[:alnum:]/]*) - return 0 - ;; -esac -} - -usage() { - echo - [ -n "\$1" ] && echo -e "\${PREFIX} error: \$1\n" - echo "$PROGRAM_DESCRIPTION" - echo - echo "usage: \`basename \$0\` <args>" - echo - echo " Arguments:" - echo -EOF -while read SYMBOL OPTION DESCRIPTION ; do -cat << EOF >> $OUTFILE - echo -e " --$OPTION\\t $DESCRIPTION" -EOF -done < $INFILE -cat << EOF >> $OUTFILE - echo - echo " \`basename \$0\` returns with an exit status != 0 if something failed." - echo - exit 0 -} - -# -# Option parser -# -# FIXME: rsc wants to reimplement this with getopt -# -invoke_parser(){ -while [ \$# -gt 0 ]; do - case "\$1" in - - --help) usage ;; -EOF -while read SYMBOL OPTION DESCRIPTION ; do -cat << EOF >> $OUTFILE - --$OPTION) - check_argument \$2 - if [ "\$?" = "0" ] ; then - $SYMBOL="\$2"; - shift 2 ; - else - ptxd_debug "skipping option \$1"; - shift 1 ; - fi - ;; -EOF -done < $INFILE -cat << EOF >> $OUTFILE - *) - usage "unknown option \$1" - ;; - esac -done -} -# cleanup -rm -f $INFILE $OUTFILE || exit 1 -rmdir $TMPDIR || exit 1 -EOF -echo "$OUTFILE" -} |