diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-01-03 03:12:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-01-03 03:12:27 +0000 |
commit | b1e41592e384b305dae41eb826b71a835c8cf797 (patch) | |
tree | 02074845e8a7ee7bff5cc4ade84a269f29e2a221 /sci-calculators | |
parent | mips stable (diff) | |
download | historical-b1e41592e384b305dae41eb826b71a835c8cf797.tar.gz historical-b1e41592e384b305dae41eb826b71a835c8cf797.tar.bz2 historical-b1e41592e384b305dae41eb826b71a835c8cf797.zip |
old
Diffstat (limited to 'sci-calculators')
11 files changed, 0 insertions, 456 deletions
diff --git a/sci-calculators/pcalc/files/digest-pcalc-1.0.0-r1 b/sci-calculators/pcalc/files/digest-pcalc-1.0.0-r1 deleted file mode 100644 index e539027efc6d..000000000000 --- a/sci-calculators/pcalc/files/digest-pcalc-1.0.0-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 19ba589b61b7c302ca4570a6c75a4df1 pcalc-000.tar.gz 103437 -RMD160 cf06c5541c80056c2ee5b9dd972438eb2431a6b5 pcalc-000.tar.gz 103437 -SHA256 27988085fb0615a1971bc9ae982f2529afe7370dc18705ae4dfbaea1b1fe73b9 pcalc-000.tar.gz 103437 diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-duplicated-case.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-duplicated-case.patch deleted file mode 100644 index 9b734fb90fdd..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-duplicated-case.patch +++ /dev/null @@ -1,21 +0,0 @@ -The \".*\" case is duplicated, remove the useless version ;). - ---- pcalc-000/pcalcl.l -+++ pcalc-000/pcalcl.l -@@ -287,16 +287,6 @@ - #endif - } - --\".*\" { -- #ifdef TEST -- printf(" String: [ %s ]\n", yytext); -- #endif -- -- #ifdef RET_EACH -- //return(STR); -- #endif -- } -- - ";" { - count(); - diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-error-handler.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-error-handler.patch deleted file mode 100644 index fc1980e84644..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-error-handler.patch +++ /dev/null @@ -1,26 +0,0 @@ -We can't use execerror yet because it assumes the jumpbuf has -been setup which it hasn't just yet. Dump errors with fprintf -to stderr instead. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -188,7 +188,7 @@ - yyin = fopen(&argv[1][1], "rt"); - if(!yyin) - { -- printf("Cannot find file.\n"); -+ fprintf(stderr, "Cannot find file.\n"); - exit(0); - } - } -@@ -211,7 +211,7 @@ - - if(!yyin) - { -- execerror( "cannot create tmp file\n", NULL); exit(0); -+ fprintf(stderr, "cannot create tmp file\n"); exit(0); - } - fwrite(buff, len, 1, yyin); - fputc('\n', yyin); diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-flex.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-flex.patch deleted file mode 100644 index a34c2c604725..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-flex.patch +++ /dev/null @@ -1,24 +0,0 @@ -Tweaks so pcalc will build with flex 2.5.4a and 2.5.31. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalcl.l -+++ pcalcl.l -@@ -15,8 +15,6 @@ - extern YYSTYPE yylval; - extern int lineno; - --/* default yywrap function - always treat EOF as an EOF */ --#define yywrap() 1 - - - char *name; ---- Makefile -+++ Makefile -@@ -36,5 +36,5 @@ - - pcalc: $(OB0) $(OB1) $(OB2) $(OB3) $(OB4) $(OB5) $(OB6) $(OB7) $(OB8) $(OB9) -- $(CC) $(CFLAGS) $(OB0) $(OB1) $(OB2) $(OB3) $(OB4) $(OB5) $(OB6) $(OB7) $(OB8) $(OB9) -o pcalc -lm -+ $(CC) $(CFLAGS) $(OB0) $(OB1) $(OB2) $(OB3) $(OB4) $(OB5) $(OB6) $(OB7) $(OB8) $(OB9) -o pcalc -lm -lfl - - pcalc.c: pcalc.y diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-input-overflow-check.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-input-overflow-check.patch deleted file mode 100644 index fc706c106e40..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-input-overflow-check.patch +++ /dev/null @@ -1,40 +0,0 @@ -Make sure we don't blow up if the user enters a lot of stuff (buff is -normally a char[512], so if user gives us 5000 chars ...). - -Also trim unused/duplicated variables. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -148,13 +148,6 @@ - int (*ptr_getchar)(); - int (*ptr_ungetc)(); - --FILE *in_fp = NULL; -- --int len; --char buff[512]; -- --FILE *in_fp; -- - int main(int argc, char *argv[]) - - { -@@ -203,8 +203,16 @@ - int len, cnt; - int tmpfile; -+ char buff[512]; - -+ len = 0; - for(cnt = args+1; cnt < argc; cnt++) - { -+ len += strlen(argv[cnt]) + 1; -+ if (len >= sizeof(buff)) -+ { -+ fprintf(stderr, "Input is too long (max of %lu chars allowed)\n", (unsigned long)sizeof(buff)); -+ exit(1); -+ } - strcat(buff, argv[cnt]); strcat(buff, " "); - } - diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch deleted file mode 100644 index 438b39b0e772..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch +++ /dev/null @@ -1,106 +0,0 @@ -Change operator order so that binary 'or' and binary 'and' are -not on the same level, but so that 'and' comes before 'or'. -This is to match the standard C precedence. - -Also add support for the % (modulus), < (binary left shift), -and > (binary right shift) operators. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/README -+++ pcalc-000/README -@@ -60,10 +60,12 @@ - Operator priorities: - -- LOW '=' assignment -- or and binary or/binary and -- '+' '-' addition/subtruction -- '*' '/' multiply/divide -- '-' unary minus -- HIGH '^' exponentation -+ LOW '=' assignment -+ or binary or -+ and binary and -+ '>' '<' binary left/right shift -+ '+' '-' addition/subtruction -+ '*' '/' '%' multiply/divide/modulus -+ '-' unary minus -+ HIGH '^' exponentation - - Syntax: ---- pcalc-000/help.c -+++ pcalc-000/help.c -@@ -40,5 +40,5 @@ - \n\ - Operators:\n\ -- '+' '-' '*' '/' '^'\n\ -+ '+' '-' '*' '/' '%' '^'\n\ - \n\ - Constants: (case sensitive)\n\ -@@ -81,10 +81,12 @@ - Operator priorities:\n\ - \n\ -- right assotiation: '=' ASSIGNMENT\n\ -- left assotiation: or and BINARY OR/BINARY AND\n\ -- left assotiation: '+' '-' ADDITION/SUBTRUCTION\n\ -- left assotiation: '*' '/' MULTIPLY/DIVIDE\n\ -- left assotiation: '-' UNARY MINUS\n\ -- right assotiation: '^' EXPONENTATION\n\ -+ right assotiation: '=' ASSIGNMENT\n\ -+ left assotiation: or BINARY OR\n\ -+ left assotiation: and BINARY AND\n\ -+ left assotiation: '<' '>' BINARY LEFT/RIGHT SHIFT\n\ -+ left assotiation: '+' '-' ADDITION/SUBTRUCTION\n\ -+ left assotiation: '*' '/' '%' MULTIPLY/DIVIDE\n\ -+ left assotiation: '-' UNARY MINUS\n\ -+ right assotiation: '^' EXPONENTATION\n\ - \n\ - "); ---- pcalc-000/pcalc.txt -+++ pcalc-000/pcalc.txt -@@ -59,10 +59,12 @@ - Operator priorities:
-
-- LOW '=' assignment
-- or and binary or/binary and
-- '+' '-' addition/subtruction
-- '*' '/' multiply/divide
-- '-' unary minus
-- HIGH '^' exponentation
-+ LOW '=' assignment
-+ or binary or
-+ and binary and
-+ '<' '>' binary left/right shift
-+ '+' '-' addition/subtruction
-+ '*' '/' '%' multiply/divide/modulus
-+ '-' unary minus
-+ HIGH '^' exponentation
-
- Syntax:
---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -59,7 +59,9 @@ - - %right '=' --%left '|' '&' -+%left '|' -+%left '&' -+%left '<' '>' - %left '+' '-' --%left '*' '/' -+%left '*' '/' '%' - %left UNARYMINUS - %right '^' /* exponentiation */ -@@ -113,4 +113,6 @@ - | expr '|' expr { $$ = (long)$1 | (long)$3 ;} - | expr '&' expr { $$ = (long)$1 & (long)$3 ;} -+ | expr '<' expr { $$ = (long)$1 << (long)$3 ; } -+ | expr '>' expr { $$ = (long)$1 >> (long)$3 ; } - | expr '+' expr { $$ = $1 + $3 ; } - | expr '-' expr { $$ = $1 - $3 ; } -@@ -119,4 +120,5 @@ - $$ = $1 / $3 ; - } -+ | expr '%' expr { $$ = (long)$1 % (long)$3 ; } - | expr '^' expr { $$ = Pow( $1, $3) ; } - | '(' expr ')' { $$ = $2 ; } diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-static-vars.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-static-vars.patch deleted file mode 100644 index 8f569a958ba4..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-static-vars.patch +++ /dev/null @@ -1,49 +0,0 @@ -Declare all the work_str vars static since they'll conflict badly -with each other if we don't. pcalc.y doesn't actually use work_str. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/funct.c -+++ pcalc-000/funct.c -@@ -50,7 +50,7 @@ - - /* -------- Strings: ----------------------------------------------------- */ - --char work_str[2000]; -+static char work_str[2000]; - - /* -------- Implementation: ---------------------------------------------- */ - ---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -37,7 +37,7 @@ - - extern FILE * yyin ; - -- char work_str[128]; -+ //static char work_str[128]; - - %} - ---- pcalc-000/print.c -+++ pcalc-000/print.c -@@ -31,7 +31,7 @@ - - /* -------- Implementation: ---------------------------------------------- */ - --char work_str[128]; -+static char work_str[128]; - - void print_num(double var) - ---- pcalc-000/store.c -+++ pcalc-000/store.c -@@ -27,7 +27,7 @@ - - /* -------- Implementation: ---------------------------------------------- */ - --char work_str[128]; -+static char work_str[128]; - - int store(char *file, char *name, double var) - diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-string-overflow-checks.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-string-overflow-checks.patch deleted file mode 100644 index 90eb32edfd0a..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-string-overflow-checks.patch +++ /dev/null @@ -1,41 +0,0 @@ -Make sure we don't overflow buffers if input is really big. - -Also move the string array to local scope. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- str.c -+++ str.c -@@ -103,4 +103,11 @@ - break; - } -+ else if(str2-str+1 >= lim) -+ { -+ fprintf(stderr, "String too large for buffer of %i chars; truncated\n", lim-1); -+ ret_val = FALSE; -+ *str2 = '\0'; -+ break; -+ } - switch(*str2) - { ---- funct.c -+++ funct.c -@@ -88,5 +88,4 @@ - } - --char string[128]; - - /* the date function */ -@@ -97,4 +96,5 @@ - struct tm *loc_time; - time_t lt; -+ char string[128]; - - lt = time(NULL); -@@ -102,5 +102,5 @@ - str_esc(str, work_str, sizeof(work_str)); - loc_time = localtime(<); -- strftime(string, 128, work_str, loc_time); -+ strftime(string, sizeof(string), work_str, loc_time); - - printf("%s", string); diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-tmpfile.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-tmpfile.patch deleted file mode 100644 index 372cfc9ee108..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-tmpfile.patch +++ /dev/null @@ -1,79 +0,0 @@ -Fix the tempfile handling to avoid race conditions. Also use /tmp as -a fallback if $PWD is read-only for whatever reason. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -151,7 +151,10 @@ - int main(int argc, char *argv[]) - - { -- int comm = 0, args; -+ int args; -+ char template_local[] = "pcalc.tmp.XXXXXX", -+ template_global[] = "/tmp/pcalc.tmp.XXXXXX", -+ *template; - char *env; - - args = parse_comline(argc, argv); -@@ -198,6 +199,7 @@ - - char *commandline; - int len, cnt; -+ int tmpfile; - - for(cnt = args+1; cnt < argc; cnt++) - { -@@ -207,19 +209,27 @@ - //printf("CMDLINE='%s'\n", buff); - - len = strlen(buff); -- yyin = fopen("pcalc.tmp", "w"); -+ template = template_local; -+ tmpfile = mkstemp(template); - -- if(!yyin) -+ if(tmpfile == -1) - { -- fprintf(stderr, "cannot create tmp file\n"); exit(0); -+ template = template_global; -+ tmpfile = mkstemp(template); -+ if(tmpfile == -1) -+ { -+ fprintf(stderr, "cannot create tmp file\n"); exit(0); -+ } - } -- fwrite(buff, len, 1, yyin); -- fputc('\n', yyin); -- //fputc(0x1a, yyin); -- fclose(yyin); -+ write(tmpfile, buff, len); -+ write(tmpfile, "\n", 1); -+ //write(tmpfile, "\x1a", 1); -+ lseek(tmpfile, 0, SEEK_SET); - -- yyin = fopen("pcalc.tmp", "r"); -- comm = 1; -+ yyin = fdopen(tmpfile, "r"); -+ /* XXX: hack! unlink here because if parsing fails, flex will -+ * exit and we won't be able to unlink the file below */ -+ unlink(template); - } - - init_sym() ; -@@ -228,10 +229,10 @@ - yyparse() ; - - if(yyin) -- fclose(yyin); -- -- if(comm) -- unlink("pcalc.tmp"); -+ { -+ unlink(template); /* unlink before we close to avoid race */ -+ fclose(yyin); /* this closes tmpfile too */ -+ } - - return 0 ; - } diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-usage.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-usage.patch deleted file mode 100644 index 55f526fbfcc3..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-usage.patch +++ /dev/null @@ -1,23 +0,0 @@ -Add support for the -h switch. - ---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -315,6 +315,18 @@ - { - switch(argv[i][1]) - { -+ case 'h' : -+ printf ( -+ "\nProgrammer's calculator by Peter Glen.\n\n" -+ "Usage: pcalc <stuff to calculate>\n" -+ " pcalc @script\n" -+ "\nOptions:\n" -+ " -s,-S silent mode\n" -+ " -b,-B silent mode\n" -+ " -v version\n" -+ " -h help\n" -+ "\nFor more info, run pcalc without any options, or see the README.\n\n"); -+ - case 'S' : /* quiet mode */ - case 's' : - fSilent = 1; diff --git a/sci-calculators/pcalc/pcalc-1.0.0-r1.ebuild b/sci-calculators/pcalc/pcalc-1.0.0-r1.ebuild deleted file mode 100644 index ffc8abf77f4c..000000000000 --- a/sci-calculators/pcalc/pcalc-1.0.0-r1.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-calculators/pcalc/pcalc-1.0.0-r1.ebuild,v 1.5 2006/06/30 23:14:29 vapier Exp $ - -inherit eutils - -DESCRIPTION="the programmers calculator" -HOMEPAGE="http://ibiblio.org/pub/Linux/apps/math/calc/pcalc.lsm" -SRC_URI="http://ibiblio.org/pub/Linux/apps/math/calc/pcalc-000.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86" -IUSE="" - -DEPEND="sys-devel/flex - sys-devel/bison" -RDEPEND="" - -S=${WORKDIR}/${PN}-000 - -src_unpack() { - unpack ${A} - cd "${S}" - rm -f pcalc - epatch "${FILESDIR}"/${P}-static-vars.patch - epatch "${FILESDIR}"/${P}-error-handler.patch - epatch "${FILESDIR}"/${P}-tmpfile.patch - epatch "${FILESDIR}"/${P}-input-overflow-check.patch - epatch "${FILESDIR}"/${P}-operator-updates.patch - epatch "${FILESDIR}"/${P}-usage.patch - epatch "${FILESDIR}"/${P}-string-overflow-checks.patch - epatch "${FILESDIR}"/${P}-duplicated-case.patch - epatch "${FILESDIR}"/${P}-flex.patch -} - -src_test() { - make test || die "make test failed :(" -} - -src_install() { - dobin pcalc || die "dobin pcalc" - dodoc EXAMPLE README -} |