diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/CHANGELOG
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/CHANGELOG 2005-06-14 21:42:20.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/CHANGELOG 2005-08-06 12:59:17.000000000 +0200
@@ -1,5 +1,23 @@
----------------------------------------------------------------
+0.3.7 - 06.08.2005
+
+* Added better error detection and error reporting in EEE.
+
+* Added --eee-info.
+
+* Added RUBYSCRIPT2EXE_TEMPDIR.
+
+* Fixed a bug concerning the variable command which wasn't
+ "declared" in one specific situation.
+
+* Went back to FPC 1.9.8 (from 2.0.0) on Linux, because of some
+ access violations.
+
+* Updated to FPC 1.9.8 (from 1.9.5) on Darwin.
+
+----------------------------------------------------------------
+
0.3.6 - 14.06.2005
* Fixed a bug concerning spaces in %TEMP%.
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/eee.pas
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.pas 2005-06-14 21:44:16.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/eee.pas 2005-08-06 12:59:36.000000000 +0200
@@ -27,15 +27,18 @@
end;
tail = record
- exename : string[255];
+ eeeexe : string[255];
+ appname : string[255];
+ tempdir : string[255];
gzlength : longint;
who : string[255];
number : longint;
end;
var
+ temp : string[255];
+ orgdir : string[255];
tempdir : string[255];
- workdir : string[255];
workdir1 : string[255];
workdir2 : string[255];
workfile : string[255];
@@ -46,7 +49,6 @@
tekst1 : string[255];
tekst2 : string;
workdirnumber : string[255];
- dir : string[255];
h : header;
t : tail;
teller : longint;
@@ -54,6 +56,8 @@
quotedparms : string;
justextract : boolean;
list : boolean;
+ info : boolean;
+ appname : string;
returncode : integer;
{$IFDEF WIN32}
@@ -65,27 +69,76 @@
{$IFDEF WIN32}
function GetShortPathNameA(LongName, ShortName: Pchar; ccbuffer: Dword): Dword; stdcall external 'kernel32.dll' name 'GetShortPathNameA';
+ function MessageBox(p1: longint; p2, p3: pChar; p4: longint): longint; stdcall; external 'user32.dll' name 'MessageBoxA';
+{$ENDIF}
+
+{**********************************************************************}
+
+procedure message(msg: string);
+
+{$IFDEF WIN32}
+var
+ appname2 : string;
{$ENDIF}
+begin
+
+ {$IFDEF WIN32}
+ if IsConsole then begin
+ writeln(appname + ': ' + msg);
+ end
+ else begin
+ msg := msg + #0;
+ appname2 := appname + #0;
+
+ MessageBox(0, @msg[1], @appname2[1], 0);
+ end;
+ {$ELSE}
+ writeln(appname + ': ' + msg);
+ {$ENDIF}
+
+end;
+
+{**********************************************************************}
+
+procedure error(msg: string);
+
+begin
+
+ message(msg);
+
+ // ??? Possible loop ??? recursivedelete(tempdir);
+
+ halt(8);
+
+end;
+
+{**********************************************************************}
+
function getshortpathname(dir: String): String;
{$IFDEF WIN32}
var
- longname : pchar;
- shortname : pchar;
- buffer : dword;
+ longname : string;
+ shortname : string;
+ l : longint;
{$ENDIF}
begin
{$IFDEF WIN32}
- longname := pchar(dir+'');
- shortname := pchar(dir+'');
- buffer := 255;
+ longname := dir + #0;
+ shortname := '';
+
+ for teller := 1 to 255 do begin
+ shortname := shortname + ' '; // This is stupid...
+ end;
- GetShortPathNameA(longname, shortname, buffer);
+ l := GetShortPathNameA(@longname[1], @shortname[1], length(shortname));
- dir := shortname;
+ if (l > 0) then begin
+ dir := AnsiMidStr(shortname, 1, l);
+ end;
{$ENDIF}
getshortpathname := dir;
@@ -115,10 +168,12 @@
{**********************************************************************}
-procedure chdir2(dir: string[255]);
+procedure chdir2(dir: string[255]; continueonfailure: boolean);
begin
+ {$I-}
+
{$IFDEF WIN32}
chdir(dir);
{$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn.
@@ -131,6 +186,16 @@
chdir(dir);
{$ENDIF}
+ if (ioresult <> 0) then begin
+ message('Couldn''t change directory: "' + dir + '"');
+
+ if (not continueonfailure) then begin
+ halt(8);
+ end;
+ end;
+
+ {$I+}
+
end;
{**********************************************************************}
@@ -146,46 +211,45 @@
begin
getdir2(0, dir);
- chdir2(path);
-
- {$IFDEF WIN32}
- findfirst('*.*', anyfile or directory, sr);
- {$ELSE}
- findfirst('*', anyfile or directory, sr);
- {$ENDIF}
- while(doserror = 0) do begin
- assign(f, sr.name); // Foutje in 1.9.2 ???
- getfattr(f, attr); // Foutje in 1.9.2 ???
- if (attr and directory > 0) then begin
- if ((not (sr.name = '.')) and (not (sr.name = '..'))) then begin
- recursivedelete(sr.name);
- end;
- end
- else begin
+ {$I-}
+ chdir2(path, true);
+ {$I+}
- {$I-}
- assign(f, sr.name);
- erase(f);
- if (ioresult <> 0) then begin
- // Somehow, ioresult has to be touched.
+ if (ioresult = 0) then begin
+ {$IFDEF WIN32}
+ findfirst('*.*', anyfile or directory, sr);
+ {$ELSE}
+ findfirst('*', anyfile or directory, sr);
+ {$ENDIF}
+ while (doserror = 0) do begin
+ assign(f, sr.name); // Foutje in 1.9.2 ???
+ getfattr(f, attr); // Foutje in 1.9.2 ???
+
+ if (attr and directory > 0) then begin
+ if ((not (sr.name = '.')) and (not (sr.name = '..'))) then begin
+ recursivedelete(sr.name);
end;
- {$I+}
-
- end;
+ end
+ else begin
- findnext(sr);
- end;
- findclose(sr);
+ {$I-}
+ assign(f, sr.name);
+ erase(f); if (ioresult <> 0) then;
+ {$I+}
- chdir2(dir);
+ end;
- {$I-}
- rmdir(path + slash);
- if (ioresult <> 0) then begin
- // Somehow, ioresult has to be touched.
+ findnext(sr);
end;
- {$I+}
+ findclose(sr);
+
+ chdir2(dir, false);
+
+ {$I-}
+ rmdir(path + slash); if (ioresult <> 0) then;
+ {$I+}
+ end;
end;
@@ -206,7 +270,9 @@
if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b)
else l := sizeof(b);
- blockread(infile, b, l);
+ {$I-}
+ blockread(infile, b, l); if (ioresult <> 0) then error('Couldn''t read file (BLOCKEAT).');
+ {$I+}
dec(c);
end;
@@ -230,7 +296,9 @@
if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b)
else l := sizeof(b);
- gzread(zfile, addr(b), l);
+ {$I-}
+ gzread(zfile, addr(b), l); if (ioresult <> 0) then error('Couldn''t read file (BLOCKEATFROMGZ).');
+ {$I+}
dec(c);
end;
@@ -255,8 +323,10 @@
if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b)
else l := sizeof(b);
- blockread(infile, b, l, n);
- blockwrite(outfile, b, n);
+ {$I-}
+ blockread(infile, b, l, n); if (ioresult <> 0) then error('Couldn''t read file (BLOCKCOPY).');
+ blockwrite(outfile, b, n); if (ioresult <> 0) then error('Couldn''t write file (BLOCKCOPY).');
+ {$I+}
dec(c);
end;
@@ -281,8 +351,10 @@
if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b)
else l := sizeof(b);
- blockread(infile, b, l, n);
- gzwrite(zfile, addr(b), n);
+ {$I-}
+ blockread(infile, b, l, n); if (ioresult <> 0) then error('Couldn''t read file (BLOCKCOPYTOGZ).');
+ gzwrite(zfile, addr(b), n); if (ioresult <> 0) then error('Couldn''t write file (BLOCKCOPYTOGZ).');
+ {$I+}
dec(c);
end;
@@ -307,8 +379,10 @@
if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b)
else l := sizeof(b);
- n := gzread(zfile, addr(b), l);
- blockwrite(outfile, b, n);
+ {$I-}
+ n := gzread(zfile, addr(b), l); if (ioresult <> 0) then error('Couldn''t read file (BLOCKCOPYFROMGZ).');
+ blockwrite(outfile, b, n); if (ioresult <> 0) then error('Couldn''t write file (BLOCKCOPYFROMGZ).');
+ {$I+}
dec(c);
end;
@@ -328,10 +402,12 @@
h.klasse := klasse;
h.tekst := tekst;
- assign(infile, entry);
- reset(infile, 1);
- h.datalength := filesize(infile);
- gzwrite(zfile, addr(h), sizeof(h));
+ {$I-}
+ assign(infile, entry);
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + entry + '"');
+ h.datalength := filesize(infile);
+ gzwrite(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t write file (GZFILE).');
+ {$I+}
blockcopytogz(infile, zfile, h.datalength);
close(infile);
@@ -354,7 +430,9 @@
h.tekst := tekst;
h.datalength := 0;
- gzwrite(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzwrite(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t write file (GZFILE).');
+ {$I+}
t.number := t.number + 1;
@@ -377,14 +455,14 @@
pakin_d(zfile, 'd', tekst, entry, t);
getdir2(0, dir);
- chdir2(entry);
+ chdir2(entry, false);
{$IFDEF WIN32}
findfirst('*.*', anyfile or directory, sr);
{$ELSE}
findfirst('*', anyfile or directory, sr);
{$ENDIF}
- while(doserror = 0) do begin
+ while (doserror = 0) do begin
assign(f, sr.name); // Foutje in 1.9.2 ???
getfattr(f, attr); // Foutje in 1.9.2 ???
@@ -401,7 +479,7 @@
end;
findclose(sr);
- chdir2(dir);
+ chdir2(dir, false);
end;
@@ -420,7 +498,9 @@
h.tekst := tekst;
h.datalength := 0;
- gzwrite(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzwrite(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t write file (GZFILE).');
+ {$I+}
t.number := t.number + 1;
@@ -441,7 +521,9 @@
h.tekst := tekst;
h.datalength := 0;
- gzwrite(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzwrite(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t write file (GZFILE).');
+ {$I+}
t.number := t.number + 1;
@@ -462,7 +544,9 @@
h.tekst := tekst;
h.datalength := 0;
- gzwrite(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzwrite(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t write file (GZFILE).');
+ {$I+}
t.number := t.number + 1;
@@ -478,7 +562,7 @@
outfile : file of byte;
s : string;
i : longint;
- exename : string[255];
+ eeeexe : string[255];
{$IFDEF WIN32}
{$ELSE}
@@ -488,26 +572,43 @@
begin
- assign(eeefile, paramstr(1));
- reset(eeefile);
+ {$I-}
+ assign(eeefile, paramstr(1));
+ reset(eeefile); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(1) + '"');
+ {$I+}
- exename := getshortpathname(getenv('EEE_EXE'));
- if (exename = '') then begin
- exename := paramstr(0);
+ if (getenv('EEE_EXE') <> '') then begin
+ eeeexe := getshortpathname(getenv('EEE_EXE'));
+ end
+ else begin
+ eeeexe := paramstr(0);
end;
- t.exename := exename;
+ appname := paramstr(2);
+
+ s := slash;
+ i := posex(s, appname);
+ while (i > 0) do begin
+ appname := AnsiMidStr(appname, i+length(s), length(appname)-(i+length(s))+1);
+ i := posex(s, appname);
+ end;
+
+ t.eeeexe := eeeexe;
+ t.appname := appname;
+ t.tempdir := getenv('EEE_TEMPDIR');
t.number := 0;
t.who := me;
s := slash;
- i := posex(s, t.exename);
+ i := posex(s, t.eeeexe);
while (i > 0) do begin
- t.exename := AnsiMidStr(t.exename, i+length(s), length(t.exename)-(i+length(s))+1);
- i := posex(s, t.exename);
+ t.eeeexe := AnsiMidStr(t.eeeexe, i+length(s), length(t.eeeexe)-(i+length(s))+1);
+ i := posex(s, t.eeeexe);
end;
- zfile := gzopen(workfile, 'w');
+ {$I-}
+ zfile := gzopen(workfile, 'w'); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
repeat
readln(eeefile, s);
@@ -531,21 +632,29 @@
close(eeefile);
- assign(outfile, paramstr(2));
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, paramstr(2));
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(2) + '"');
+ {$I+}
- assign(infile, exename);
- reset(infile, 1);
+ {$I-}
+ assign(infile, eeeexe);
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + eeeexe + '"');
+ {$I+}
blockcopy(infile, outfile, filesize(infile));
close(infile);
- assign(infile, workfile);
- reset(infile, 1);
+ {$I-}
+ assign(infile, workfile);
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
blockcopy(infile, outfile, filesize(infile));
t.gzlength := filesize(infile);
close(infile);
- blockwrite(outfile, t, sizeof(t));
+ {$I-}
+ blockwrite(outfile, t, sizeof(t)); if (ioresult <> 0) then error('Couldn''t write: "' + paramstr(2) + '"');
+ {$I+}
close(outfile);
@@ -564,8 +673,10 @@
begin
- assign(outfile, workdir + slash + tekst);
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, tempdir + slash + tekst);
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + tempdir + slash + tekst + '"');
+ {$I+}
blockcopyfromgz(zfile, outfile, h.datalength);
@@ -583,7 +694,7 @@
outfile := outfile;
h := h;
- mkdir(workdir + slash + tekst);
+ mkdir(tempdir + slash + tekst);
end;
@@ -660,9 +771,9 @@
{$ENDIF}
getdir2(0, dir);
- chdir2(workdir);
+ chdir2(tempdir, false);
returncode := executeprocess(c, p);
- chdir2(dir);
+ chdir2(dir, false);
end;
@@ -675,12 +786,14 @@
begin
- assign(infofile, workdir + slash + tekst);
- rewrite(infofile);
+ {$I-}
+ assign(infofile, tempdir + slash + tekst);
+ rewrite(infofile); if (ioresult <> 0) then error('Couldn''t open: "' + tempdir + slash + tekst + '"');
+ {$I+}
writeln(infofile, 'EEE_APPEXE=' + paramstr(0));
- writeln(infofile, 'EEE_EEEEXE=' + t.exename);
- writeln(infofile, 'EEE_TEMPDIR=' + workdir);
+ writeln(infofile, 'EEE_EEEEXE=' + t.eeeexe);
+ writeln(infofile, 'EEE_TEMPDIR=' + tempdir);
writeln(infofile, 'EEE_PARMS=' + parms);
writeln(infofile, 'EEE_QUOTEDPARMS=' + quotedparms);
@@ -700,29 +813,38 @@
begin
- assign(infile, paramstr(0));
- reset(infile, 1);
+ {$I-}
+ assign(infile, paramstr(0));
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(0) + '"');
+ {$I+}
blockeat(infile, filesize(infile)-t.gzlength-sizeof(t));
- assign(outfile, workfile);
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, workfile);
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
blockcopy(infile, outfile, t.gzlength);
close(outfile);
close(infile);
- zfile := gzopen(workfile, 'r');
+ {$I-}
+ zfile := gzopen(workfile, 'r'); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
for i := 1 to t.number do begin
- gzread(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzread(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t read: "' + workfile + '"');
+ {$I+}
klasse := h.klasse;
tekst2 := h.tekst;
tekst2 := AnsiReplaceStr(tekst2, '%parms%', parms);
tekst2 := AnsiReplaceStr(tekst2, '%quotedparms%', quotedparms);
- tekst2 := AnsiReplaceStr(tekst2, '%tempdir%', workdir);
+ tekst2 := AnsiReplaceStr(tekst2, '%orgdir%', orgdir);
+ tekst2 := AnsiReplaceStr(tekst2, '%tempdir%', tempdir);
tekst2 := AnsiReplaceStr(tekst2, '%tempdir1%', workdir1);
tekst2 := AnsiReplaceStr(tekst2, '%tempdir2%', workdir2);
@@ -757,41 +879,55 @@
begin
- assign(infile, paramstr(0));
- reset(infile, 1);
+ {$I-}
+ assign(infile, paramstr(0));
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(0) + '"');
+ {$I+}
- assign(outfile, t.exename);
- rewrite(outfile);
+ {$I-}
+ assign(outfile, t.eeeexe);
+ rewrite(outfile); if (ioresult <> 0) then error('Couldn''t open: "' + t.eeeexe + '"');
+ {$I+}
blockcopy(infile, outfile, filesize(infile)-t.gzlength-sizeof(t));
close(outfile);
{$IFDEF WIN32}
{$ELSE}
c := '/bin/sh';
- p := '-c "chmod +x ' + t.exename;
+ p := '-c "chmod +x ' + t.eeeexe;
executeprocess(c, p);
{$ENDIF}
- assign(outfile, workfile);
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, workfile);
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
blockcopy(infile, outfile, t.gzlength);
close(outfile);
close(infile);
- zfile := gzopen(workfile, 'r');
+ {$I-}
+ zfile := gzopen(workfile, 'r'); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
- assign(eeefile, 'app.eee');
- rewrite(eeefile);
+ {$I-}
+ assign(eeefile, 'app.eee');
+ rewrite(eeefile); if (ioresult <> 0) then error('Couldn''t open file (app.eee).');
+ {$I+}
for i := 1 to t.number do begin
- gzread(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzread(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t read: "' + workfile + '"');
+ {$I+}
writeln(eeefile, h.klasse, ' ', h.tekst);
if (h.klasse = 'f') then begin
- assign(outfile, h.tekst);
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, h.tekst);
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + h.tekst + '"');
+ {$I+}
blockcopyfromgz(zfile, outfile, h.datalength);
@@ -800,8 +936,7 @@
if (h.klasse = 'd') then begin
{$I-}
- mkdir(h.tekst);
- if (ioresult = 0) then;
+ mkdir(h.tekst); if (ioresult = 0) then;
{$I+}
end;
end;
@@ -824,22 +959,30 @@
begin
- assign(infile, paramstr(0));
- reset(infile, 1);
+ {$I-}
+ assign(infile, paramstr(0));
+ reset(infile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(0) + '"');
+ {$I+}
blockeat(infile, filesize(infile)-t.gzlength-sizeof(t));
- assign(outfile, workfile);
- rewrite(outfile, 1);
+ {$I-}
+ assign(outfile, workfile);
+ rewrite(outfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
blockcopy(infile, outfile, t.gzlength);
close(outfile);
close(infile);
- zfile := gzopen(workfile, 'r');
+ {$I-}
+ zfile := gzopen(workfile, 'r'); if (ioresult <> 0) then error('Couldn''t open: "' + workfile + '"');
+ {$I+}
for i := 1 to t.number do begin
- gzread(zfile, addr(h), sizeof(h));
+ {$I-}
+ gzread(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t read: "' + workfile + '"');
+ {$I+}
if (h.klasse = 'f') then begin
writeln(h.klasse, ' ', h.tekst, ' (', h.datalength, ')');
@@ -857,23 +1000,37 @@
{**********************************************************************}
+procedure tooninfo;
+
begin
+ writeln('APPNAME : ', t.appname);
+ writeln('NUMBER OF ITEMS : ', t.number);
+ writeln('LENGTH OF GZ-FILE : ', t.gzlength);
+ writeln('EEEEXE : ', t.eeeexe);
+ writeln('TEMPDIR : ', t.tempdir);
+
+end;
+
+{**********************************************************************}
+
+begin
+
+ randomize;
+ filemode := 0;
+
{$IFDEF WIN32}
{$ELSE}
currentdir := '';
{$ENDIF}
- tempdir := getshortpathname(getenv('TEMP'));
- if (tempdir = '') then begin
- tempdir := '/tmp'
- end;
-
me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.';
justextract := false;
list := false;
+ info := false;
+ appname := 'EEE';
returncode := 0;
parms := '';
@@ -887,6 +1044,10 @@
list := true;
end;
+ if (paramstr(teller) = '--eee-info') then begin
+ info := true;
+ end;
+
if ((parms = '') and (quotedparms = '')) then begin
parms := paramstr(teller);
quotedparms := '''' + paramstr(teller) + '''';
@@ -897,35 +1058,51 @@
end;
end;
- randomize;
+ {$I-}
+ assign(ownfile, paramstr(0));
+ reset(ownfile, 1); if (ioresult <> 0) then error('Couldn''t open: "' + paramstr(0) + '"');
+ blockeat(ownfile, filesize(ownfile)-sizeof(t));
+ blockread(ownfile, t, sizeof(t)); if (ioresult <> 0) then error('Couldn''t read: "' + paramstr(0) + '"');
+ {$I+}
+ close(ownfile);
- getdir2(0, dir);
- chdir2(tempdir);
- {$I-}
- workdirnumber := '';
- repeat
- str(random(1000), workdirnumber);
- workdir := 'eee.' + workdirnumber;
- mkdir(workdir);
- until (ioresult = 0);
- {$I+}
- chdir2(dir);
+ if (t.who = me) then begin
+ appname := t.appname;
+ end;
- workdir := tempdir + slash + workdir;
- workfile := workdir + slash + 'eee.gz';
- workdir1 := AnsiReplaceStr(workdir, '\', '/');
- workdir2 := AnsiReplaceStr(workdir, '/', '\');
+ temp := getshortpathname(getenv('TEMP'));
+ if (temp = '') then begin
+ temp := '/tmp'
+ end;
- filemode := 0;
+ getdir2(0, orgdir);
+ chdir2(temp, false);
+ {$I-}
+ if ((t.tempdir <> '') and (t.who = me)) then begin
+ tempdir := t.tempdir;
+ mkdir(tempdir); if (ioresult <> 0) then error('Couldn''t create directory: "' + temp + slash + tempdir + '"');
+ end
+ else begin
+ workdirnumber := '';
+ teller := 1;
+ repeat
+ inc(teller);
+ str(teller, workdirnumber);
+ tempdir := 'eee.' + appname + '.' + workdirnumber;
+ mkdir(tempdir);
+ until (ioresult = 0);
+ end;
+ {$I+}
+ chdir2(orgdir, false);
- assign(ownfile, paramstr(0));
- reset(ownfile, 1);
- blockeat(ownfile, filesize(ownfile)-sizeof(t));
- blockread(ownfile, t, sizeof(t));
- close(ownfile);
+ tempdir := temp + slash + tempdir;
+ workfile := tempdir + slash + 'eee.gz';
+ workdir1 := AnsiReplaceStr(tempdir, '\', '/');
+ workdir2 := AnsiReplaceStr(tempdir, '/', '\');
- if (posex('eeew', lowercase(t.exename)) > 0) then begin
+ if (posex('eeew', lowercase(t.eeeexe)) > 0) then begin
list := false;
+ info := false;
end;
if (t.who <> me) then begin
@@ -940,12 +1117,17 @@
tooninhoud;
end
else begin
- pakuit;
+ if (info) then begin
+ tooninfo;
+ end
+ else begin
+ pakuit;
+ end;
end;
end;
end;
- recursivedelete(workdir);
+ recursivedelete(tempdir);
halt(returncode);
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/ftools.rb
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/ev/ftools.rb 2005-06-14 21:44:16.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/ftools.rb 2005-08-06 12:59:37.000000000 +0200
@@ -84,7 +84,7 @@
res += [entry] if mask.nil? or entry =~ mask
end
- res
+ res.sort
end
end
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-06-14 21:44:16.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-08-06 12:59:36.000000000 +0200
@@ -3,7 +3,7 @@
ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR")
ENV["NEWDIR"] = File.expand_path(File.dirname($0)) unless ENV.include?("NEWDIR")
-ENV["OWNDIR"] = File.expand_path(File.dirname((caller[-1] or $0).gsub(/:\d+$/, ""))) unless ENV.include?("OWNDIR")
+ENV["APPDIR"] = File.expand_path(File.dirname((caller[-1] or $0).gsub(/:\d+$/, ""))) unless ENV.include?("APPDIR")
ENV["TEMPDIR"] = dir unless ENV.include?("TEMPDIR")
class Dir
@@ -77,10 +77,10 @@
end
begin
- ownlocation
+ applocation
rescue NameError
- def ownlocation(file="")
- dir = ENV["OWNDIR"]
+ def applocation(file="")
+ dir = ENV["APPDIR"]
res = nil
if block_given?
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/init.rb
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/init.rb 2005-06-03 13:16:39.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/init.rb 2005-08-04 22:01:28.000000000 +0200
@@ -99,11 +99,11 @@
command = backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}"
system(command)
-end
-unless File.file?(loadscript)
- $stderr.puts "Couldn't execute this command (rc=#{$?}):\n#{command}"
- exit 16
+ unless File.file?(loadscript)
+ $stderr.puts "Couldn't execute this command (rc=#{$?}):\n#{command}"
+ exit 16
+ end
end
load(loadscript)
@@ -166,6 +166,7 @@
eeeexe = "eeew.exe" if rubyw
eeeexe = "eee_linux" if linux?
eeeexe = "eee_darwin" if darwin?
+appeee = "#{app}.eee"
appexe = "#{app}.exe"
appexe = "#{app}_linux" if linux?
appexe = "#{app}_darwin" if darwin?
@@ -220,7 +221,7 @@
File.open(tmplocation("empty.rb"), "w") do |f|
end
-File.open(tmplocation("app.eee"), "w") do |f|
+File.open(tmplocation(appeee), "w") do |f|
f.puts "r bin"
f.puts "r lib"
f.puts "f bootstrap.rb"
@@ -242,7 +243,7 @@
end
from = newlocation(eeeexe)
-from = ownlocation(eeeexe) unless File.file?(from)
+from = applocation(eeeexe) unless File.file?(from)
from = oldlocation(eeeexe) unless File.file?(from)
to = tmplocation(eeeexe)
@@ -252,15 +253,16 @@
tmplocation do
ENV["EEE_EXE"] = eeeexe
ENV["EEE_DIR"] = Dir.pwd
+ ENV["EEE_TEMPDIR"] = RUBYSCRIPT2EXE_TEMPDIR if defined?(RUBYSCRIPT2EXE_TEMPDIR)
eeebin1 = newlocation("eee.exe")
eeebin1 = newlocation("eee_linux") if linux?
eeebin1 = newlocation("eee_darwin") if darwin?
unless File.file?(eeebin1)
- eeebin1 = ownlocation("eee.exe")
- eeebin1 = ownlocation("eee_linux") if linux?
- eeebin1 = ownlocation("eee_darwin") if darwin?
+ eeebin1 = applocation("eee.exe")
+ eeebin1 = applocation("eee_linux") if linux?
+ eeebin1 = applocation("eee_darwin") if darwin?
end
unless File.file?(eeebin1)
@@ -279,7 +281,7 @@
File.copy(from, to) unless from == to
File.chmod(0755, to) if linux? or darwin?
- system(backslashes("#{eeebin2} app.eee #{appexe}"))
+ system(backslashes("#{eeebin2} #{appeee} #{appexe}"))
end
from = tmplocation(appexe)
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/README rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/README
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/README 2005-05-22 18:09:36.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/README 2005-08-06 09:07:00.000000000 +0200
@@ -1,15 +1,22 @@
-The best way to use RubyScript2Exe is the RB, not this TAR.GZ.
-The latter is just for playing with the internals. Both are
-available on the site.
+----------------------------------------------------------------
- Usage: ruby init.rb application[.rb[w]]
- [--rubyscript2exe-ruby|--rubyscript2exe-rubyw]
- [--rubyscript2exe-verbose|--rubyscript2exe-quiet]
- [--rubyscript2exe-nostrip]
- [--rubyscript2exe-tk]
-
-On Linux and Darwin, there's no difference between ruby and
-rubyw.
+RubyScript2Exe transforms your Ruby script into a standalone,
+compressed Windows, Linux or Mac OS X (Darwin) executable. You
+can look at it as a "compiler". Not in the sense of a
+source-code-to-byte-code compiler, but as a "collector", for it
+collects all necessary files to run your script on an other
+machine: the Ruby script, the Ruby interpreter and the Ruby
+runtime library (stripped down for this script). Anyway, the
+result is the same: a standalone executable (application.exe).
+And that's what we want!
For more information, see
http://www.erikveen.dds.nl/rubyscript2exe/index.html .
+
+----------------------------------------------------------------
+
+The best way to use Tar2RubyScript is the RB, not this TAR.GZ.
+The latter is just for playing with the internals. Both are
+available on the site.
+
+----------------------------------------------------------------
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/require2lib.rb
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/require2lib.rb 2005-06-14 21:44:16.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/require2lib.rb 2005-08-06 12:59:36.000000000 +0200
@@ -176,6 +176,7 @@
f.puts "RUBYSCRIPT2EXE_DLLS = #{RUBYSCRIPT2EXE_DLLS.inspect}" if defined?(RUBYSCRIPT2EXE_DLLS)
f.puts "RUBYSCRIPT2EXE_BIN = #{RUBYSCRIPT2EXE_BIN.inspect}" if defined?(RUBYSCRIPT2EXE_BIN)
f.puts "RUBYSCRIPT2EXE_LIB = #{RUBYSCRIPT2EXE_LIB.inspect}" if defined?(RUBYSCRIPT2EXE_LIB)
+ f.puts "RUBYSCRIPT2EXE_TEMPDIR = #{RUBYSCRIPT2EXE_TEMPDIR.inspect}" if defined?(RUBYSCRIPT2EXE_TEMPDIR)
f.puts "RUBYSCRIPT2EXE_RUBYGEMS = #{rubygems.inspect}"
end
end
diff -ur rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/VERSION
--- rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/VERSION 2005-06-14 21:44:16.000000000 +0200
+++ rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/VERSION 2005-08-06 12:59:36.000000000 +0200
@@ -1 +1 @@
-0.3.6
+0.4.0
Binary files rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/eee.exe differ
Binary files rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/eee_linux differ
Binary files rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/eeew.exe differ