Try and detect an old-style config file and print an appropriate error
message and a suggestion for correcting it. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@81 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
e88ba65e10
commit
9048a30982
|
@ -75,3 +75,9 @@ ${DOCDIR}/avrprog.pdf : avrprog.pdf
|
||||||
${CONFIGDIR}/avrprog.conf.sample : avrprog.conf.sample
|
${CONFIGDIR}/avrprog.conf.sample : avrprog.conf.sample
|
||||||
${INSTALL_DATA} avrprog.conf.sample $@
|
${INSTALL_DATA} avrprog.conf.sample $@
|
||||||
|
|
||||||
|
${CONFIGDIR}/avrprog.conf : avrprog.conf.sample
|
||||||
|
@if [ -f ${CONFIGDIR}/avrprog.conf ]; then \
|
||||||
|
cp -p ${CONFIGDIR}/avrprog.conf ${CONFIGDIR}/avrprog.conf.old; \
|
||||||
|
fi
|
||||||
|
${INSTALL_DATA} avrprog.conf.sample $@
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,12 @@ yes { yylval=new_token(K_YES); return K_YES; }
|
||||||
"\n" { lineno++; }
|
"\n" { lineno++; }
|
||||||
[ \t]+ /* ignore whitespace */
|
[ \t]+ /* ignore whitespace */
|
||||||
|
|
||||||
|
c: { fprintf(stderr, "error at %s:%d: possible old-style config file entry\n",
|
||||||
|
infile, lineno);
|
||||||
|
fprintf(stderr, " Update your config file (see %s%s for a sample)\n",
|
||||||
|
CONFIG_DIR, "/avrprog.conf.sample");
|
||||||
|
exit(1); }
|
||||||
|
|
||||||
. { fprintf(stderr, "error at %s:%d unrecognized character: \"%s\"\n",
|
. { fprintf(stderr, "error at %s:%d unrecognized character: \"%s\"\n",
|
||||||
infile, lineno, yytext); exit(1); }
|
infile, lineno, yytext); exit(1); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue