diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-none.tar.gz/rubyscript2exe/eee.pas 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/eee.pas 2003-10-19 19:55:59.000000000 +0200 @@ -0,0 +1,216 @@ +uses + + Dos; + +type + + header = record + klasse : string[1]; + tekst : string[255]; + length : longint; + end; + + tail = record + length : longint; + number : longint; + who : string[255]; + end; + +var + + tempdir : string; + workdir : string; + me : string; + infile : file of byte; + outfile : file of byte; + eeefile : Text; + klasse : string[1]; + tekst : string[255]; + s : string[255]; + b : array[0..10000000] of byte; + h : header; + t : tail; + teller : longint; + i : longint; + dir : string; + parms : string; + +begin + + tempdir := 'c:\tmp'; + tempdir := getenv('TEMP'); + + me := 'Dit is mij herkennigsstring'; + + parms := ''; + for teller := 1 to paramcount do begin + if (parms = '') then begin + parms := paramstr(teller); + end + else begin + parms := parms + ' ' + paramstr(teller); + end; + end; + + filemode := 0; + + assign(infile, paramstr(0)); + reset(infile, 1); + blockread(infile, b, filesize(infile)-sizeof(t)); + blockread(infile, t, sizeof(t)); + close(infile); + + if (t.who <> me) then begin + + // Pak in. + + assign(outfile, paramstr(2)); + rewrite(outfile, 1); + + assign(eeefile, paramstr(1)); + reset(eeefile); + + assign(infile, paramstr(0)); + reset(infile, 1); + blockread(infile, b, sizeof(b), t.length); + blockwrite(outfile, b, t.length); + close(infile); + + t.number := 0; + + repeat + readln(eeefile, s); + + if (not (s = '') and not (copy(s, 1, 1) = '#')) then begin + klasse := copy(s, 1, 1); + tekst := copy(s, 3, 255); + + if (klasse = 'f') then begin + h.klasse := klasse; + h.tekst := tekst; + + // writeln(h.klasse, ' ', h.tekst); + + assign(infile, h.tekst); + reset(infile, 1); + + h.length := filesize(infile); + + blockread(infile, b, sizeof(b), h.length); + + blockwrite(outfile, h, sizeof(h)); + blockwrite(outfile, b, h.length); + + close(infile); + end; + + if (klasse = 'c') then begin + h.klasse := klasse; + h.tekst := tekst; + h.length := 0; + + // writeln(h.klasse, ' ', h.tekst); + + blockwrite(outfile, h, sizeof(h)); + end; + + if (klasse = 't') then begin + h.klasse := klasse; + h.tekst := tekst; + h.length := 0; + + // writeln(h.klasse, ' ', h.tekst); + + blockwrite(outfile, h, sizeof(h)); + end; + + t.number := t.number + 1; + end; + until eof(eeefile); + + t.who := me; + + blockwrite(outfile, t, sizeof(t)); + + close(eeefile); + + close(outfile); + + end + + else begin + + // Pak uit. + + randomize; + + getdir(0, dir); + chdir(tempdir); + {$I-} + repeat + str(random(1000), s); + workdir := 'eee.' + s; + mkdir(workdir); + until (ioresult = 0); + {$I+} + + workdir := tempdir + '\' + workdir; + chdir(dir); + + assign(infile, paramstr(0)); + reset(infile, 1); + blockread(infile, b, t.length); + + try + + for teller := 1 to t.number do begin + blockread(infile, h, sizeof(h)); + + s := '%tempdir%'; + i := pos(s, h.tekst); + while (i > 0) do begin + h.tekst := copy(h.tekst, 1, i-1) + workdir + copy(h.tekst, i+length(s), 255); + i := pos(s, h.tekst); + end; + + s := '%parms%'; + i := pos(s, h.tekst); + while (i > 0) do begin + h.tekst := copy(h.tekst, 1, i-1) + parms + copy(h.tekst, i+length(s), 255); + i := pos(s, h.tekst); + end; + + // writeln(h.klasse, ' ', h.tekst); + + if (h.klasse = 'f') then begin + blockread(infile, b, h.length); + + assign(outfile, workdir + '\' + h.tekst); + rewrite(outfile, 1); + blockwrite(outfile, b, h.length); + close(outfile); + end; + + if (h.klasse = 'c') then begin + exec(getenv('COMSPEC'), '/c ' + h.tekst); + end; + + if (h.klasse = 't') then begin + getdir(0, dir); + chdir(workdir); + exec(getenv('COMSPEC'), '/c ' + h.tekst); + chdir(dir); + end; + end; + + finally + + close(infile); + + exec(getenv('COMSPEC'), '/c deltree /y ' + workdir + ' > nul:'); + + end; + + end; + +end. diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-none.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-17 22:08:37.000000000 +0200 @@ -0,0 +1,19 @@ +def oldlocation(file="") + if block_given? + res = yield + else + res = File.expand_path(file, ".") if not file.nil? + end + + res +end + +def newlocation(file="") + if block_given? + res = yield + else + res = File.expand_path(file, ".") if not file.nil? + end + + res +end diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-none.tar.gz/rubyscript2exe/init.rb 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/init.rb 2003-10-17 22:08:37.000000000 +0200 @@ -0,0 +1,77 @@ +require "ev/oldandnewlocation" +require "rbconfig" + +app = ARGV.shift + +Config::CONFIG["bindir"].gsub!(/\//, "\\") +Config::CONFIG["LIBRUBY_SO"].gsub!(/\//, "\\") + +olddir = oldlocation.gsub!(/\//, "\\") +newdir = newlocation.gsub!(/\//, "\\") + +if not app.nil? + app = app.dup.gsub(/\.rb$/, "") + + puts "Gathering files..." + + system("copy #{Config::CONFIG["bindir"]}\\ruby.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\rubyw.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") + + system("copy #{olddir}\\#{app}.rb app.rb > nul:") + + puts "Tracing #{app} ..." + + oldlocation do + tar = FileTest.file?("tar.exe") + system("copy #{newdir}\\tar.exe . > nul:") if not tar + + system("ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") + + system("del tar.exe > nul:") if not tar + end + + system("move #{olddir}\\rubyrequired.tar . > nul:") + + puts "Packing..." + + system("gzip #{Config::CONFIG["LIBRUBY_SO"]}") + system("gzip rubyrequired.tar") + system("gzip app.rb") + + File.open("app.eee", "w") do |f| + f.puts "f gzip.exe" + f.puts "f tar.exe" + f.puts "f ruby.exe" + f.puts "f rubyw.exe" + f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}.gz" + f.puts "f rubyrequired.tar.gz" + f.puts "f app.rb.gz" + + f.puts "t gzip -d #{Config::CONFIG["LIBRUBY_SO"]}.gz" + f.puts "t gzip -d rubyrequired.tar.gz" + f.puts "t gzip -d app.rb.gz" + + f.puts "t tar xf rubyrequired.tar" + + f.puts "c %tempdir%\\ruby -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" + end + + if FileTest.file?("c:\\gnu\\root\\bin\\win32\\fpc.exe") + puts "Creating eee.exe ..." + + system("c:\\gnu\\root\\bin\\win32\\fpc.exe -gl -S2 eee") + system("copy eee.exe s:\\ > nul:") + end + + puts "Creating #{app}.exe ..." + + system("eee.exe app.eee #{olddir}\\#{app}.exe") + + system("del ruby.exe") + system("del rubyw.exe") + system("del #{Config::CONFIG["LIBRUBY_SO"]}.gz") + system("del rubyrequired.tar.gz") + system("del app.rb.gz") + system("del app.eee") +end diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/LICENSE rubyscript2exe-0.1.tar.gz/rubyscript2exe/LICENSE --- rubyscript2exe-none.tar.gz/rubyscript2exe/LICENSE 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/LICENSE 2003-10-17 22:08:10.000000000 +0200 @@ -0,0 +1,15 @@ +# Copyright Erik Veenstra <rubyscript2exe@erikveen.dds.nl> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA. diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/README rubyscript2exe-0.1.tar.gz/rubyscript2exe/README --- rubyscript2exe-none.tar.gz/rubyscript2exe/README 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/README 2003-10-17 22:07:54.000000000 +0200 @@ -0,0 +1,4 @@ +Usage: ruby init.rb application[.rb] + +For more information, see +http://www.erikveen.dds.nl/rubyscript2tar/ . diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-none.tar.gz/rubyscript2exe/require2tar.rb 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/require2tar.rb 2003-10-17 22:08:37.000000000 +0200 @@ -0,0 +1,110 @@ +JustCopy = ARGV.include?("--require2tar-justcopy") +JustEV = ARGV.include?("--require2tar-justev") + +ARGV.delete_if do |arg| + arg =~ /^--require2tar-/ +end + +at_exit do + include Require + + createtar +end + +module Require + + def createtar + temp = ENV["TEMP"] + temp = "/tmp" if temp.nil? + tmpdir = File.expand_path("rubyrequired2tar.#{Process.pid}", temp) + tardir = "rubyrequired" + tarfile = "rubyrequired.tar" + todir = File.expand_path(tardir, tmpdir) + + mkdirs("#{todir}/") + + $".delete_if{|req| not req =~ /^ev\//} if JustEV + + $".each do |req| + found = false + + $:.each do |lib| + if not found + file = File.expand_path(req, lib) + if FileTest.file?(file) + found = true + fromfile = file + tofile = File.expand_path(req, todir) + tofile = req if JustCopy + + #puts "Found #{fromfile} ." + + copy(fromfile, tofile) + end + end + end + + if not found + puts "Can't find #{req} ." + end + end + + if not JustCopy + copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe") + + pdir = Dir.pwd + s = "tar chf #{File.expand_path(tarfile)} #{tardir}" + Dir.chdir(tmpdir) + puts "Creating #{tarfile} ..." + + system(s) + Dir.chdir(pdir) + end + + recursivedelete(tmpdir) + end + + def copy(fromfile, tofile) + mkdirs(tofile) + + if not FileTest.file?(tofile) + File.open(tofile, "wb") do |f| + f.write(File.new(fromfile, "rb").read) + end + end + end + + def mkdirs(file) + dir, file = file.gsub(/[\/\\]/, "/").split(/\//, 2) + + if not file.nil? + dir = "#{dir}/" + + Dir.mkdir(dir) if not FileTest.directory?(dir) + + pdir = Dir.pwd + Dir.chdir(dir) + mkdirs(file) + Dir.chdir(pdir) + end + end + + def recursivedelete(entry) + if FileTest.file?(entry) + File.delete(entry) + end + + if FileTest.directory?(entry) + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + recursivedelete(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.rmdir(entry) + end + end + +end diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.tar.gz/rubyscript2exe/tar2rubyscript.rb --- rubyscript2exe-none.tar.gz/rubyscript2exe/tar2rubyscript.rb 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-17 22:08:37.000000000 +0200 @@ -0,0 +1,81 @@ +scriptfile = ARGV.shift +tarfile = ARGV.shift +rbfile = ARGV.shift +licensefile = ARGV.shift + +tarfile.dup.gsub!(/[\/\\]$/, "") + +if tarfile.nil? + puts "Usage: ruby tar2rubyscript.rb application.tar [application.rb [license.txt]]" + puts " or" + puts " ruby tar2rubyscript.rb application/ [application.rb [license.txt]]" + puts "" + puts "The second option needs the external program 'tar' for creating" + puts "the archive internally." + + exit 1 +end + +if not FileTest.exist?(tarfile) + puts "#{tarfile} doesn't exist." + exit +end + +if not licensefile.nil? and not FileTest.file?(licensefile) + puts "#{licensefile} doesn't exist." + exit +end + + +script = nil +archive = nil + +File.open(scriptfile) {|f| script = f.read} + +if FileTest.file?(tarfile) + File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} +end + +if FileTest.directory?(tarfile) + orgdir = Dir.pwd + + Dir.chdir(tarfile) + + if FileTest.file?("tar2rubyscript.bat") + puts "\".\\tar2rubyscript.bat\"" + system(".\\tar2rubyscript.bat") + end + + if FileTest.file?("tar2rubyscript.sh") + puts "\". ./tar2rubyscript.sh\"" + system("sh -c \". ./tar2rubyscript.sh\"") + end + + Dir.chdir("..") + + IO.popen("tar ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + + Dir.chdir(orgdir) +end + +if not licensefile.nil? + lic = nil ; File.open(licensefile) {|f| lic = f.readlines} + + lic.collect! do |line| + line.gsub!(/[\r\n]/, "") + line = "# #{line}" unless line =~ /^[ \t]*#/ + line + end + + script = "# License, not of this script, but of the application it contains:\n#\n" + lic.join("\n") + "\n\n" + script +end + +rbfile = tarfile.gsub(/\.tar$/, "") + ".rb" if (rbfile.nil? or File.basename(rbfile) == "-") + +File.open(rbfile, "wb") do |f| + f.write script + f.write "\n" + f.write "\n" + f.write archive + f.write "\n" +end diff -ur rubyscript2exe-none.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-none.tar.gz/rubyscript2exe/tarrubyscript.rb 2007-05-30 10:17:16.000000000 +0200 +++ rubyscript2exe-0.1.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-17 22:08:37.000000000 +0200 @@ -0,0 +1,305 @@ +# Tar2RubyScript constants + +JustExtract = ARGV.include?("--tar2rubyscript-justextract") + +ARGV.concat [] + +ARGV.delete_if do |arg| + arg =~ /^--tar2rubyscript-/ +end + +# Tar constants + +BLOCKSIZE = 512 + +NAMELEN = 100 +MODELEN = 8 +UIDLEN = 8 +GIDLEN = 8 +CHKSUMLEN = 8 +SIZELEN = 12 +MAGICLEN = 8 +MODTIMELEN = 12 +UNAMELEN = 32 +GNAMELEN = 32 +DEVLEN = 8 +TMAGIC = 'ustar' +GNU_TMAGIC = 'ustar ' + +LF_OLDFILE = '\0' +LF_FILE = '0' +LF_LINK = '1' +LF_SYMLINK = '2' +LF_CHAR = '3' +LF_BLOCK = '4' +LF_DIR = '5' +LF_FIFO = '6' +LF_CONTIG = '7' + +class Reader + def initialize(filehandle) + @fp = filehandle + end + + def extract + each do |entry| + entry.extract + end + end + + def each + @fp.rewind + + while entry = next_entry + yield(entry) + end + end + + def next_entry + buf = @fp.read(BLOCKSIZE) + + if buf.length < BLOCKSIZE or buf == "\000" * BLOCKSIZE + entry = nil + else + entry = Entry.new(buf, @fp) + end + + entry + end +end + +class Entry + attr_reader(:header, :data) + + def initialize(header, fp) + @header = Header.new(header) + + if @header.file? + padding = (BLOCKSIZE - (@header.size % BLOCKSIZE)) % BLOCKSIZE + + @data = fp.read(@header.size) if @header.size > 0 + dummy = fp.read(padding) if padding > 0 + end + end + + def extract + if not @header.name.empty? + if @header.dir? + begin + Dir.mkdir(@header.name, @header.mode) + rescue SystemCallError => e + puts "Couldn't create dir #{@header.name}: " + e.message + end + else + if @header.file? + begin + File.open(@header.name, "wb") do |fp| + fp.write(@data) + fp.chmod(@header.mode) + end + rescue => e + puts "Couldn't create file #{@header.name}: " + e.message + end + else + puts "Couldn't handle entry #{@header.name}" + end + end + + #File.chown(@header.uid, @header.gid, @header.name) + #File.utime(Time.now, @header.mtime, @header.name) + end + end +end + +class Header + attr_reader(:name, :uid, :gid, :size, :mtime, :uname, :gname, :mode) + + def initialize(header) + fields = header.unpack('A100 A8 A8 A8 A12 A12 A8 A1 A100 A8 A32 A32 A8 A8') + types = ['str', 'oct', 'oct', 'oct', 'oct', 'time', 'oct', 'str', 'str', 'str', 'str', 'str', 'oct', 'oct'] + + begin + converted = [] + while field = fields.shift + type = types.shift + + case type + when 'str' then converted.push(field) + when 'oct' then converted.push(field.oct) + when 'time' then converted.push(Time::at(field.oct)) + end + end + + @name, @mode, @uid, @gid, @size, @mtime, @chksum, @linkflag, @linkname, @magic, @uname, @gname, @devmajor, @devminor = converted + + @name.gsub!(/^\.\//, "") + + @raw = header + rescue ArgumentError => e + raise "Couldn't determine a real value for a field (#{field})" + end + + raise "Magic header value '#{@magic}' is invalid." if @magic != TMAGIC and @magic != GNU_TMAGIC + + @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG + @linkflag = LF_DIR if @name[-1] == '/' and @linkflag == LF_FILE + @linkname = @linkname[1,-1] if @linkname[0] == '/' + @size = 0 if @size < 0 + @name = @linkname + '/' + @name if @linkname.size > 0 + end + + def file? + @linkflag == LF_FILE + end + + def dir? + @linkflag == LF_DIR + end +end + +class TempSpace + def initialize + @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift + @olddir = Dir.pwd + temp = ENV["TEMP"] + temp = "/tmp" if temp.nil? + @tempdir = "#{temp}/tar2rubyscript.d.#{Process.pid}" + @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" + + @newdir=@tempdir + end + + def eval + Dir.mkdir(@tempdir) if not FileTest.exists?(@tempdir) + + newlocation do + + # Create the temp environment. + + File.open(@tempfile, "wb") {|f| f.write @archive} + File.open(@tempfile, "rb") {|f| Reader.new(f).extract} + + # Eventually look for a subdirectory. + + entries = Dir.entries(".") + entries.delete(".") + entries.delete("..") + + if entries.length == 1 + entry = entries.shift.dup + if FileTest.directory?(entry) + @newdir = "#{@tempdir}/#{entry}" + end + end + end + + # Remember all File objects. + + @ioobjects = [] + ObjectSpace::each_object(File) do |obj| + @ioobjects << obj + end + + at_exit do + + # Close all File objects, opened in init.rb . + + ObjectSpace::each_object(File) do |obj| + obj.close if (not obj.closed? and not @ioobjects.include?(obj)) + end + + # Remove the temp environment. + + Dir.chdir(@olddir) + + recursivedelete(@tempfile) + recursivedelete(@tempdir) + end + + # Execute init.rb . + + newlocation do + File.open("init.rb") do |f| + instance_eval(f.read) + end + end + end + + def recursivedelete(entry) + if FileTest.file?(entry) + File.delete(entry) + end + + if FileTest.directory?(entry) + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + recursivedelete(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.rmdir(entry) + end + end + + def oldlocation(file="") + if block_given? + pdir = Dir.pwd + + Dir.chdir(@olddir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, @olddir) if not file.nil? + end + + res + end + + def newlocation(file="") + if block_given? + pdir = Dir.pwd + + Dir.chdir(@newdir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, @newdir) if not file.nil? + end + + res + end +end + +class Extract + def initialize + @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift + temp = ENV["TEMP"] + temp = "/tmp" if temp.nil? + @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" + end + + def extract + begin + + # Create the temp environment. + + File.open(@tempfile, "wb") {|f| f.write @archive} + File.open(@tempfile, "rb") {|f| Reader.new(f).extract} + + ensure + + # Remove the temp environment. + + File.delete(@tempfile) + + end + end +end + +if JustExtract + Extract.new.extract +else + TempSpace.new.eval +end Binary files rubyscript2exe-none.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-none.tar.gz/rubyscript2exe/gzip.exe and rubyscript2exe-0.1.tar.gz/rubyscript2exe/gzip.exe differ Binary files rubyscript2exe-none.tar.gz/rubyscript2exe/tar.exe and rubyscript2exe-0.1.tar.gz/rubyscript2exe/tar.exe differ diff -ur rubyscript2exe-0.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.tar.gz/rubyscript2exe/init.rb 2003-10-17 22:08:37.000000000 +0200 +++ rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/init.rb 2003-10-17 22:58:20.000000000 +0200 @@ -68,10 +68,10 @@ system("eee.exe app.eee #{olddir}\\#{app}.exe") - system("del ruby.exe") - system("del rubyw.exe") - system("del #{Config::CONFIG["LIBRUBY_SO"]}.gz") - system("del rubyrequired.tar.gz") - system("del app.rb.gz") - system("del app.eee") + system("del ruby.exe > nul:") + system("del rubyw.exe > nul:") + system("del #{Config::CONFIG["LIBRUBY_SO"]}.gz > nul:") + system("del rubyrequired.tar.gz > nul:") + system("del app.rb.gz > nul:") + system("del app.eee > nul:") end diff -ur rubyscript2exe-0.1.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/tar2rubyscript.rb --- rubyscript2exe-0.1.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-17 22:08:37.000000000 +0200 +++ rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-17 22:58:20.000000000 +0200 @@ -26,7 +26,6 @@ exit end - script = nil archive = nil @@ -53,7 +52,13 @@ Dir.chdir("..") - IO.popen("tar ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + begin + tar = "tar" + IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + rescue + tar = newlocation("tar.exe") + IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + end Dir.chdir(orgdir) end diff -ur rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/eee.pas 2003-10-19 19:55:57.000000000 +0200 +++ rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas 2003-10-19 19:55:58.000000000 +0200 @@ -35,34 +35,44 @@ dir : string; parms : string; -begin - tempdir := 'c:\tmp'; - tempdir := getenv('TEMP'); +procedure recursivedelete(var path: string); - me := 'Dit is mij herkennigsstring'; +var + f : file; + sr : searchrec; + dir : string; - parms := ''; - for teller := 1 to paramcount do begin - if (parms = '') then begin - parms := paramstr(teller); +begin + + getdir(0, dir); + chdir(path); + + findfirst('*.*', directory, sr); + while(doserror = 0) do begin + if (sr.attr and directory > 0) then begin + if ((not (sr.name = '.')) and (not (sr.name = '..'))) then begin + recursivedelete(sr.name); + end; end else begin - parms := parms + ' ' + paramstr(teller); + assign(f, sr.name); + erase(f); end; + + findnext(sr); end; - filemode := 0; + chdir(dir); - assign(infile, paramstr(0)); - reset(infile, 1); - blockread(infile, b, filesize(infile)-sizeof(t)); - blockread(infile, t, sizeof(t)); - close(infile); + rmdir(path); + +end; - if (t.who <> me) then begin - // Pak in. +procedure pakin; + +begin assign(outfile, paramstr(2)); rewrite(outfile, 1); @@ -136,11 +146,12 @@ close(outfile); - end +end; - else begin - // Pak uit. +procedure pakuit; + +begin randomize; @@ -207,10 +218,43 @@ close(infile); - exec(getenv('COMSPEC'), '/c deltree /y ' + workdir + ' > nul:'); + recursivedelete(workdir); end; +end; + + +begin + + tempdir := 'c:\tmp'; + tempdir := getenv('TEMP'); + + me := 'Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; + + parms := ''; + for teller := 1 to paramcount do begin + if (parms = '') then begin + parms := paramstr(teller); + end + else begin + parms := parms + ' ' + paramstr(teller); + end; + end; + + filemode := 0; + + assign(infile, paramstr(0)); + reset(infile, 1); + blockread(infile, b, filesize(infile)-sizeof(t)); + blockread(infile, t, sizeof(t)); + close(infile); + + if (t.who <> me) then begin + pakin; + end + else begin + pakuit end; end. diff -ur rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/init.rb 2003-10-17 22:58:20.000000000 +0200 +++ rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb 2003-10-19 01:32:37.000000000 +0200 @@ -12,15 +12,7 @@ if not app.nil? app = app.dup.gsub(/\.rb$/, "") - puts "Gathering files..." - - system("copy #{Config::CONFIG["bindir"]}\\ruby.exe . > nul:") - system("copy #{Config::CONFIG["bindir"]}\\rubyw.exe . > nul:") - system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") - - system("copy #{olddir}\\#{app}.rb app.rb > nul:") - - puts "Tracing #{app} ..." + puts "Tracing #{app}..." oldlocation do tar = FileTest.file?("tar.exe") @@ -31,7 +23,13 @@ system("del tar.exe > nul:") if not tar end + puts "Gathering files..." + + system("copy #{Config::CONFIG["bindir"]}\\ruby.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\rubyw.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") system("move #{olddir}\\rubyrequired.tar . > nul:") + system("copy #{olddir}\\#{app}.rb app.rb > nul:") puts "Packing..." @@ -58,13 +56,13 @@ end if FileTest.file?("c:\\gnu\\root\\bin\\win32\\fpc.exe") - puts "Creating eee.exe ..." + puts "Creating eee.exe..." system("c:\\gnu\\root\\bin\\win32\\fpc.exe -gl -S2 eee") system("copy eee.exe s:\\ > nul:") end - puts "Creating #{app}.exe ..." + puts "Creating #{app}.exe..." system("eee.exe app.eee #{olddir}\\#{app}.exe") diff -ur rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/require2tar.rb 2003-10-17 22:58:20.000000000 +0200 +++ rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/require2tar.rb 2003-10-19 01:32:37.000000000 +0200 @@ -55,7 +55,7 @@ pdir = Dir.pwd s = "tar chf #{File.expand_path(tarfile)} #{tardir}" Dir.chdir(tmpdir) - puts "Creating #{tarfile} ..." + puts "Creating #{tarfile}..." system(s) Dir.chdir(pdir) Binary files rubyscript2exe-0.1.1.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.exe differ diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.pas 2003-10-19 19:55:58.000000000 +0200 +++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas 2003-10-20 00:18:17.000000000 +0200 @@ -18,9 +18,9 @@ var - tempdir : string; - workdir : string; - me : string; + tempdir : string[255]; + workdir : string[255]; + me : string[255]; infile : file of byte; outfile : file of byte; eeefile : Text; @@ -32,16 +32,16 @@ t : tail; teller : longint; i : longint; - dir : string; - parms : string; + dir : string[255]; + parms : string[255]; -procedure recursivedelete(var path: string); +procedure recursivedelete(var path: string[255]); var f : file; sr : searchrec; - dir : string; + dir : string[255]; begin diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-19 01:32:37.000000000 +0200 +++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-20 00:34:38.000000000 +0200 @@ -1,18 +1,38 @@ def oldlocation(file="") + if ENV.include?("OLDDIR") + dir = ENV["OLDDIR"] + else + dir = "." + end + if block_given? - res = yield + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) else - res = File.expand_path(file, ".") if not file.nil? + res = File.expand_path(file, dir) if not file.nil? end res end def newlocation(file="") + if ENV.include?("NEWDIR") + dir = ENV["NEWDIR"] + else + dir = "." + end + if block_given? - res = yield + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) else - res = File.expand_path(file, ".") if not file.nil? + res = File.expand_path(file, dir) if not file.nil? end res diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/init.rb 2003-10-19 01:32:37.000000000 +0200 +++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb 2003-10-20 00:27:49.000000000 +0200 @@ -55,13 +55,6 @@ f.puts "c %tempdir%\\ruby -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" end - if FileTest.file?("c:\\gnu\\root\\bin\\win32\\fpc.exe") - puts "Creating eee.exe..." - - system("c:\\gnu\\root\\bin\\win32\\fpc.exe -gl -S2 eee") - system("copy eee.exe s:\\ > nul:") - end - puts "Creating #{app}.exe..." system("eee.exe app.eee #{olddir}\\#{app}.exe") diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tar2rubyscript.rb --- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-19 01:32:37.000000000 +0200 +++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tar2rubyscript.rb 2007-05-30 10:17:20.000000000 +0200 @@ -1,86 +0,0 @@ -scriptfile = ARGV.shift -tarfile = ARGV.shift -rbfile = ARGV.shift -licensefile = ARGV.shift - -tarfile.dup.gsub!(/[\/\\]$/, "") - -if tarfile.nil? - puts "Usage: ruby tar2rubyscript.rb application.tar [application.rb [license.txt]]" - puts " or" - puts " ruby tar2rubyscript.rb application/ [application.rb [license.txt]]" - puts "" - puts "The second option needs the external program 'tar' for creating" - puts "the archive internally." - - exit 1 -end - -if not FileTest.exist?(tarfile) - puts "#{tarfile} doesn't exist." - exit -end - -if not licensefile.nil? and not FileTest.file?(licensefile) - puts "#{licensefile} doesn't exist." - exit -end - -script = nil -archive = nil - -File.open(scriptfile) {|f| script = f.read} - -if FileTest.file?(tarfile) - File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} -end - -if FileTest.directory?(tarfile) - orgdir = Dir.pwd - - Dir.chdir(tarfile) - - if FileTest.file?("tar2rubyscript.bat") - puts "\".\\tar2rubyscript.bat\"" - system(".\\tar2rubyscript.bat") - end - - if FileTest.file?("tar2rubyscript.sh") - puts "\". ./tar2rubyscript.sh\"" - system("sh -c \". ./tar2rubyscript.sh\"") - end - - Dir.chdir("..") - - begin - tar = "tar" - IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} - rescue - tar = newlocation("tar.exe") - IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} - end - - Dir.chdir(orgdir) -end - -if not licensefile.nil? - lic = nil ; File.open(licensefile) {|f| lic = f.readlines} - - lic.collect! do |line| - line.gsub!(/[\r\n]/, "") - line = "# #{line}" unless line =~ /^[ \t]*#/ - line - end - - script = "# License, not of this script, but of the application it contains:\n#\n" + lic.join("\n") + "\n\n" + script -end - -rbfile = tarfile.gsub(/\.tar$/, "") + ".rb" if (rbfile.nil? or File.basename(rbfile) == "-") - -File.open(rbfile, "wb") do |f| - f.write script - f.write "\n" - f.write "\n" - f.write archive - f.write "\n" -end diff -ur rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-19 01:32:37.000000000 +0200 +++ rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/tarrubyscript.rb 2007-05-30 10:17:20.000000000 +0200 @@ -1,305 +0,0 @@ -# Tar2RubyScript constants - -JustExtract = ARGV.include?("--tar2rubyscript-justextract") - -ARGV.concat [] - -ARGV.delete_if do |arg| - arg =~ /^--tar2rubyscript-/ -end - -# Tar constants - -BLOCKSIZE = 512 - -NAMELEN = 100 -MODELEN = 8 -UIDLEN = 8 -GIDLEN = 8 -CHKSUMLEN = 8 -SIZELEN = 12 -MAGICLEN = 8 -MODTIMELEN = 12 -UNAMELEN = 32 -GNAMELEN = 32 -DEVLEN = 8 -TMAGIC = 'ustar' -GNU_TMAGIC = 'ustar ' - -LF_OLDFILE = '\0' -LF_FILE = '0' -LF_LINK = '1' -LF_SYMLINK = '2' -LF_CHAR = '3' -LF_BLOCK = '4' -LF_DIR = '5' -LF_FIFO = '6' -LF_CONTIG = '7' - -class Reader - def initialize(filehandle) - @fp = filehandle - end - - def extract - each do |entry| - entry.extract - end - end - - def each - @fp.rewind - - while entry = next_entry - yield(entry) - end - end - - def next_entry - buf = @fp.read(BLOCKSIZE) - - if buf.length < BLOCKSIZE or buf == "\000" * BLOCKSIZE - entry = nil - else - entry = Entry.new(buf, @fp) - end - - entry - end -end - -class Entry - attr_reader(:header, :data) - - def initialize(header, fp) - @header = Header.new(header) - - if @header.file? - padding = (BLOCKSIZE - (@header.size % BLOCKSIZE)) % BLOCKSIZE - - @data = fp.read(@header.size) if @header.size > 0 - dummy = fp.read(padding) if padding > 0 - end - end - - def extract - if not @header.name.empty? - if @header.dir? - begin - Dir.mkdir(@header.name, @header.mode) - rescue SystemCallError => e - puts "Couldn't create dir #{@header.name}: " + e.message - end - else - if @header.file? - begin - File.open(@header.name, "wb") do |fp| - fp.write(@data) - fp.chmod(@header.mode) - end - rescue => e - puts "Couldn't create file #{@header.name}: " + e.message - end - else - puts "Couldn't handle entry #{@header.name}" - end - end - - #File.chown(@header.uid, @header.gid, @header.name) - #File.utime(Time.now, @header.mtime, @header.name) - end - end -end - -class Header - attr_reader(:name, :uid, :gid, :size, :mtime, :uname, :gname, :mode) - - def initialize(header) - fields = header.unpack('A100 A8 A8 A8 A12 A12 A8 A1 A100 A8 A32 A32 A8 A8') - types = ['str', 'oct', 'oct', 'oct', 'oct', 'time', 'oct', 'str', 'str', 'str', 'str', 'str', 'oct', 'oct'] - - begin - converted = [] - while field = fields.shift - type = types.shift - - case type - when 'str' then converted.push(field) - when 'oct' then converted.push(field.oct) - when 'time' then converted.push(Time::at(field.oct)) - end - end - - @name, @mode, @uid, @gid, @size, @mtime, @chksum, @linkflag, @linkname, @magic, @uname, @gname, @devmajor, @devminor = converted - - @name.gsub!(/^\.\//, "") - - @raw = header - rescue ArgumentError => e - raise "Couldn't determine a real value for a field (#{field})" - end - - raise "Magic header value '#{@magic}' is invalid." if @magic != TMAGIC and @magic != GNU_TMAGIC - - @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG - @linkflag = LF_DIR if @name[-1] == '/' and @linkflag == LF_FILE - @linkname = @linkname[1,-1] if @linkname[0] == '/' - @size = 0 if @size < 0 - @name = @linkname + '/' + @name if @linkname.size > 0 - end - - def file? - @linkflag == LF_FILE - end - - def dir? - @linkflag == LF_DIR - end -end - -class TempSpace - def initialize - @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - @olddir = Dir.pwd - temp = ENV["TEMP"] - temp = "/tmp" if temp.nil? - @tempdir = "#{temp}/tar2rubyscript.d.#{Process.pid}" - @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" - - @newdir=@tempdir - end - - def eval - Dir.mkdir(@tempdir) if not FileTest.exists?(@tempdir) - - newlocation do - - # Create the temp environment. - - File.open(@tempfile, "wb") {|f| f.write @archive} - File.open(@tempfile, "rb") {|f| Reader.new(f).extract} - - # Eventually look for a subdirectory. - - entries = Dir.entries(".") - entries.delete(".") - entries.delete("..") - - if entries.length == 1 - entry = entries.shift.dup - if FileTest.directory?(entry) - @newdir = "#{@tempdir}/#{entry}" - end - end - end - - # Remember all File objects. - - @ioobjects = [] - ObjectSpace::each_object(File) do |obj| - @ioobjects << obj - end - - at_exit do - - # Close all File objects, opened in init.rb . - - ObjectSpace::each_object(File) do |obj| - obj.close if (not obj.closed? and not @ioobjects.include?(obj)) - end - - # Remove the temp environment. - - Dir.chdir(@olddir) - - recursivedelete(@tempfile) - recursivedelete(@tempdir) - end - - # Execute init.rb . - - newlocation do - File.open("init.rb") do |f| - instance_eval(f.read) - end - end - end - - def recursivedelete(entry) - if FileTest.file?(entry) - File.delete(entry) - end - - if FileTest.directory?(entry) - pdir = Dir.pwd - - Dir.chdir(entry) - Dir.new(".").each do |e| - recursivedelete(e) if not [".", ".."].include?(e) - end - Dir.chdir(pdir) - - Dir.rmdir(entry) - end - end - - def oldlocation(file="") - if block_given? - pdir = Dir.pwd - - Dir.chdir(@olddir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, @olddir) if not file.nil? - end - - res - end - - def newlocation(file="") - if block_given? - pdir = Dir.pwd - - Dir.chdir(@newdir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, @newdir) if not file.nil? - end - - res - end -end - -class Extract - def initialize - @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - temp = ENV["TEMP"] - temp = "/tmp" if temp.nil? - @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" - end - - def extract - begin - - # Create the temp environment. - - File.open(@tempfile, "wb") {|f| f.write @archive} - File.open(@tempfile, "rb") {|f| Reader.new(f).extract} - - ensure - - # Remove the temp environment. - - File.delete(@tempfile) - - end - end -end - -if JustExtract - Extract.new.extract -else - TempSpace.new.eval -end Binary files rubyscript2exe-0.1.2.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.exe differ diff -ur rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.pas 2003-10-20 00:18:17.000000000 +0200 +++ rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.pas 2003-10-20 21:15:29.000000000 +0200 @@ -56,16 +56,29 @@ end; end else begin + + {$I-} assign(f, sr.name); erase(f); + if (ioresult <> 0) then begin + writeln('Couldn''t delete file ' + sr.name); + end; + {$I+} + end; findnext(sr); end; + findclose(sr); chdir(dir); - rmdir(path); + {$I-} + rmdir(path + '\'); + if (ioresult <> 0) then begin + writeln('Couldn''t delete directory ' + path + ' (Known Error).'); + end; + {$I+} end; @@ -95,12 +108,12 @@ klasse := copy(s, 1, 1); tekst := copy(s, 3, 255); + // writeln(h.klasse, ' ', h.tekst); + if (klasse = 'f') then begin h.klasse := klasse; h.tekst := tekst; - // writeln(h.klasse, ' ', h.tekst); - assign(infile, h.tekst); reset(infile, 1); @@ -119,8 +132,6 @@ h.tekst := tekst; h.length := 0; - // writeln(h.klasse, ' ', h.tekst); - blockwrite(outfile, h, sizeof(h)); end; @@ -129,8 +140,6 @@ h.tekst := tekst; h.length := 0; - // writeln(h.klasse, ' ', h.tekst); - blockwrite(outfile, h, sizeof(h)); end; diff -ur rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/init.rb 2003-10-20 00:27:49.000000000 +0200 +++ rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/init.rb 2003-10-20 21:17:22.000000000 +0200 @@ -18,7 +18,7 @@ tar = FileTest.file?("tar.exe") system("copy #{newdir}\\tar.exe . > nul:") if not tar - system("ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") + system("ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") # eval ??? system("del tar.exe > nul:") if not tar end @@ -66,3 +66,7 @@ system("del app.rb.gz > nul:") system("del app.eee > nul:") end + +# def copy ??? +# def move ??? +# def del ??? Binary files rubyscript2exe-0.1.3.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.exe differ diff -ur rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.pas 2003-10-20 21:15:29.000000000 +0200 +++ rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.pas 2003-10-26 18:51:45.000000000 +0100 @@ -1,3 +1,5 @@ +{$mode DELPHI} + uses Dos; @@ -27,6 +29,8 @@ klasse : string[1]; tekst : string[255]; s : string[255]; + c : string[255]; + p : string[255]; b : array[0..10000000] of byte; h : header; t : tail; @@ -212,13 +216,19 @@ end; if (h.klasse = 'c') then begin - exec(getenv('COMSPEC'), '/c ' + h.tekst); + i := pos(' ', h.tekst); + c := copy(h.tekst, 1, i-1); + p := copy(h.tekst, i+1, 255); + exec(c, p); end; if (h.klasse = 't') then begin getdir(0, dir); chdir(workdir); - exec(getenv('COMSPEC'), '/c ' + h.tekst); + i := pos(' ', h.tekst); + c := copy(h.tekst, 1, i-1); + p := copy(h.tekst, i+1, 255); + exec(c, p); chdir(dir); end; end; diff -ur rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-20 21:44:17.000000000 +0200 +++ rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2003-10-29 17:05:57.000000000 +0100 @@ -1,39 +1,42 @@ -def oldlocation(file="") - if ENV.include?("OLDDIR") +ENV["OLDDIR"] = Dir.pwd if not ENV.include?("OLDDIR") +ENV["NEWDIR"] = Dir.pwd if not ENV.include?("NEWDIR") + +begin + oldlocation +rescue NameError + def oldlocation(file="") dir = ENV["OLDDIR"] - else - dir = "." - end - if block_given? - pdir = Dir.pwd + if block_given? + pdir = Dir.pwd - Dir.chdir(dir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, dir) if not file.nil? - end + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) if not file.nil? + end - res + res + end end -def newlocation(file="") - if ENV.include?("NEWDIR") +begin + newlocation +rescue NameError + def newlocation(file="") dir = ENV["NEWDIR"] - else - dir = "." - end - if block_given? - pdir = Dir.pwd + if block_given? + pdir = Dir.pwd - Dir.chdir(dir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, dir) if not file.nil? - end + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) if not file.nil? + end - res + res + end end diff -ur rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/init.rb 2003-10-20 21:17:22.000000000 +0200 +++ rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/init.rb 2003-10-27 23:57:39.000000000 +0100 @@ -3,12 +3,21 @@ app = ARGV.shift +RubyW = ARGV.include?("--rubyscript2exe-rubyw") + +ARGV.delete_if do |arg| + arg =~ /^--rubyscript2exe-/ +end + Config::CONFIG["bindir"].gsub!(/\//, "\\") Config::CONFIG["LIBRUBY_SO"].gsub!(/\//, "\\") olddir = oldlocation.gsub!(/\//, "\\") newdir = newlocation.gsub!(/\//, "\\") +ruby = "ruby" +ruby = "rubyw" if RubyW + if not app.nil? app = app.dup.gsub(/\.rb$/, "") @@ -18,53 +27,40 @@ tar = FileTest.file?("tar.exe") system("copy #{newdir}\\tar.exe . > nul:") if not tar - system("ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") # eval ??? + system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") # eval ??? system("del tar.exe > nul:") if not tar end puts "Gathering files..." - system("copy #{Config::CONFIG["bindir"]}\\ruby.exe . > nul:") - system("copy #{Config::CONFIG["bindir"]}\\rubyw.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\#{ruby}.exe . > nul:") system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") system("move #{olddir}\\rubyrequired.tar . > nul:") system("copy #{olddir}\\#{app}.rb app.rb > nul:") puts "Packing..." - system("gzip #{Config::CONFIG["LIBRUBY_SO"]}") - system("gzip rubyrequired.tar") - system("gzip app.rb") + system("#{Config::CONFIG["bindir"]}\\ruby tar2rubyscript.rb rubyrequired.tar") File.open("app.eee", "w") do |f| - f.puts "f gzip.exe" - f.puts "f tar.exe" - f.puts "f ruby.exe" - f.puts "f rubyw.exe" - f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}.gz" - f.puts "f rubyrequired.tar.gz" - f.puts "f app.rb.gz" - - f.puts "t gzip -d #{Config::CONFIG["LIBRUBY_SO"]}.gz" - f.puts "t gzip -d rubyrequired.tar.gz" - f.puts "t gzip -d app.rb.gz" + f.puts "f #{ruby}.exe" + f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}" + f.puts "f rubyrequired.rb" + f.puts "f app.rb" - f.puts "t tar xf rubyrequired.tar" + f.puts "t #{ruby} rubyrequired.rb --tar2rubyscript-justextract" - f.puts "c %tempdir%\\ruby -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" + f.puts "c %tempdir%\\#{ruby} -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" end puts "Creating #{app}.exe..." - system("eee.exe app.eee #{olddir}\\#{app}.exe") - - system("del ruby.exe > nul:") - system("del rubyw.exe > nul:") - system("del #{Config::CONFIG["LIBRUBY_SO"]}.gz > nul:") - system("del rubyrequired.tar.gz > nul:") - system("del app.rb.gz > nul:") - system("del app.eee > nul:") + if RubyW + system("eeew.exe app.eee #{olddir}\\#{app}.exe") + else + system("eee.exe app.eee #{olddir}\\#{app}.exe") + end end # def copy ??? diff -ur rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/tar2rubyscript.rb --- rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/tar2rubyscript.rb 2007-05-30 10:17:23.000000000 +0200 +++ rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/tar2rubyscript.rb 2003-10-29 17:05:57.000000000 +0100 @@ -0,0 +1,81 @@ +require "ev/oldandnewlocation" + +scriptfile = "tarrubyscript.rb" +tarfile = oldlocation(ARGV.shift) +rbfile = oldlocation(ARGV.shift) +licensefile = oldlocation(ARGV.shift) + +if tarfile.nil? + exit 1 +end + +tarfile.dup.gsub!(/[\/\\]$/, "") + +if not FileTest.exist?(tarfile) + $stderr.puts "#{tarfile} doesn't exist." + exit +end + +if not licensefile.nil? and not FileTest.file?(licensefile) + $stderr.puts "#{licensefile} doesn't exist." + exit +end + +script = nil +archive = nil + +File.open(scriptfile) {|f| script = f.read} + +if FileTest.file?(tarfile) + File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} +end + +if FileTest.directory?(tarfile) + orgdir = Dir.pwd + + Dir.chdir(tarfile) + + if FileTest.file?("tar2rubyscript.bat") + $stderr.puts "\".\\tar2rubyscript.bat\"" + system(".\\tar2rubyscript.bat") + end + + if FileTest.file?("tar2rubyscript.sh") + $stderr.puts "\". ./tar2rubyscript.sh\"" + system("sh -c \". ./tar2rubyscript.sh\"") + end + + Dir.chdir("..") + + begin + tar = "tar" + IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + rescue + tar = newlocation("tar.exe") + IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} + end + + Dir.chdir(orgdir) +end + +if not licensefile.nil? + lic = nil ; File.open(licensefile) {|f| lic = f.readlines} + + lic.collect! do |line| + line.gsub!(/[\r\n]/, "") + line = "# #{line}" unless line =~ /^[ \t]*#/ + line + end + + script = "# License, not of this script, but of the application it contains:\n#\n" + lic.join("\n") + "\n\n" + script +end + +rbfile = tarfile.gsub(/\.tar$/, "") + ".rb" if (rbfile.nil? or File.basename(rbfile) == "-") + +File.open(rbfile, "wb") do |f| + f.write script + f.write "\n" + f.write "\n" + f.write archive + f.write "\n" +end diff -ur rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/tarrubyscript.rb 2007-05-30 10:17:23.000000000 +0200 +++ rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-29 17:05:57.000000000 +0100 @@ -0,0 +1,365 @@ +# License of this script, not of the application it contains: +# +# Copyright Erik Veenstra <tar2rubyscript@erikveen.dds.nl> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA. + +# Tar2RubyScript constants + +JustExtract = ARGV.include?("--tar2rubyscript-justextract") +ToTar = ARGV.include?("--tar2rubyscript-totar") + +ARGV.concat [] + +ARGV.delete_if do |arg| + arg =~ /^--tar2rubyscript-/ +end + +# Tar constants + +BLOCKSIZE = 512 + +NAMELEN = 100 +MODELEN = 8 +UIDLEN = 8 +GIDLEN = 8 +CHKSUMLEN = 8 +SIZELEN = 12 +MAGICLEN = 8 +MODTIMELEN = 12 +UNAMELEN = 32 +GNAMELEN = 32 +DEVLEN = 8 + +TMAGIC = 'ustar' +GNU_TMAGIC = 'ustar ' +SOLARIS_TMAGIC = 'ustar00' + +MAGICS = [TMAGIC, GNU_TMAGIC, SOLARIS_TMAGIC] + +LF_OLDFILE = '\0' +LF_FILE = '0' +LF_LINK = '1' +LF_SYMLINK = '2' +LF_CHAR = '3' +LF_BLOCK = '4' +LF_DIR = '5' +LF_FIFO = '6' +LF_CONTIG = '7' + +class Reader + def initialize(filehandle) + @fp = filehandle + end + + def extract + each do |entry| + entry.extract + end + end + + def each + @fp.rewind + + while entry = next_entry + yield(entry) + end + end + + def next_entry + buf = @fp.read(BLOCKSIZE) + + if buf.length < BLOCKSIZE or buf == "\000" * BLOCKSIZE + entry = nil + else + entry = Entry.new(buf, @fp) + end + + entry + end +end + +class Entry + attr_reader(:header, :data) + + def initialize(header, fp) + @header = Header.new(header) + + if @header.file? + padding = (BLOCKSIZE - (@header.size % BLOCKSIZE)) % BLOCKSIZE + + @data = fp.read(@header.size) if @header.size > 0 + dummy = fp.read(padding) if padding > 0 + end + end + + def extract + if not @header.name.empty? + if @header.dir? + begin + Dir.mkdir(@header.name, @header.mode) + rescue SystemCallError => e + puts "Couldn't create dir #{@header.name}: " + e.message + end + else + if @header.file? + begin + File.open(@header.name, "wb") do |fp| + fp.write(@data) + fp.chmod(@header.mode) + end + rescue => e + puts "Couldn't create file #{@header.name}: " + e.message + end + else + puts "Couldn't handle entry #{@header.name}" + end + end + + #File.chown(@header.uid, @header.gid, @header.name) + #File.utime(Time.now, @header.mtime, @header.name) + end + end +end + +class Header + attr_reader(:name, :uid, :gid, :size, :mtime, :uname, :gname, :mode) + + def initialize(header) + fields = header.unpack('A100 A8 A8 A8 A12 A12 A8 A1 A100 A8 A32 A32 A8 A8') + types = ['str', 'oct', 'oct', 'oct', 'oct', 'time', 'oct', 'str', 'str', 'str', 'str', 'str', 'oct', 'oct'] + + begin + converted = [] + while field = fields.shift + type = types.shift + + case type + when 'str' then converted.push(field) + when 'oct' then converted.push(field.oct) + when 'time' then converted.push(Time::at(field.oct)) + end + end + + @name, @mode, @uid, @gid, @size, @mtime, @chksum, @linkflag, @linkname, @magic, @uname, @gname, @devmajor, @devminor = converted + + @name.gsub!(/^\.\//, "") + + @raw = header + rescue ArgumentError => e + raise "Couldn't determine a real value for a field (#{field})" + end + + raise "Magic header value '#{@magic}' is invalid." if not MAGICS.include?(@magic) + + @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG + @linkflag = LF_DIR if @name[-1] == '/' and @linkflag == LF_FILE + @linkname = @linkname[1,-1] if @linkname[0] == '/' + @size = 0 if @size < 0 + @name = @linkname + '/' + @name if @linkname.size > 0 + end + + def file? + @linkflag == LF_FILE + end + + def dir? + @linkflag == LF_DIR + end +end + +class TempSpace + def initialize + @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift + @olddir = Dir.pwd + temp = ENV["TEMP"] + temp = "/tmp" if temp.nil? + @tempdir = "#{temp}/tar2rubyscript.d.#{Process.pid}" + @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" + + @@tempspace = self + + @newdir=@tempdir + end + + def extract + Dir.mkdir(@tempdir) if not FileTest.exists?(@tempdir) + + newlocation do + + # Create the temp environment. + + File.open(@tempfile, "wb") {|f| f.write @archive} + File.open(@tempfile, "rb") {|f| Reader.new(f).extract} + + # Eventually look for a subdirectory. + + entries = Dir.entries(".") + entries.delete(".") + entries.delete("..") + + if entries.length == 1 + entry = entries.shift.dup + if FileTest.directory?(entry) + @newdir = "#{@tempdir}/#{entry}" + end + end + end + + # Remember all File objects. + + @ioobjects = [] + ObjectSpace::each_object(File) do |obj| + @ioobjects << obj + end + + at_exit do + + # Close all File objects, opened in init.rb . + + ObjectSpace::each_object(File) do |obj| + obj.close if (not obj.closed? and not @ioobjects.include?(obj)) + end + + # Remove the temp environment. + + Dir.chdir(@olddir) + + recursivedelete(@tempfile) + recursivedelete(@tempdir) + end + end + + def recursivedelete(entry) + if FileTest.file?(entry) + File.delete(entry) + end + + if FileTest.directory?(entry) + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + recursivedelete(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.rmdir(entry) + end + end + + def oldlocation(file="") + if block_given? + pdir = Dir.pwd + + Dir.chdir(@olddir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, @olddir) if not file.nil? + end + + res + end + + def newlocation(file="") + if block_given? + pdir = Dir.pwd + + Dir.chdir(@newdir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, @newdir) if not file.nil? + end + + res + end + + def self.oldlocation(file="") + if block_given? + @@tempspace.oldlocation { yield } + else + @@tempspace.oldlocation(file) + end + end + + def self.newlocation(file="") + if block_given? + @@tempspace.newlocation { yield } + else + @@tempspace.newlocation(file) + end + end +end + +class Extract + def initialize + @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift + temp = ENV["TEMP"] + temp = "/tmp" if temp.nil? + @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" + end + + def extract + begin + File.open(@tempfile, "wb") {|f| f.write @archive} + File.open(@tempfile, "rb") {|f| Reader.new(f).extract} + ensure + File.delete(@tempfile) + end + end +end + +class MakeTar + def initialize + @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift + @tarfile = $0.gsub(/\.rb$/, ".tar") + end + + def extract + File.open(@tarfile, "wb") {|f| f.write @archive} + end +end + +def oldlocation(file="") + if block_given? + TempSpace.oldlocation { yield } + else + TempSpace.oldlocation(file) + end +end + +def newlocation(file="") + if block_given? + TempSpace.newlocation { yield } + else + TempSpace.newlocation(file) + end +end + +if JustExtract + Extract.new.extract +else + if ToTar + MakeTar.new.extract + else + TempSpace.new.extract + + newlocation do + load "init.rb" + end + end +end Binary files rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eeew.exe differ Binary files rubyscript2exe-0.1.4.tar.gz/rubyscript2exe/gzip.exe and rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/gzip.exe differ diff -ur rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.pas 2003-10-26 18:51:45.000000000 +0100 +++ rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.pas 2003-10-31 01:02:22.000000000 +0100 @@ -254,10 +254,10 @@ parms := ''; for teller := 1 to paramcount do begin if (parms = '') then begin - parms := paramstr(teller); + parms := '''' + paramstr(teller) + ''''; end else begin - parms := parms + ' ' + paramstr(teller); + parms := parms + ' ''' + paramstr(teller) + ''''; end; end; diff -ur rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/init.rb 2003-10-27 23:57:39.000000000 +0100 +++ rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/init.rb 2003-10-31 01:06:11.000000000 +0100 @@ -27,7 +27,7 @@ tar = FileTest.file?("tar.exe") system("copy #{newdir}\\tar.exe . > nul:") if not tar - system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.join(" ")}") # eval ??? + system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") # eval ??? system("del tar.exe > nul:") if not tar end Binary files rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.5.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.pas 2003-10-31 01:02:22.000000000 +0100 +++ rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas 2003-11-07 23:38:31.000000000 +0100 @@ -246,7 +246,6 @@ begin - tempdir := 'c:\tmp'; tempdir := getenv('TEMP'); me := 'Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; diff -ur rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/init.rb 2003-10-31 01:06:11.000000000 +0100 +++ rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb 2003-11-07 21:57:49.000000000 +0100 @@ -1,9 +1,15 @@ require "ev/oldandnewlocation" require "rbconfig" -app = ARGV.shift +script = ARGV.shift -RubyW = ARGV.include?("--rubyscript2exe-rubyw") +rubyw = false +rubyw = true if script =~ /\.rbw$/ +rubyw = false if ARGV.include?("--rubyscript2exe-ruby") +rubyw = true if ARGV.include?("--rubyscript2exe-rubyw") + +rubyexe = "ruby.exe" +rubyexe = "rubyw.exe" if rubyw ARGV.delete_if do |arg| arg =~ /^--rubyscript2exe-/ @@ -15,11 +21,9 @@ olddir = oldlocation.gsub!(/\//, "\\") newdir = newlocation.gsub!(/\//, "\\") -ruby = "ruby" -ruby = "rubyw" if RubyW - -if not app.nil? - app = app.dup.gsub(/\.rb$/, "") +if not script.nil? + script = "#{script}.rb" if not script =~ /\.rbw?$/ + app = script.gsub(/\.rbw?$/, "") puts "Tracing #{app}..." @@ -27,36 +31,36 @@ tar = FileTest.file?("tar.exe") system("copy #{newdir}\\tar.exe . > nul:") if not tar - system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{app}.rb #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") # eval ??? + system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{script} #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") system("del tar.exe > nul:") if not tar end puts "Gathering files..." - system("copy #{Config::CONFIG["bindir"]}\\#{ruby}.exe . > nul:") + system("copy #{Config::CONFIG["bindir"]}\\#{rubyexe} . > nul:") system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") system("move #{olddir}\\rubyrequired.tar . > nul:") - system("copy #{olddir}\\#{app}.rb app.rb > nul:") + system("copy #{olddir}\\#{script} app.rb > nul:") puts "Packing..." system("#{Config::CONFIG["bindir"]}\\ruby tar2rubyscript.rb rubyrequired.tar") File.open("app.eee", "w") do |f| - f.puts "f #{ruby}.exe" + f.puts "f #{rubyexe}" f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}" f.puts "f rubyrequired.rb" f.puts "f app.rb" - f.puts "t #{ruby} rubyrequired.rb --tar2rubyscript-justextract" + f.puts "t #{rubyexe} rubyrequired.rb --tar2rubyscript-justextract" - f.puts "c %tempdir%\\#{ruby} -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" + f.puts "c %tempdir%\\#{rubyexe} -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" end puts "Creating #{app}.exe..." - if RubyW + if rubyw system("eeew.exe app.eee #{olddir}\\#{app}.exe") else system("eee.exe app.eee #{olddir}\\#{app}.exe") diff -ur rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-10-31 01:14:37.000000000 +0100 +++ rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/tarrubyscript.rb 2003-11-08 20:06:19.000000000 +0100 @@ -191,7 +191,7 @@ @@tempspace = self - @newdir=@tempdir + @newdir = @tempdir end def extract @@ -358,6 +358,8 @@ else TempSpace.new.extract + $0 = "./init.rb" + newlocation do load "init.rb" end Binary files rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.6.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.pas 2003-11-07 23:38:31.000000000 +0100 +++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.pas 2004-01-30 15:16:09.000000000 +0100 @@ -62,7 +62,7 @@ else begin {$I-} - assign(f, sr.name); + assign(f, sr.name); erase(f); if (ioresult <> 0) then begin writeln('Couldn''t delete file ' + sr.name); @@ -97,7 +97,8 @@ assign(eeefile, paramstr(1)); reset(eeefile); - assign(infile, paramstr(0)); + if (paramcount > 2) then assign(infile, paramstr(3)) + else assign(infile, paramstr(0)); reset(infile, 1); blockread(infile, b, sizeof(b), t.length); blockwrite(outfile, b, t.length); @@ -120,15 +121,12 @@ assign(infile, h.tekst); reset(infile, 1); - h.length := filesize(infile); - blockread(infile, b, sizeof(b), h.length); + close(infile); blockwrite(outfile, h, sizeof(h)); blockwrite(outfile, b, h.length); - - close(infile); end; if (klasse = 'c') then begin @@ -207,11 +205,12 @@ // writeln(h.klasse, ' ', h.tekst); if (h.klasse = 'f') then begin - blockread(infile, b, h.length); - assign(outfile, workdir + '\' + h.tekst); rewrite(outfile, 1); + + blockread(infile, b, h.length); blockwrite(outfile, b, h.length); + close(outfile); end; @@ -248,7 +247,7 @@ tempdir := getenv('TEMP'); - me := 'Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; + me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; parms := ''; for teller := 1 to paramcount do begin diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/ev/ftools.rb 2007-05-30 10:17:27.000000000 +0200 +++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/ev/ftools.rb 2004-01-30 16:38:19.000000000 +0100 @@ -0,0 +1,21 @@ +require "ftools" + +class File + def self.rm_rf(entry) + if FileTest.file?(entry) + File.delete(entry) + end + + if FileTest.directory?(entry) + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + rm_rf(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.rmdir(entry) + end + end +end diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/init.rb 2003-11-07 21:57:49.000000000 +0100 +++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/init.rb 2004-01-30 14:49:35.000000000 +0100 @@ -1,6 +1,13 @@ require "ev/oldandnewlocation" +require "ev/ftools" require "rbconfig" +module RubyScript2Exe + +def self.execute(command) + system(command.gsub(/^\.\//, "").gsub(/\//, "\\\\")) +end + script = ARGV.shift rubyw = false @@ -15,11 +22,11 @@ arg =~ /^--rubyscript2exe-/ end -Config::CONFIG["bindir"].gsub!(/\//, "\\") -Config::CONFIG["LIBRUBY_SO"].gsub!(/\//, "\\") +bindir = Config::CONFIG["bindir"] +libruby_so = Config::CONFIG["LIBRUBY_SO"] -olddir = oldlocation.gsub!(/\//, "\\") -newdir = newlocation.gsub!(/\//, "\\") +olddir = oldlocation +newdir = newlocation if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ @@ -29,44 +36,42 @@ oldlocation do tar = FileTest.file?("tar.exe") - system("copy #{newdir}\\tar.exe . > nul:") if not tar + File.copy("#{newdir}/tar.exe", "tar.exe") if not tar - system("#{Config::CONFIG["bindir"]}\\ruby -r #{newdir}\\require2tar.rb #{script} #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") + execute("#{bindir}/ruby -r #{newdir}/require2tar.rb #{script} #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") - system("del tar.exe > nul:") if not tar + File.delete("tar.exe") if not tar end puts "Gathering files..." - system("copy #{Config::CONFIG["bindir"]}\\#{rubyexe} . > nul:") - system("copy #{Config::CONFIG["bindir"]}\\#{Config::CONFIG["LIBRUBY_SO"]} . > nul:") - system("move #{olddir}\\rubyrequired.tar . > nul:") - system("copy #{olddir}\\#{script} app.rb > nul:") + File.copy("#{bindir}/#{rubyexe}", rubyexe) + File.copy("#{bindir}/#{libruby_so}", libruby_so) + File.move("#{olddir}/rubyrequired.tar", "rubyrequired.tar") + File.copy("#{olddir}/#{script}", "app.rb") puts "Packing..." - system("#{Config::CONFIG["bindir"]}\\ruby tar2rubyscript.rb rubyrequired.tar") + execute("#{bindir}/ruby tar2rubyscript.rb rubyrequired.tar") + + puts "Creating #{app}.exe ..." File.open("app.eee", "w") do |f| f.puts "f #{rubyexe}" - f.puts "f #{Config::CONFIG["LIBRUBY_SO"]}" + f.puts "f #{libruby_so}" f.puts "f rubyrequired.rb" f.puts "f app.rb" f.puts "t #{rubyexe} rubyrequired.rb --tar2rubyscript-justextract" - f.puts "c %tempdir%\\#{rubyexe} -I %tempdir%\\rubyrequired %tempdir%\\app.rb %parms%" + f.puts "c %tempdir%/#{rubyexe} -I %tempdir%/rubyrequired %tempdir%/app.rb %parms%" end - puts "Creating #{app}.exe..." - if rubyw - system("eeew.exe app.eee #{olddir}\\#{app}.exe") + execute("./eee app.eee #{olddir}/#{app}.exe eeew.exe"); else - system("eee.exe app.eee #{olddir}\\#{app}.exe") + execute("./eee app.eee #{olddir}/#{app}.exe eee.exe"); end end -# def copy ??? -# def move ??? -# def del ??? +end diff -ur rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/require2tar.rb 2003-11-08 20:06:19.000000000 +0100 +++ rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb 2004-01-30 16:38:19.000000000 +0100 @@ -5,23 +5,22 @@ arg =~ /^--require2tar-/ end -at_exit do - include Require +Require2TarDir = Dir.pwd - createtar +at_exit do + Dir.chdir Require2TarDir + Require.createtar end module Require - - def createtar - temp = ENV["TEMP"] - temp = "/tmp" if temp.nil? + def self.createtar + temp = (ENV["TEMP"] or "/tmp") tmpdir = File.expand_path("rubyrequired2tar.#{Process.pid}", temp) tardir = "rubyrequired" tarfile = "rubyrequired.tar" todir = File.expand_path(tardir, tmpdir) - mkdirs("#{todir}/") + File.makedirs(tmpdir) $".delete_if{|req| not req =~ /^ev\//} if JustEV @@ -39,18 +38,19 @@ #puts "Found #{fromfile} ." - copy(fromfile, tofile) + File.makedirs(File.dirname(tofile)) + File.copy(fromfile, tofile) end end end if not found - puts "Can't find #{req} ." + puts "Can't find #{req} ." if not req =~ /^ev\// end end if not JustCopy - copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe") + File.copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe") pdir = Dir.pwd s = "tar chf #{File.expand_path(tarfile)} #{tardir}" @@ -61,35 +61,12 @@ Dir.chdir(pdir) end - recursivedelete(tmpdir) - end - - def copy(fromfile, tofile) - mkdirs(tofile) - - if not FileTest.file?(tofile) - File.open(tofile, "wb") do |f| - f.write(File.new(fromfile, "rb").read) - end - end - end - - def mkdirs(file) - dir, file = file.gsub(/[\/\\]/, "/").split(/\//, 2) - - if not file.nil? - dir = "#{dir}/" - - Dir.mkdir(dir) if not FileTest.directory?(dir) - - pdir = Dir.pwd - Dir.chdir(dir) - mkdirs(file) - Dir.chdir(pdir) - end + File.rm_rf(tmpdir) end +end - def recursivedelete(entry) +class File + def self.rm_rf(entry) if FileTest.file?(entry) File.delete(entry) end @@ -99,12 +76,11 @@ Dir.chdir(entry) Dir.new(".").each do |e| - recursivedelete(e) if not [".", ".."].include?(e) + rm_rf(e) if not [".", ".."].include?(e) end Dir.chdir(pdir) Dir.rmdir(entry) end end - end Binary files rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.7.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/require2tar.rb 2004-01-30 16:38:19.000000000 +0100 +++ rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/require2tar.rb 2004-02-16 21:38:33.000000000 +0100 @@ -1,3 +1,5 @@ +require "ftools" + JustCopy = ARGV.include?("--require2tar-justcopy") JustEV = ARGV.include?("--require2tar-justev") Binary files rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.8.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/init.rb 2004-01-30 14:49:35.000000000 +0100 +++ rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/init.rb 2004-03-15 22:37:28.000000000 +0100 @@ -5,7 +5,23 @@ module RubyScript2Exe def self.execute(command) - system(command.gsub(/^\.\//, "").gsub(/\//, "\\\\")) + command = command.gsub(/^\.\//, "").gsub(/\//, "\\\\") + + system(command) +end + +def self.copy(from, to) + from = from.gsub(/^\.\//, "").gsub(/\//, "\\\\") + to = to.gsub(/^\.\//, "").gsub(/\//, "\\\\") + + File.copy(from, to) +end + +def self.move(from, to) + from = from.gsub(/^\.\//, "").gsub(/\//, "\\\\") + to = to.gsub(/^\.\//, "").gsub(/\//, "\\\\") + + File.move(from, to) end script = ARGV.shift @@ -23,32 +39,29 @@ end bindir = Config::CONFIG["bindir"] -libruby_so = Config::CONFIG["LIBRUBY_SO"] - -olddir = oldlocation -newdir = newlocation +libruby = Config::CONFIG["LIBRUBY_SO"] if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ - app = script.gsub(/\.rbw?$/, "") + app = File.basename(script.gsub(/\.rbw?$/, "")) puts "Tracing #{app}..." oldlocation do tar = FileTest.file?("tar.exe") - File.copy("#{newdir}/tar.exe", "tar.exe") if not tar + copy(newlocation("tar.exe"), "tar.exe") if not tar - execute("#{bindir}/ruby -r #{newdir}/require2tar.rb #{script} #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") + execute("#{bindir}/ruby -r '#{newlocation("require2tar.rb")}' '#{script}' #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") - File.delete("tar.exe") if not tar + File.delete("tar.exe") if not tar end puts "Gathering files..." - File.copy("#{bindir}/#{rubyexe}", rubyexe) - File.copy("#{bindir}/#{libruby_so}", libruby_so) - File.move("#{olddir}/rubyrequired.tar", "rubyrequired.tar") - File.copy("#{olddir}/#{script}", "app.rb") + copy("#{bindir}/#{rubyexe}", rubyexe) + copy("#{bindir}/#{libruby}", libruby) + move("#{oldlocation("rubyrequired.tar")}", "rubyrequired.tar") + copy("#{oldlocation(script)}", "app.rb") puts "Packing..." @@ -58,7 +71,7 @@ File.open("app.eee", "w") do |f| f.puts "f #{rubyexe}" - f.puts "f #{libruby_so}" + f.puts "f #{libruby}" f.puts "f rubyrequired.rb" f.puts "f app.rb" @@ -68,10 +81,14 @@ end if rubyw - execute("./eee app.eee #{olddir}/#{app}.exe eeew.exe"); + exe = "eeew.exe" else - execute("./eee app.eee #{olddir}/#{app}.exe eee.exe"); + exe = "eee.exe" end + + execute("./eee app.eee #{app}.exe #{exe}") + + copy("#{app}.exe", oldlocation) end end diff -ur rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/require2tar.rb 2004-02-16 21:38:33.000000000 +0100 +++ rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/require2tar.rb 2004-03-16 10:51:08.000000000 +0100 @@ -55,11 +55,15 @@ File.copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe") pdir = Dir.pwd - s = "tar chf #{File.expand_path(tarfile)} #{tardir}" Dir.chdir(tmpdir) puts "Creating #{tarfile}..." - system(s) + system("tar chf #{tarfile} #{tardir}") + + s = File.expand_path(tarfile, pdir) + s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") + + File.move(tarfile, s) Dir.chdir(pdir) end diff -ur rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/tarrubyscript.rb 2004-02-16 21:38:34.000000000 +0100 +++ rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/tarrubyscript.rb 2004-03-16 10:51:08.000000000 +0100 @@ -43,9 +43,9 @@ GNAMELEN = 32 DEVLEN = 8 -TMAGIC = 'ustar' -GNU_TMAGIC = 'ustar ' -SOLARIS_TMAGIC = 'ustar00' +TMAGIC = "ustar" +GNU_TMAGIC = "ustar " +SOLARIS_TMAGIC = "ustar\00000" MAGICS = [TMAGIC, GNU_TMAGIC, SOLARIS_TMAGIC] @@ -162,7 +162,7 @@ raise "Couldn't determine a real value for a field (#{field})" end - raise "Magic header value '#{@magic}' is invalid." if not MAGICS.include?(@magic) + raise "Magic header value #{@magic.inspect} is invalid." if not MAGICS.include?(@magic) @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG @linkflag = LF_DIR if @name[-1] == '/' and @linkflag == LF_FILE Binary files rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.9.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.pas 2004-03-15 22:31:54.000000000 +0100 +++ rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas 2004-02-16 22:00:19.000000000 +0100 @@ -31,7 +31,6 @@ s : string[255]; c : string[255]; p : string[255]; - b : array[0..10000000] of byte; h : header; t : tail; teller : longint; @@ -87,6 +86,72 @@ end; +procedure bufferxor(var b: array of byte); + +var + i : longint; + +begin + + for i := 0 to sizeof(b)-1 do begin + b[i] := 123 xor b[i]; + end; + +end; + + +procedure blockeat(var infile: file; inlength: longint); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + n : longint; + +begin + + c := trunc(inlength/sizeof(b)); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + else l := sizeof(b); + + blockread(infile, b, l, n); + + dec(c); + end; + +end; + + +procedure blockcopy(var infile: file; var outfile: file; inlength: longint; encrypt: boolean); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + n : longint; + +begin + + c := trunc(inlength/sizeof(b)); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + else l := sizeof(b); + + blockread(infile, b, l, n); + if (encrypt) then begin + bufferxor(b); + end; + blockwrite(outfile, b, n); + + dec(c); + end; + +end; + + procedure pakin; begin @@ -100,8 +165,8 @@ if (paramcount > 2) then assign(infile, paramstr(3)) else assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, sizeof(b), t.length); - blockwrite(outfile, b, t.length); + t.length := filesize(infile); + blockcopy(infile, outfile, t.length, false); close(infile); t.number := 0; @@ -122,11 +187,9 @@ assign(infile, h.tekst); reset(infile, 1); h.length := filesize(infile); - blockread(infile, b, sizeof(b), h.length); - close(infile); - blockwrite(outfile, h, sizeof(h)); - blockwrite(outfile, b, h.length); + blockcopy(infile, outfile, h.length, true); + close(infile); end; if (klasse = 'c') then begin @@ -181,7 +244,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, t.length); + blockeat(infile, t.length); try @@ -208,8 +271,7 @@ assign(outfile, workdir + '\' + h.tekst); rewrite(outfile, 1); - blockread(infile, b, h.length); - blockwrite(outfile, b, h.length); + blockcopy(infile, outfile, h.length, true); close(outfile); end; @@ -263,7 +325,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockread(infile, b, filesize(infile)-sizeof(t)); + blockeat(infile, filesize(infile)-sizeof(t)); blockread(infile, t, sizeof(t)); close(infile); Binary files rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.10.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.pas 2004-02-16 22:00:19.000000000 +0100 +++ rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eee.pas 2004-04-24 22:50:12.000000000 +0200 @@ -37,6 +37,7 @@ i : longint; dir : string[255]; parms : string[255]; + justextract : boolean; procedure recursivedelete(var path: string[255]); @@ -255,14 +256,14 @@ i := pos(s, h.tekst); while (i > 0) do begin h.tekst := copy(h.tekst, 1, i-1) + workdir + copy(h.tekst, i+length(s), 255); - i := pos(s, h.tekst); + i := pos(s, h.tekst); end; s := '%parms%'; i := pos(s, h.tekst); while (i > 0) do begin h.tekst := copy(h.tekst, 1, i-1) + parms + copy(h.tekst, i+length(s), 255); - i := pos(s, h.tekst); + i := pos(s, h.tekst); end; // writeln(h.klasse, ' ', h.tekst); @@ -305,14 +306,66 @@ end; +procedure pakhieruit; + +begin + + randomize; + + workdir := paramstr(0); + workdir := copy(workdir, 1, length(workdir)-4); + + {$I-} + mkdir(workdir); + if (ioresult = 183) then begin + writeln('Can''t create ', workdir, '.'); + end; + {$I-} + + assign(infile, paramstr(0)); + reset(infile, 1); + blockeat(infile, t.length); + + try + + for teller := 1 to t.number do begin + blockread(infile, h, sizeof(h)); + + writeln(h.klasse, ' ', h.tekst); + + if (h.klasse = 'f') then begin + assign(outfile, workdir + '\' + h.tekst); + rewrite(outfile, 1); + + blockcopy(infile, outfile, h.length, true); + + close(outfile); + end; + end; + + finally + + close(infile); + + end; + +end; + + begin tempdir := getenv('TEMP'); me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; + justextract := false; + parms := ''; for teller := 1 to paramcount do begin + if (paramstr(teller) = '--eee-justextract') then begin + justextract := true; + end; + if (parms = '') then begin parms := '''' + paramstr(teller) + ''''; end @@ -333,7 +386,12 @@ pakin; end else begin - pakuit + if (justextract) then begin + pakhieruit; + end + else begin + pakuit; + end; end; end. diff -ur rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/tarrubyscript.rb 2004-03-26 13:51:29.000000000 +0100 +++ rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/tarrubyscript.rb 2004-04-25 00:39:31.000000000 +0200 @@ -326,11 +326,11 @@ class MakeTar def initialize @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - @tarfile = $0.gsub(/\.rb$/, ".tar") + @tarfile = $0.gsub(/\.rbw?$/, "") + ".tar" end def extract - File.open(@tarfile, "wb") {|f| f.write @archive} + File.open(@tarfile, "wb") {|f| f.write @archive} end end Binary files rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.11.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/init.rb 2004-04-24 21:44:11.000000000 +0200 +++ rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/init.rb 2004-04-28 22:14:55.000000000 +0200 @@ -26,20 +26,22 @@ script = ARGV.shift +msvcr71 = ARGV.include?("--rubyscript2exe-msvcr71") + rubyw = false rubyw = true if script =~ /\.rbw$/ rubyw = false if ARGV.include?("--rubyscript2exe-ruby") rubyw = true if ARGV.include?("--rubyscript2exe-rubyw") -rubyexe = "ruby.exe" -rubyexe = "rubyw.exe" if rubyw - ARGV.delete_if do |arg| arg =~ /^--rubyscript2exe-/ end bindir = Config::CONFIG["bindir"] +rubyexe = "ruby.exe" +rubyexe = "rubyw.exe" if rubyw libruby = Config::CONFIG["LIBRUBY_SO"] +msvcr71 = "msvcr71.dll" if msvcr71 if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ @@ -60,6 +62,7 @@ copy("#{bindir}/#{rubyexe}", rubyexe) copy("#{bindir}/#{libruby}", libruby) + copy("#{bindir}/#{msvcr71}", msvcr71) if msvcr71 move("#{oldlocation("rubyrequired.tar")}", "rubyrequired.tar") copy("#{oldlocation(script)}", "app.rb") @@ -72,6 +75,7 @@ File.open("app.eee", "w") do |f| f.puts "f #{rubyexe}" f.puts "f #{libruby}" + f.puts "f #{msvcr71}" if msvcr71 f.puts "f rubyrequired.rb" f.puts "f app.rb" diff -ur rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/README rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/README 2004-01-05 22:05:46.000000000 +0100 +++ rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/README 2004-04-28 23:33:16.000000000 +0200 @@ -1,4 +1,4 @@ -Usage: ruby init.rb application[.rb] +Usage: ruby rubyscript2exe.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-msvcr71] For more information, see http://www.erikveen.dds.nl/rubyscript2tar/ . Binary files rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.12.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eee.pas 2004-04-28 22:24:04.000000000 +0200 +++ rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.pas 2004-05-02 23:56:22.000000000 +0200 @@ -2,7 +2,7 @@ uses - Dos; + SysUtils, Dos; type @@ -27,16 +27,17 @@ outfile : file of byte; eeefile : Text; klasse : string[1]; - tekst : string[255]; + tekst1 : string[255]; + tekst2 : string; s : string[255]; - c : string[255]; - p : string[255]; + c : string; + p : string; h : header; t : tail; teller : longint; i : longint; dir : string[255]; - parms : string[255]; + parms : string; justextract : boolean; @@ -46,15 +47,19 @@ f : file; sr : searchrec; dir : string[255]; + attr : word; begin getdir(0, dir); chdir(path); - findfirst('*.*', directory, sr); + findfirst('*.*', anyfile or directory, sr); while(doserror = 0) do begin - if (sr.attr and directory > 0) then 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; @@ -177,13 +182,13 @@ if (not (s = '') and not (copy(s, 1, 1) = '#')) then begin klasse := copy(s, 1, 1); - tekst := copy(s, 3, 255); + tekst1 := copy(s, 3, length(s)-2); // writeln(h.klasse, ' ', h.tekst); if (klasse = 'f') then begin h.klasse := klasse; - h.tekst := tekst; + h.tekst := tekst1; assign(infile, h.tekst); reset(infile, 1); @@ -195,7 +200,7 @@ if (klasse = 'c') then begin h.klasse := klasse; - h.tekst := tekst; + h.tekst := tekst1; h.length := 0; blockwrite(outfile, h, sizeof(h)); @@ -203,7 +208,7 @@ if (klasse = 't') then begin h.klasse := klasse; - h.tekst := tekst; + h.tekst := tekst1; h.length := 0; blockwrite(outfile, h, sizeof(h)); @@ -252,24 +257,26 @@ for teller := 1 to t.number do begin blockread(infile, h, sizeof(h)); + tekst2 := h.tekst; + s := '%tempdir%'; - i := pos(s, h.tekst); + i := pos(s, tekst2); while (i > 0) do begin - h.tekst := copy(h.tekst, 1, i-1) + workdir + copy(h.tekst, i+length(s), 255); - i := pos(s, h.tekst); + tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); end; s := '%parms%'; - i := pos(s, h.tekst); + i := pos(s, tekst2); while (i > 0) do begin - h.tekst := copy(h.tekst, 1, i-1) + parms + copy(h.tekst, i+length(s), 255); - i := pos(s, h.tekst); + tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); end; - // writeln(h.klasse, ' ', h.tekst); + // writeln(h.klasse, ' ', tekst2); if (h.klasse = 'f') then begin - assign(outfile, workdir + '\' + h.tekst); + assign(outfile, workdir + '\' + tekst2); rewrite(outfile, 1); blockcopy(infile, outfile, h.length, true); @@ -278,19 +285,19 @@ end; if (h.klasse = 'c') then begin - i := pos(' ', h.tekst); - c := copy(h.tekst, 1, i-1); - p := copy(h.tekst, i+1, 255); - exec(c, p); + i := pos(' ', tekst2); + c := copy(tekst2, 1, i-1); + p := copy(tekst2, i+1, length(tekst2)-i); + executeprocess(c, p); end; if (h.klasse = 't') then begin getdir(0, dir); chdir(workdir); - i := pos(' ', h.tekst); - c := copy(h.tekst, 1, i-1); - p := copy(h.tekst, i+1, 255); - exec(c, p); + i := pos(' ', tekst2); + c := copy(tekst2, 1, i-1); + p := copy(tekst2, i+1, length(tekst2)-i); + executeprocess(c, p); chdir(dir); end; end; Binary files rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.13.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.pas 2004-05-02 23:56:22.000000000 +0200 +++ rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.pas 2004-05-14 22:48:30.000000000 +0200 @@ -70,7 +70,7 @@ assign(f, sr.name); erase(f); if (ioresult <> 0) then begin - writeln('Couldn''t delete file ' + sr.name); + // writeln('Couldn''t delete file ' + sr.name); end; {$I+} @@ -85,7 +85,7 @@ {$I-} rmdir(path + '\'); if (ioresult <> 0) then begin - writeln('Couldn''t delete directory ' + path + ' (Known Error).'); + // writeln('Couldn''t delete directory ' + path + ' (Known Error).'); end; {$I+} @@ -116,10 +116,10 @@ begin - c := trunc(inlength/sizeof(b)); + c := trunc(inlength div sizeof(b)); while (c >= 0) do begin - if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + if (c = 0) then l := inlength-(trunc(inlength div sizeof(b))*sizeof(b)) else l := sizeof(b); blockread(infile, b, l, n); @@ -140,10 +140,10 @@ begin - c := trunc(inlength/sizeof(b)); + c := trunc(inlength div sizeof(b)); while (c >= 0) do begin - if (c = 0) then l := inlength-(trunc(inlength/sizeof(b))*sizeof(b)) + if (c = 0) then l := inlength-(trunc(inlength div sizeof(b))*sizeof(b)) else l := sizeof(b); blockread(infile, b, l, n); @@ -317,31 +317,26 @@ begin - randomize; - - workdir := paramstr(0); - workdir := copy(workdir, 1, length(workdir)-4); - - {$I-} - mkdir(workdir); - if (ioresult = 183) then begin - writeln('Can''t create ', workdir, '.'); - end; - {$I-} - assign(infile, paramstr(0)); reset(infile, 1); - blockeat(infile, t.length); + + assign(outfile, 'eee.exe'); + rewrite(outfile); + blockcopy(infile, outfile, t.length, false); + close(outfile); + + assign(eeefile, 'app.eee'); + rewrite(eeefile); try for teller := 1 to t.number do begin blockread(infile, h, sizeof(h)); - writeln(h.klasse, ' ', h.tekst); + writeln(eeefile, h.klasse, ' ', h.tekst); if (h.klasse = 'f') then begin - assign(outfile, workdir + '\' + h.tekst); + assign(outfile, h.tekst); rewrite(outfile, 1); blockcopy(infile, outfile, h.length, true); @@ -352,6 +347,8 @@ finally + close(eeefile); + close(infile); end; diff -ur rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/ev/ftools.rb 2004-05-04 22:17:23.000000000 +0200 +++ rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/ev/ftools.rb 2004-05-15 11:59:12.000000000 +0200 @@ -7,7 +7,7 @@ end if FileTest.directory?(entry) - pdir = Dir.pwd + pdir = Dir.pwd Dir.chdir(entry) Dir.new(".").each do |e| @@ -18,4 +18,42 @@ Dir.rmdir(entry) end end + + def self.rollbackup(file) + backupfile = file + ".RB.BACKUP" + controlfile = file + ".RB.CONTROL" + + File.touch(file) unless File.file?(file) + + # Rollback + + if File.file?(backupfile) and File.file?(controlfile) + $stdout.puts "Restoring #{file}..." + + File.copy(backupfile, file) # Rollback from fase 3 + end + + # Reset + + File.delete(backupfile) if File.file?(backupfile) # Reset from fase 2 or 3 + File.delete(controlfile) if File.file?(controlfile) # Reset from fase 3 or 4 + + # Backup + + File.copy(file, backupfile) # Enter fase 2 + File.touch(controlfile) # Enter fase 3 + + # The real thing + + yield if block_given? + + # Cleanup + + File.delete(backupfile) # Enter fase 4 + File.delete(controlfile) # Enter fase 5 + end + + def self.touch(file) + File.open(file, "a"){|f|} + end end Binary files rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.14.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.pas 2004-05-14 22:48:30.000000000 +0200 +++ rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.pas 2004-06-10 13:57:22.000000000 +0200 @@ -16,6 +16,7 @@ length : longint; number : longint; who : string[255]; + exename : string[32]; end; var @@ -38,6 +39,7 @@ i : longint; dir : string[255]; parms : string; + quotedparms : string; justextract : boolean; @@ -168,14 +170,29 @@ assign(eeefile, paramstr(1)); reset(eeefile); - if (paramcount > 2) then assign(infile, paramstr(3)) - else assign(infile, paramstr(0)); + if (paramcount > 2) then begin + assign(infile, paramstr(3)); + t.exename := paramstr(3); + end + else begin + assign(infile, paramstr(0)); + t.exename := paramstr(0); + end; + reset(infile, 1); t.length := filesize(infile); blockcopy(infile, outfile, t.length, false); close(infile); t.number := 0; + t.who := me; + + s := '\'; + i := pos(s, t.exename); + while (i > 0) do begin + t.exename := copy(t.exename, i+length(s), length(t.exename)-(i+length(s))+1); + i := pos(s, t.exename); + end; repeat readln(eeefile, s); @@ -218,8 +235,6 @@ end; until eof(eeefile); - t.who := me; - blockwrite(outfile, t, sizeof(t)); close(eeefile); @@ -273,6 +288,13 @@ i := pos(s, tekst2); end; + s := '%quotedparms%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; + // writeln(h.klasse, ' ', tekst2); if (h.klasse = 'f') then begin @@ -320,7 +342,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - assign(outfile, 'eee.exe'); + assign(outfile, t.exename); rewrite(outfile); blockcopy(infile, outfile, t.length, false); close(outfile); @@ -365,16 +387,19 @@ justextract := false; parms := ''; + quotedparms := ''; for teller := 1 to paramcount do begin if (paramstr(teller) = '--eee-justextract') then begin justextract := true; end; - if (parms = '') then begin - parms := '''' + paramstr(teller) + ''''; + if ((parms = '') and (quotedparms = '')) then begin + parms := paramstr(teller); + quotedparms := '''' + paramstr(teller) + ''''; end else begin - parms := parms + ' ''' + paramstr(teller) + ''''; + parms := parms + ' ' + paramstr(teller); + quotedparms := quotedparms + ' ''' + paramstr(teller) + ''''; end; end; diff -ur rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/ev/ftools.rb 2004-05-15 11:59:12.000000000 +0200 +++ rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/ev/ftools.rb 2004-06-11 13:17:48.000000000 +0200 @@ -19,7 +19,7 @@ end end - def self.rollbackup(file) + def self.rollbackup(file, mode=nil) backupfile = file + ".RB.BACKUP" controlfile = file + ".RB.CONTROL" @@ -30,27 +30,43 @@ if File.file?(backupfile) and File.file?(controlfile) $stdout.puts "Restoring #{file}..." - File.copy(backupfile, file) # Rollback from fase 3 + File.copy(backupfile, file) # Rollback from phase 3 end # Reset - File.delete(backupfile) if File.file?(backupfile) # Reset from fase 2 or 3 - File.delete(controlfile) if File.file?(controlfile) # Reset from fase 3 or 4 + File.delete(backupfile) if File.file?(backupfile) # Reset from phase 2 or 3 + File.delete(controlfile) if File.file?(controlfile) # Reset from phase 3 or 4 # Backup - File.copy(file, backupfile) # Enter fase 2 - File.touch(controlfile) # Enter fase 3 + File.copy(file, backupfile) # Enter phase 2 + File.touch(controlfile) # Enter phase 3 # The real thing - yield if block_given? + if block_given? + if mode.nil? + yield + else + File.open(file, mode) do |f| + yield(f) + end + end + end # Cleanup - File.delete(backupfile) # Enter fase 4 - File.delete(controlfile) # Enter fase 5 + File.delete(backupfile) # Enter phase 4 + File.delete(controlfile) # Enter phase 5 + + # Return, like File.open + + if block_given? + return nil + else + return File.open(file, (mode or "r")) + end end def self.touch(file) diff -ur rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/init.rb 2004-04-28 22:14:55.000000000 +0200 +++ rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/init.rb 2004-06-09 11:17:38.000000000 +0200 @@ -60,7 +60,8 @@ puts "Gathering files..." - copy("#{bindir}/#{rubyexe}", rubyexe) + copy("#{bindir}/ruby.exe", "ruby.exe") + copy("#{bindir}/rubyw.exe", "rubyw.exe") copy("#{bindir}/#{libruby}", libruby) copy("#{bindir}/#{msvcr71}", msvcr71) if msvcr71 move("#{oldlocation("rubyrequired.tar")}", "rubyrequired.tar") @@ -73,7 +74,8 @@ puts "Creating #{app}.exe ..." File.open("app.eee", "w") do |f| - f.puts "f #{rubyexe}" + f.puts "f ruby.exe" + f.puts "f rubyw.exe" f.puts "f #{libruby}" f.puts "f #{msvcr71}" if msvcr71 f.puts "f rubyrequired.rb" @@ -81,16 +83,16 @@ f.puts "t #{rubyexe} rubyrequired.rb --tar2rubyscript-justextract" - f.puts "c %tempdir%/#{rubyexe} -I %tempdir%/rubyrequired %tempdir%/app.rb %parms%" + f.puts "c %tempdir%/#{rubyexe} -I %tempdir%/rubyrequired %tempdir%/app.rb %quotedparms%" end if rubyw - exe = "eeew.exe" + eeeexe = "eeew.exe" else - exe = "eee.exe" + eeeexe = "eee.exe" end - execute("./eee app.eee #{app}.exe #{exe}") + execute("./eee app.eee #{app}.exe #{eeeexe}") copy("#{app}.exe", oldlocation) end Binary files rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.15.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.pas 2004-06-10 13:57:22.000000000 +0200 +++ rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.pas 2004-06-16 00:28:55.000000000 +0200 @@ -1,5 +1,7 @@ {$mode DELPHI} +{$R eee.res} + uses SysUtils, Dos; @@ -118,10 +120,10 @@ begin - c := trunc(inlength div sizeof(b)); + c := inlength div sizeof(b); while (c >= 0) do begin - if (c = 0) then l := inlength-(trunc(inlength div sizeof(b))*sizeof(b)) + if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b) else l := sizeof(b); blockread(infile, b, l, n); @@ -142,10 +144,10 @@ begin - c := trunc(inlength div sizeof(b)); + c := inlength div sizeof(b); while (c >= 0) do begin - if (c = 0) then l := inlength-(trunc(inlength div sizeof(b))*sizeof(b)) + if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b) else l := sizeof(b); blockread(infile, b, l, n); @@ -180,10 +182,10 @@ end; reset(infile, 1); - t.length := filesize(infile); - blockcopy(infile, outfile, t.length, false); + blockcopy(infile, outfile, filesize(infile), false); close(infile); + t.length := 0; t.number := 0; t.who := me; @@ -210,6 +212,7 @@ assign(infile, h.tekst); reset(infile, 1); h.length := filesize(infile); + t.length := t.length + h.length + sizeof(h); blockwrite(outfile, h, sizeof(h)); blockcopy(infile, outfile, h.length, true); close(infile); @@ -219,6 +222,7 @@ h.klasse := klasse; h.tekst := tekst1; h.length := 0; + t.length := t.length + sizeof(h); blockwrite(outfile, h, sizeof(h)); end; @@ -227,6 +231,7 @@ h.klasse := klasse; h.tekst := tekst1; h.length := 0; + t.length := t.length + sizeof(h); blockwrite(outfile, h, sizeof(h)); end; @@ -235,6 +240,8 @@ end; until eof(eeefile); + t.length := t.length + sizeof(t); + blockwrite(outfile, t, sizeof(t)); close(eeefile); @@ -265,7 +272,7 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockeat(infile, t.length); + blockeat(infile, filesize(infile)-t.length); try @@ -344,7 +351,7 @@ assign(outfile, t.exename); rewrite(outfile); - blockcopy(infile, outfile, t.length, false); + blockcopy(infile, outfile, filesize(infile)-t.length, false); close(outfile); assign(eeefile, 'app.eee'); diff -ur rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.rc rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.rc --- rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.rc 2007-05-30 10:17:40.000000000 +0200 +++ rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.rc 2004-06-13 14:47:03.000000000 +0200 @@ -0,0 +1 @@ +AppIcon ICON "eee.ico" diff -ur rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/ev/ftools.rb 2004-06-11 13:17:48.000000000 +0200 +++ rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/ev/ftools.rb 2004-06-23 00:52:11.000000000 +0200 @@ -1,5 +1,17 @@ require "ftools" +class Dir + def Dir.mkdirrec(dir) + pdir = File.dirname(dir) + + if not pdir.empty? and not FileTest.directory?(pdir) + mkdirrec (pdir) + end + + Dir.mkdir(dir) rescue nil + end +end + class File def self.rm_rf(entry) if FileTest.file?(entry) diff -ur rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/README rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/README 2004-04-28 23:33:16.000000000 +0200 +++ rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/README 2004-06-13 14:18:37.000000000 +0200 @@ -1,4 +1,4 @@ Usage: ruby rubyscript2exe.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-msvcr71] For more information, see -http://www.erikveen.dds.nl/rubyscript2tar/ . +http://www.erikveen.dds.nl/rubyscript2exe/ . Binary files rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eee.ico and rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eee.ico differ Binary files rubyscript2exe-0.1.16.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/init.rb 2004-06-09 11:17:38.000000000 +0200 +++ rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/init.rb 2004-06-27 19:54:07.000000000 +0200 @@ -95,6 +95,10 @@ execute("./eee app.eee #{app}.exe #{eeeexe}") copy("#{app}.exe", oldlocation) + + oldlocation do + system("reshacker -modify %s, %s, %s, icon,appicon," % [newlocation("#{app}.exe"), "#{app}.exe", "#{app}.ico"]) if File.file?("#{app}.ico") + end end end diff -ur rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/README rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.1.17.tar.gz/rubyscript2exe/README 2004-06-13 14:18:37.000000000 +0200 +++ rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/README 2004-06-27 20:07:57.000000000 +0200 @@ -1,4 +1,8 @@ -Usage: ruby rubyscript2exe.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-msvcr71] +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-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-msvcr71] For more information, see http://www.erikveen.dds.nl/rubyscript2exe/ . diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/eee.pas 2004-06-27 19:52:18.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eee.pas 2004-07-26 16:46:37.000000000 +0200 @@ -6,6 +6,14 @@ SysUtils, Dos; +const + + {$IFDEF LINUX} + slash = '/'; + {$ELSE} + slash = '\'; + {$ENDIF} + type header = record @@ -18,7 +26,7 @@ length : longint; number : longint; who : string[255]; - exename : string[32]; + exename : string[255]; end; var @@ -33,13 +41,11 @@ tekst1 : string[255]; tekst2 : string; s : string[255]; - c : string; - p : string; + i : longint; + dir : string[255]; h : header; t : tail; teller : longint; - i : longint; - dir : string[255]; parms : string; quotedparms : string; justextract : boolean; @@ -87,7 +93,7 @@ chdir(dir); {$I-} - rmdir(path + '\'); + rmdir(path + slash); if (ioresult <> 0) then begin // writeln('Couldn''t delete directory ' + path + ' (Known Error).'); end; @@ -162,183 +168,360 @@ end; -procedure pakin; +procedure pakin_f(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); + +var + infile : file of byte; + h : header; + +begin + + h.klasse := klasse; + h.tekst := tekst; + + assign(infile, entry); + reset(infile, 1); + h.length := filesize(infile); + t.length := t.length + h.length + sizeof(h); + blockwrite(outfile, h, sizeof(h)); + blockcopy(infile, outfile, h.length, true); + close(infile); + + t.number := t.number + 1; + +end; + + +procedure pakin_d(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); + +var + h : header; + +begin + + entry := entry; + + h.klasse := klasse; + h.tekst := tekst; + h.length := 0; + t.length := t.length + sizeof(h); + + blockwrite(outfile, h, sizeof(h)); + + t.number := t.number + 1; + +end; + + +procedure pakin_r(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); + +var + f : file; + sr : searchrec; + dir : string[255]; + attr : word; begin - assign(outfile, paramstr(2)); - rewrite(outfile, 1); + klasse := klasse; + + pakin_d(outfile, 'd', tekst, entry, t); + + getdir(0, dir); + chdir(entry); - assign(eeefile, paramstr(1)); - reset(eeefile); + findfirst('*.*', anyfile or directory, sr); + while(doserror = 0) do begin + assign(f, sr.name); // Foutje in 1.9.2 ??? + getfattr(f, attr); // Foutje in 1.9.2 ??? - if (paramcount > 2) then begin - assign(infile, paramstr(3)); - t.exename := paramstr(3); + if (attr and directory > 0) then begin + if ((not (sr.name = '.')) and (not (sr.name = '..'))) then begin + pakin_r(outfile, 'r', tekst + slash + sr.name, sr.name, t); + end; end else begin - assign(infile, paramstr(0)); - t.exename := paramstr(0); + pakin_f(outfile, 'f', tekst + slash + sr.name, sr.name, t); end; - reset(infile, 1); - blockcopy(infile, outfile, filesize(infile), false); - close(infile); + findnext(sr); + end; + findclose(sr); - t.length := 0; - t.number := 0; - t.who := me; + chdir(dir); - s := '\'; - i := pos(s, t.exename); - while (i > 0) do begin - t.exename := copy(t.exename, i+length(s), length(t.exename)-(i+length(s))+1); - i := pos(s, t.exename); - end; - - repeat - readln(eeefile, s); - - if (not (s = '') and not (copy(s, 1, 1) = '#')) then begin - klasse := copy(s, 1, 1); - tekst1 := copy(s, 3, length(s)-2); - - // writeln(h.klasse, ' ', h.tekst); - - if (klasse = 'f') then begin - h.klasse := klasse; - h.tekst := tekst1; - - assign(infile, h.tekst); - reset(infile, 1); - h.length := filesize(infile); - t.length := t.length + h.length + sizeof(h); - blockwrite(outfile, h, sizeof(h)); - blockcopy(infile, outfile, h.length, true); - close(infile); - end; +end; - if (klasse = 'c') then begin - h.klasse := klasse; - h.tekst := tekst1; - h.length := 0; - t.length := t.length + sizeof(h); - blockwrite(outfile, h, sizeof(h)); - end; +procedure pakin_c(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); - if (klasse = 't') then begin - h.klasse := klasse; - h.tekst := tekst1; - h.length := 0; - t.length := t.length + sizeof(h); +var + h : header; - blockwrite(outfile, h, sizeof(h)); - end; +begin + + entry := entry; + + h.klasse := klasse; + h.tekst := tekst; + h.length := 0; + t.length := t.length + sizeof(h); + + blockwrite(outfile, h, sizeof(h)); + + t.number := t.number + 1; + +end; + + +procedure pakin_t(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); + +var + h : header; + +begin + + entry := entry; + + h.klasse := klasse; + h.tekst := tekst; + h.length := 0; + t.length := t.length + sizeof(h); + + blockwrite(outfile, h, sizeof(h)); + + t.number := t.number + 1; + +end; + + +procedure pakin; + +begin + + assign(outfile, paramstr(2)); + rewrite(outfile, 1); + + assign(eeefile, paramstr(1)); + reset(eeefile); + + if (paramcount > 2) then begin + assign(infile, paramstr(3)); + t.exename := paramstr(3); + end + else begin + assign(infile, paramstr(0)); + t.exename := paramstr(0); + end; + + reset(infile, 1); + blockcopy(infile, outfile, filesize(infile), false); + close(infile); + + t.length := 0; + t.number := 0; + t.who := me; + + s := slash; + i := pos(s, t.exename); + while (i > 0) do begin + t.exename := copy(t.exename, i+length(s), length(t.exename)-(i+length(s))+1); + i := pos(s, t.exename); + end; + + repeat + readln(eeefile, s); - t.number := t.number + 1; + if (not (s = '') and not (copy(s, 1, 1) = '#')) then begin + klasse := copy(s, 1, 1); + tekst1 := copy(s, 3, length(s)-2); + + case klasse[1] of + 'f': pakin_f(outfile, klasse, tekst1, tekst1, t); + 'd': pakin_d(outfile, klasse, tekst1, tekst1, t); + 'r': pakin_r(outfile, klasse, tekst1, tekst1, t); + 'c': pakin_c(outfile, klasse, tekst1, tekst1, t); + 't': pakin_t(outfile, klasse, tekst1, tekst1, t); end; - until eof(eeefile); + end; + until eof(eeefile); - t.length := t.length + sizeof(t); + t.length := t.length + sizeof(t); - blockwrite(outfile, t, sizeof(t)); + blockwrite(outfile, t, sizeof(t)); - close(eeefile); + close(eeefile); - close(outfile); + close(outfile); end; -procedure pakuit; +procedure pakuit_f(var infile: file; var outfile: file; tekst: string[255]; var h: header); begin - randomize; + assign(outfile, workdir + slash + tekst); + rewrite(outfile, 1); - getdir(0, dir); - chdir(tempdir); - {$I-} - repeat - str(random(1000), s); - workdir := 'eee.' + s; - mkdir(workdir); - until (ioresult = 0); - {$I+} + blockcopy(infile, outfile, h.length, true); - workdir := tempdir + '\' + workdir; - chdir(dir); + close(outfile); - assign(infile, paramstr(0)); - reset(infile, 1); - blockeat(infile, filesize(infile)-t.length); +end; - try - for teller := 1 to t.number do begin - blockread(infile, h, sizeof(h)); +procedure pakuit_d(var infile: file; var outfile: file; tekst: string[255]; var h: header); - tekst2 := h.tekst; +begin - s := '%tempdir%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; + infile := infile; + outfile := outfile; + h := h; - s := '%parms%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; + mkdir(workdir + slash + tekst); + +end; - s := '%quotedparms%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - // writeln(h.klasse, ' ', tekst2); +procedure pakuit_c(var infile: file; var outfile: file; tekst: string[255]; var h: header); - if (h.klasse = 'f') then begin - assign(outfile, workdir + '\' + tekst2); - rewrite(outfile, 1); +var + c : string; + p : string; + i : longint; - blockcopy(infile, outfile, h.length, true); +begin - close(outfile); - end; + infile := infile; + outfile := outfile; + h := h; + + {$IFDEF LINUX} + c := getenv('SHELL'); + p := '-c "' + tekst + '"'; + {$ELSE} + i := pos(' ', tekst); + if (i = 0) then begin + c := tekst; + p := ''; + end + else begin + c := copy(tekst, 1, i-1); + p := copy(tekst, i+1, length(tekst)-i); + end; + {$ENDIF} - if (h.klasse = 'c') then begin - i := pos(' ', tekst2); - c := copy(tekst2, 1, i-1); - p := copy(tekst2, i+1, length(tekst2)-i); - executeprocess(c, p); - end; + executeprocess(c, p); - if (h.klasse = 't') then begin - getdir(0, dir); - chdir(workdir); - i := pos(' ', tekst2); - c := copy(tekst2, 1, i-1); - p := copy(tekst2, i+1, length(tekst2)-i); - executeprocess(c, p); - chdir(dir); - end; - end; +end; + + +procedure pakuit_t(var infile: file; var outfile: file; tekst: string[255]; var h: header); + +var + c : string; + p : string; + i : longint; + dir : string[255]; + +begin + + infile := infile; + outfile := outfile; + h := h; + + {$IFDEF LINUX} + c := getenv('SHELL'); + p := '-c "' + tekst + '"'; + {$ELSE} + i := pos(' ', tekst); + if (i = 0) then begin + c := tekst; + p := ''; + end + else begin + c := copy(tekst, 1, i-1); + p := copy(tekst, i+1, length(tekst)-i); + end; + {$ENDIF} + + getdir(0, dir); + chdir(workdir); + executeprocess(c, p); + chdir(dir); + +end; + + +procedure pakuit; + +begin + + randomize; + + getdir(0, dir); + chdir(tempdir); + {$I-} + repeat + str(random(1000), s); + workdir := 'eee.' + s; + mkdir(workdir); + until (ioresult = 0); + {$I+} + + workdir := tempdir + slash + workdir; + chdir(dir); + + assign(infile, paramstr(0)); + reset(infile, 1); + blockeat(infile, filesize(infile)-t.length); + + try + + for teller := 1 to t.number do begin + blockread(infile, h, sizeof(h)); + + klasse := h.klasse; + tekst2 := h.tekst; - finally + s := '%tempdir%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; - close(infile); + s := '%parms%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; - recursivedelete(workdir); + s := '%quotedparms%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; + case klasse[1] of + 'f': pakuit_f(infile, outfile, tekst2, h); + 'd': pakuit_d(infile, outfile, tekst2, h); + 'c': pakuit_c(infile, outfile, tekst2, h); + 't': pakuit_t(infile, outfile, tekst2, h); + end; end; + finally + + close(infile); + + recursivedelete(workdir); + + end; + end; @@ -347,40 +530,47 @@ begin assign(infile, paramstr(0)); - reset(infile, 1); + reset(infile, 1); - assign(outfile, t.exename); - rewrite(outfile); - blockcopy(infile, outfile, filesize(infile)-t.length, false); - close(outfile); + assign(outfile, t.exename); + rewrite(outfile); + blockcopy(infile, outfile, filesize(infile)-t.length, false); + close(outfile); - assign(eeefile, 'app.eee'); - rewrite(eeefile); + assign(eeefile, 'app.eee'); + rewrite(eeefile); - try + try - for teller := 1 to t.number do begin - blockread(infile, h, sizeof(h)); + for teller := 1 to t.number do begin + blockread(infile, h, sizeof(h)); - writeln(eeefile, h.klasse, ' ', h.tekst); + writeln(eeefile, h.klasse, ' ', h.tekst); - if (h.klasse = 'f') then begin - assign(outfile, h.tekst); - rewrite(outfile, 1); + if (h.klasse = 'f') then begin + assign(outfile, h.tekst); + rewrite(outfile, 1); - blockcopy(infile, outfile, h.length, true); + blockcopy(infile, outfile, h.length, true); - close(outfile); - end; + close(outfile); end; - finally + if (h.klasse = 'd') then begin + {$I-} + mkdir(h.tekst); + if (ioresult = 0) then; + {$I+} + end; + end; + + finally - close(eeefile); + close(eeefile); - close(infile); + close(infile); - end; + end; end; @@ -388,6 +578,10 @@ begin tempdir := getenv('TEMP'); + if (tempdir = '') then begin + tempdir := '/tmp' + end; + me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/ev/ftools.rb 2004-06-27 19:57:16.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/ftools.rb 2007-05-30 10:17:42.000000000 +0200 @@ -1,87 +0,0 @@ -require "ftools" - -class Dir - def Dir.mkdirrec(dir) - pdir = File.dirname(dir) - - if not pdir.empty? and not FileTest.directory?(pdir) - mkdirrec (pdir) - end - - Dir.mkdir(dir) rescue nil - end -end - -class File - def self.rm_rf(entry) - if FileTest.file?(entry) - File.delete(entry) - end - - if FileTest.directory?(entry) - pdir = Dir.pwd - - Dir.chdir(entry) - Dir.new(".").each do |e| - rm_rf(e) if not [".", ".."].include?(e) - end - Dir.chdir(pdir) - - Dir.rmdir(entry) - end - end - - def self.rollbackup(file, mode=nil) - backupfile = file + ".RB.BACKUP" - controlfile = file + ".RB.CONTROL" - - File.touch(file) unless File.file?(file) - - # Rollback - - if File.file?(backupfile) and File.file?(controlfile) - $stdout.puts "Restoring #{file}..." - - File.copy(backupfile, file) # Rollback from phase 3 - end - - # Reset - - File.delete(backupfile) if File.file?(backupfile) # Reset from phase 2 or 3 - File.delete(controlfile) if File.file?(controlfile) # Reset from phase 3 or 4 - - # Backup - - File.copy(file, backupfile) # Enter phase 2 - File.touch(controlfile) # Enter phase 3 - - # The real thing - - if block_given? - if mode.nil? - yield - else - File.open(file, mode) do |f| - yield(f) - end - end - end - - # Cleanup - - File.delete(backupfile) # Enter phase 4 - File.delete(controlfile) # Enter phase 5 - - # Return, like File.open - - if block_given? - return nil - else - return File.open(file, (mode or "r")) - end - end - - def self.touch(file) - File.open(file, "a"){|f|} - end -end diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-06-27 19:55:16.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-07-26 19:15:21.000000000 +0200 @@ -6,6 +6,7 @@ rescue NameError def oldlocation(file="") dir = ENV["OLDDIR"] + res = nil if block_given? pdir = Dir.pwd @@ -26,6 +27,7 @@ rescue NameError def newlocation(file="") dir = ENV["NEWDIR"] + res = nil if block_given? pdir = Dir.pwd diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/init.rb 2004-06-27 19:54:07.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb 2004-07-26 18:48:26.000000000 +0200 @@ -1,33 +1,9 @@ require "ev/oldandnewlocation" -require "ev/ftools" +require "ftools" require "rbconfig" -module RubyScript2Exe - -def self.execute(command) - command = command.gsub(/^\.\//, "").gsub(/\//, "\\\\") - - system(command) -end - -def self.copy(from, to) - from = from.gsub(/^\.\//, "").gsub(/\//, "\\\\") - to = to.gsub(/^\.\//, "").gsub(/\//, "\\\\") - - File.copy(from, to) -end - -def self.move(from, to) - from = from.gsub(/^\.\//, "").gsub(/\//, "\\\\") - to = to.gsub(/^\.\//, "").gsub(/\//, "\\\\") - - File.move(from, to) -end - script = ARGV.shift -msvcr71 = ARGV.include?("--rubyscript2exe-msvcr71") - rubyw = false rubyw = true if script =~ /\.rbw$/ rubyw = false if ARGV.include?("--rubyscript2exe-ruby") @@ -38,67 +14,53 @@ end bindir = Config::CONFIG["bindir"] -rubyexe = "ruby.exe" -rubyexe = "rubyw.exe" if rubyw libruby = Config::CONFIG["LIBRUBY_SO"] -msvcr71 = "msvcr71.dll" if msvcr71 if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) + libdir = File.expand_path("lib") puts "Tracing #{app}..." oldlocation do - tar = FileTest.file?("tar.exe") - copy(newlocation("tar.exe"), "tar.exe") if not tar - - execute("#{bindir}/ruby -r '#{newlocation("require2tar.rb")}' '#{script}' #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}") - - File.delete("tar.exe") if not tar + system("#{bindir}/ruby -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir}' #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}".gsub(/^\.\//, "").gsub(/\//, "\\\\")) end - puts "Gathering files..." + puts "Copying files..." - copy("#{bindir}/ruby.exe", "ruby.exe") - copy("#{bindir}/rubyw.exe", "rubyw.exe") - copy("#{bindir}/#{libruby}", libruby) - copy("#{bindir}/#{msvcr71}", msvcr71) if msvcr71 - move("#{oldlocation("rubyrequired.tar")}", "rubyrequired.tar") - copy("#{oldlocation(script)}", "app.rb") + Dir.mkdir("bin") + Dir.mkdir("app") - puts "Packing..." + File.copy("#{bindir}/ruby.exe" , "bin/ruby.exe" ) + File.copy("#{bindir}/rubyw.exe" , "bin/rubyw.exe" ) + File.copy("#{bindir}/#{libruby}" , "bin/#{libruby}" ) + File.copy("#{bindir}/msvcr71.dll" , "bin/msvcr71.dll" ) if File.file?("#{bindir}/msvcr71.dll") + File.copy("#{oldlocation(script)}" , "app/app.rb" ) - execute("#{bindir}/ruby tar2rubyscript.rb rubyrequired.tar") - - puts "Creating #{app}.exe ..." + puts "Creating #{app}.exe..." File.open("app.eee", "w") do |f| - f.puts "f ruby.exe" - f.puts "f rubyw.exe" - f.puts "f #{libruby}" - f.puts "f #{msvcr71}" if msvcr71 - f.puts "f rubyrequired.rb" - f.puts "f app.rb" + f.puts "r bin" + f.puts "r lib" + f.puts "r app" - f.puts "t #{rubyexe} rubyrequired.rb --tar2rubyscript-justextract" + rubyexe = "ruby.exe" + rubyexe = "rubyw.exe" if rubyw - f.puts "c %tempdir%/#{rubyexe} -I %tempdir%/rubyrequired %tempdir%/app.rb %quotedparms%" + f.puts "c %tempdir%/bin/#{rubyexe} -I %tempdir%/lib %tempdir%/app/app.rb %quotedparms%" end - if rubyw - eeeexe = "eeew.exe" - else - eeeexe = "eee.exe" - end + eeeexe = "eee.exe" + eeeexe = "eeew.exe" if rubyw + appexe = "#{app}.exe" + appico = "#{app}.ico" - execute("./eee app.eee #{app}.exe #{eeeexe}") - - copy("#{app}.exe", oldlocation) + system(".\\eee app.eee #{appexe} #{eeeexe}") oldlocation do - system("reshacker -modify %s, %s, %s, icon,appicon," % [newlocation("#{app}.exe"), "#{app}.exe", "#{app}.ico"]) if File.file?("#{app}.ico") - end -end + File.copy(newlocation(appexe), appexe) + system("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,") if File.file?(appico) + end end diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/README rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/README 2004-06-27 20:07:57.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/README 2004-07-26 18:46:52.000000000 +0200 @@ -2,7 +2,7 @@ The latter is just for playing with the internals. Both are available on the site. -Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-msvcr71] + Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] For more information, see http://www.erikveen.dds.nl/rubyscript2exe/ . diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/require2lib.rb 2007-05-30 10:17:42.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/require2lib.rb 2004-07-26 19:15:21.000000000 +0200 @@ -0,0 +1,56 @@ +require "ftools" +require "rbconfig" + +module Require + JUSTEV = ARGV.include?("--require2lib-justev") + JUSTSITE = ARGV.include?("--require2lib-justsite") + + ARGV.delete_if do |arg| + arg =~ /^--require2lib-/ + end + + ORGDIR = Dir.pwd + THISFILE = File.expand_path(__FILE__) + LIBDIR = File.expand_path(ARGV.shift) + SITEDIR = Config::CONFIG["sitedir"] + + at_exit do + Dir.chdir(ORGDIR) + + Require.gatherlibs + end + + def self.gatherlibs + $stderr.puts "Gathering files..." + + File.makedirs(LIBDIR) + + $".each do |req| + if not JUSTEV or req =~ /^ev\// + catch :found do + $:.each do |lib| + fromfile = File.expand_path(req, lib) + tofile = File.expand_path(req, LIBDIR) + + if FileTest.file?(fromfile) + unless fromfile == tofile or fromfile == THISFILE + if JUSTSITE and fromfile.include?(SITEDIR) + $stderr.puts "Skipped #{fromfile} ." + else + #$stderr.puts "Found #{fromfile} ." + + File.makedirs(File.dirname(tofile)) + File.copy(fromfile, tofile) + end + end + + throw :found + end + end + + $stderr.puts "Can't find #{req} ." unless req =~ /^ev\// + end + end + end + end +end diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/require2tar.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/require2tar.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/require2tar.rb 2004-06-27 19:51:17.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/require2tar.rb 2007-05-30 10:17:42.000000000 +0200 @@ -1,92 +0,0 @@ -require "ftools" - -JustCopy = ARGV.include?("--require2tar-justcopy") -JustEV = ARGV.include?("--require2tar-justev") - -ARGV.delete_if do |arg| - arg =~ /^--require2tar-/ -end - -Require2TarDir = Dir.pwd - -at_exit do - Dir.chdir Require2TarDir - Require.createtar -end - -module Require - def self.createtar - temp = (ENV["TEMP"] or "/tmp") - tmpdir = File.expand_path("rubyrequired2tar.#{Process.pid}", temp) - tardir = "rubyrequired" - tarfile = "rubyrequired.tar" - todir = File.expand_path(tardir, tmpdir) - - File.makedirs(tmpdir) - - $".delete_if{|req| not req =~ /^ev\//} if JustEV - - $".each do |req| - found = false - - $:.each do |lib| - if not found - file = File.expand_path(req, lib) - if FileTest.file?(file) - found = true - fromfile = file - tofile = File.expand_path(req, todir) - tofile = req if JustCopy - - #puts "Found #{fromfile} ." - - File.makedirs(File.dirname(tofile)) - File.copy(fromfile, tofile) - end - end - end - - if not found - puts "Can't find #{req} ." if not req =~ /^ev\// - end - end - - if not JustCopy - File.copy("tar.exe", File.expand_path("tar.exe", tmpdir)) if FileTest.file?("tar.exe") - - pdir = Dir.pwd - Dir.chdir(tmpdir) - puts "Creating #{tarfile}..." - - system("tar chf #{tarfile} #{tardir}") - - s = File.expand_path(tarfile, pdir) - s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") - - File.move(tarfile, s) - Dir.chdir(pdir) - end - - File.rm_rf(tmpdir) - end -end - -class File - def self.rm_rf(entry) - if FileTest.file?(entry) - File.delete(entry) - end - - if FileTest.directory?(entry) - pdir = Dir.pwd - - Dir.chdir(entry) - Dir.new(".").each do |e| - rm_rf(e) if not [".", ".."].include?(e) - end - Dir.chdir(pdir) - - Dir.rmdir(entry) - end - end -end diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/tar2rubyscript.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/tar2rubyscript.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/tar2rubyscript.rb 2004-06-27 19:51:01.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/tar2rubyscript.rb 2007-05-30 10:17:42.000000000 +0200 @@ -1,81 +0,0 @@ -require "ev/oldandnewlocation" - -scriptfile = "tarrubyscript.rb" -tarfile = oldlocation(ARGV.shift) -rbfile = oldlocation(ARGV.shift) -licensefile = oldlocation(ARGV.shift) - -if tarfile.nil? - exit 1 -end - -tarfile.dup.gsub!(/[\/\\]$/, "") - -if not FileTest.exist?(tarfile) - $stderr.puts "#{tarfile} doesn't exist." - exit -end - -if not licensefile.nil? and not FileTest.file?(licensefile) - $stderr.puts "#{licensefile} doesn't exist." - exit -end - -script = nil -archive = nil - -File.open(scriptfile) {|f| script = f.read} - -if FileTest.file?(tarfile) - File.open(tarfile, "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} -end - -if FileTest.directory?(tarfile) - orgdir = Dir.pwd - - Dir.chdir(tarfile) - - if FileTest.file?("tar2rubyscript.bat") - $stderr.puts "\".\\tar2rubyscript.bat\"" - system(".\\tar2rubyscript.bat") - end - - if FileTest.file?("tar2rubyscript.sh") - $stderr.puts "\". ./tar2rubyscript.sh\"" - system("sh -c \". ./tar2rubyscript.sh\"") - end - - Dir.chdir("..") - - begin - tar = "tar" - IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} - rescue - tar = newlocation("tar.exe") - IO.popen("#{tar} ch #{tarfile.sub(/.*[\/\\]/, "")}", "rb") {|f| archive = [f.read].pack("m").split("\n").collect{|s| "# " + s}.join("\n")} - end - - Dir.chdir(orgdir) -end - -if not licensefile.nil? - lic = nil ; File.open(licensefile) {|f| lic = f.readlines} - - lic.collect! do |line| - line.gsub!(/[\r\n]/, "") - line = "# #{line}" unless line =~ /^[ \t]*#/ - line - end - - script = "# License, not of this script, but of the application it contains:\n#\n" + lic.join("\n") + "\n\n" + script -end - -rbfile = tarfile.gsub(/\.tar$/, "") + ".rb" if (rbfile.nil? or File.basename(rbfile) == "-") - -File.open(rbfile, "wb") do |f| - f.write script - f.write "\n" - f.write "\n" - f.write archive - f.write "\n" -end diff -ur rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/tarrubyscript.rb rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/tarrubyscript.rb --- rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/tarrubyscript.rb 2004-06-27 19:51:04.000000000 +0200 +++ rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/tarrubyscript.rb 2007-05-30 10:17:42.000000000 +0200 @@ -1,367 +0,0 @@ -# License of this script, not of the application it contains: -# -# Copyright Erik Veenstra <tar2rubyscript@erikveen.dds.nl> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA. - -# Tar2RubyScript constants - -JustExtract = ARGV.include?("--tar2rubyscript-justextract") -ToTar = ARGV.include?("--tar2rubyscript-totar") - -ARGV.concat [] - -ARGV.delete_if do |arg| - arg =~ /^--tar2rubyscript-/ -end - -# Tar constants - -BLOCKSIZE = 512 - -NAMELEN = 100 -MODELEN = 8 -UIDLEN = 8 -GIDLEN = 8 -CHKSUMLEN = 8 -SIZELEN = 12 -MAGICLEN = 8 -MODTIMELEN = 12 -UNAMELEN = 32 -GNAMELEN = 32 -DEVLEN = 8 - -TMAGIC = "ustar" -GNU_TMAGIC = "ustar " -SOLARIS_TMAGIC = "ustar\00000" - -MAGICS = [TMAGIC, GNU_TMAGIC, SOLARIS_TMAGIC] - -LF_OLDFILE = '\0' -LF_FILE = '0' -LF_LINK = '1' -LF_SYMLINK = '2' -LF_CHAR = '3' -LF_BLOCK = '4' -LF_DIR = '5' -LF_FIFO = '6' -LF_CONTIG = '7' - -class Reader - def initialize(filehandle) - @fp = filehandle - end - - def extract - each do |entry| - entry.extract - end - end - - def each - @fp.rewind - - while entry = next_entry - yield(entry) - end - end - - def next_entry - buf = @fp.read(BLOCKSIZE) - - if buf.length < BLOCKSIZE or buf == "\000" * BLOCKSIZE - entry = nil - else - entry = Entry.new(buf, @fp) - end - - entry - end -end - -class Entry - attr_reader(:header, :data) - - def initialize(header, fp) - @header = Header.new(header) - - if @header.file? - padding = (BLOCKSIZE - (@header.size % BLOCKSIZE)) % BLOCKSIZE - - @data = fp.read(@header.size) if @header.size > 0 - dummy = fp.read(padding) if padding > 0 - end - end - - def extract - if not @header.name.empty? - if @header.dir? - begin - Dir.mkdir(@header.name, @header.mode) - rescue SystemCallError => e - puts "Couldn't create dir #{@header.name}: " + e.message - end - else - if @header.file? - begin - File.open(@header.name, "wb") do |fp| - fp.write(@data) - fp.chmod(@header.mode) - end - rescue => e - puts "Couldn't create file #{@header.name}: " + e.message - end - else - puts "Couldn't handle entry #{@header.name}" - end - end - - #File.chown(@header.uid, @header.gid, @header.name) - #File.utime(Time.now, @header.mtime, @header.name) - end - end -end - -class Header - attr_reader(:name, :uid, :gid, :size, :mtime, :uname, :gname, :mode) - - def initialize(header) - fields = header.unpack('A100 A8 A8 A8 A12 A12 A8 A1 A100 A8 A32 A32 A8 A8') - types = ['str', 'oct', 'oct', 'oct', 'oct', 'time', 'oct', 'str', 'str', 'str', 'str', 'str', 'oct', 'oct'] - - begin - converted = [] - while field = fields.shift - type = types.shift - - case type - when 'str' then converted.push(field) - when 'oct' then converted.push(field.oct) - when 'time' then converted.push(Time::at(field.oct)) - end - end - - @name, @mode, @uid, @gid, @size, @mtime, @chksum, @linkflag, @linkname, @magic, @uname, @gname, @devmajor, @devminor = converted - - @name.gsub!(/^\.\//, "") - - @raw = header - rescue ArgumentError => e - raise "Couldn't determine a real value for a field (#{field})" - end - - raise "Magic header value #{@magic.inspect} is invalid." if not MAGICS.include?(@magic) - - @linkflag = LF_FILE if @linkflag == LF_OLDFILE or @linkflag == LF_CONTIG - @linkflag = LF_DIR if @name[-1] == '/' and @linkflag == LF_FILE - @linkname = @linkname[1,-1] if @linkname[0] == '/' - @size = 0 if @size < 0 - @name = @linkname + '/' + @name if @linkname.size > 0 - end - - def file? - @linkflag == LF_FILE - end - - def dir? - @linkflag == LF_DIR - end -end - -class TempSpace - def initialize - @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - @olddir = Dir.pwd - temp = ENV["TEMP"] - temp = "/tmp" if temp.nil? - @tempdir = "#{temp}/tar2rubyscript.d.#{Process.pid}" - @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" - - @@tempspace = self - - @newdir = @tempdir - end - - def extract - Dir.mkdir(@tempdir) if not FileTest.exists?(@tempdir) - - newlocation do - - # Create the temp environment. - - File.open(@tempfile, "wb") {|f| f.write @archive} - File.open(@tempfile, "rb") {|f| Reader.new(f).extract} - - # Eventually look for a subdirectory. - - entries = Dir.entries(".") - entries.delete(".") - entries.delete("..") - - if entries.length == 1 - entry = entries.shift.dup - if FileTest.directory?(entry) - @newdir = "#{@tempdir}/#{entry}" - end - end - end - - # Remember all File objects. - - @ioobjects = [] - ObjectSpace::each_object(File) do |obj| - @ioobjects << obj - end - - at_exit do - - # Close all File objects, opened in init.rb . - - ObjectSpace::each_object(File) do |obj| - obj.close if (not obj.closed? and not @ioobjects.include?(obj)) - end - - # Remove the temp environment. - - Dir.chdir(@olddir) - - recursivedelete(@tempfile) - recursivedelete(@tempdir) - end - end - - def recursivedelete(entry) - if FileTest.file?(entry) - File.delete(entry) - end - - if FileTest.directory?(entry) - pdir = Dir.pwd - - Dir.chdir(entry) - Dir.new(".").each do |e| - recursivedelete(e) if not [".", ".."].include?(e) - end - Dir.chdir(pdir) - - Dir.rmdir(entry) - end - end - - def oldlocation(file="") - if block_given? - pdir = Dir.pwd - - Dir.chdir(@olddir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, @olddir) if not file.nil? - end - - res - end - - def newlocation(file="") - if block_given? - pdir = Dir.pwd - - Dir.chdir(@newdir) - res = yield - Dir.chdir(pdir) - else - res = File.expand_path(file, @newdir) if not file.nil? - end - - res - end - - def self.oldlocation(file="") - if block_given? - @@tempspace.oldlocation { yield } - else - @@tempspace.oldlocation(file) - end - end - - def self.newlocation(file="") - if block_given? - @@tempspace.newlocation { yield } - else - @@tempspace.newlocation(file) - end - end -end - -class Extract - def initialize - @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - temp = ENV["TEMP"] - temp = "/tmp" if temp.nil? - @tempfile = "#{temp}/tar2rubyscript.f.#{Process.pid}" - end - - def extract - begin - File.open(@tempfile, "wb") {|f| f.write @archive} - File.open(@tempfile, "rb") {|f| Reader.new(f).extract} - ensure - File.delete(@tempfile) - end - end -end - -class MakeTar - def initialize - @archive = File.new($0, "rb").read.gsub(/\r/, "").split(/\n\n/)[-1].split("\n").collect{|s| s[2..-1]}.join("\n").unpack("m").shift - @tarfile = $0.gsub(/\.rbw?$/, "") + ".tar" - end - - def extract - File.open(@tarfile, "wb") {|f| f.write @archive} - end -end - -def oldlocation(file="") - if block_given? - TempSpace.oldlocation { yield } - else - TempSpace.oldlocation(file) - end -end - -def newlocation(file="") - if block_given? - TempSpace.newlocation { yield } - else - TempSpace.newlocation(file) - end -end - -if JustExtract - Extract.new.extract -else - if ToTar - MakeTar.new.extract - else - TempSpace.new.extract - - $0 = "./init.rb" - - newlocation do - load "init.rb" - end - end -end Binary files rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eeew.exe differ Binary files rubyscript2exe-0.1.18.tar.gz/rubyscript2exe/tar.exe and rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/tar.exe differ diff -ur rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/dependencies.rb 2007-05-30 10:17:44.000000000 +0200 +++ rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-07-30 17:39:46.000000000 +0200 @@ -0,0 +1,32 @@ +def dlls(file, notthedefaults=true) + + # Only the dependencies in the same directory as the executable. + + todo = [] + res = [] + + todo << File.expand_path(file) + + while todo.length > 0 + todo2 = todo + todo = [] + + todo2.each do |file| + File.open(file, "rb") do |f| + strings = f.read.scan(/[\w\-\.]+/) # Hack ??? + strings.delete_if{|s| s !~ /\.dll$/i} + + strings.each do |lib| + lib = File.expand_path(lib, File.dirname(file)) + + if not lib.nil? and File.file?(lib) and not res.include?(lib) + todo << lib + res << lib + end + end + end + end + end + + res +end diff -ur rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb 2004-07-26 18:48:26.000000000 +0200 +++ rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb 2004-07-29 16:31:46.000000000 +0200 @@ -1,7 +1,21 @@ require "ev/oldandnewlocation" +require "ev/dependencies" require "ftools" require "rbconfig" +def backslashes(s) + s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? + s +end + +def windows? + not (target_os.downcase =~ /32/).nil? # Hack ??? +end + +def target_os + Config::CONFIG["target_os"] or "" +end + script = ARGV.shift rubyw = false @@ -9,36 +23,38 @@ rubyw = false if ARGV.include?("--rubyscript2exe-ruby") rubyw = true if ARGV.include?("--rubyscript2exe-rubyw") -ARGV.delete_if do |arg| - arg =~ /^--rubyscript2exe-/ -end +ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} bindir = Config::CONFIG["bindir"] -libruby = Config::CONFIG["LIBRUBY_SO"] if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) libdir = File.expand_path("lib") - puts "Tracing #{app}..." + $stderr.puts "Tracing #{app}..." + + libs = $:.collect{|a| " -I " + a} oldlocation do - system("#{bindir}/ruby -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir}' #{ARGV.collect{|a| "'" + a + "'"}.join(" ")}".gsub(/^\.\//, "").gsub(/\//, "\\\\")) + system(backslashes("#{bindir}/ruby #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir}' ") + ARGV.collect{|a| "'" + a + "'"}.join(" ")) end - puts "Copying files..." + $stderr.puts "Copying files..." Dir.mkdir("bin") Dir.mkdir("app") File.copy("#{bindir}/ruby.exe" , "bin/ruby.exe" ) File.copy("#{bindir}/rubyw.exe" , "bin/rubyw.exe" ) - File.copy("#{bindir}/#{libruby}" , "bin/#{libruby}" ) - File.copy("#{bindir}/msvcr71.dll" , "bin/msvcr71.dll" ) if File.file?("#{bindir}/msvcr71.dll") File.copy("#{oldlocation(script)}" , "app/app.rb" ) - puts "Creating #{app}.exe..." + dlls("#{bindir}/ruby.exe").each do |dll| + file = File.basename(dll) + File.copy(dll, "bin/#{file}") unless file == "ruby.exe" + end + + $stderr.puts "Creating #{app}.exe..." File.open("app.eee", "w") do |f| f.puts "r bin" @@ -56,11 +72,11 @@ appexe = "#{app}.exe" appico = "#{app}.ico" - system(".\\eee app.eee #{appexe} #{eeeexe}") + system(backslashes("./eee app.eee #{appexe} #{eeeexe}")) oldlocation do File.copy(newlocation(appexe), appexe) - system("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,") if File.file?(appico) + system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) end end Binary files rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eee.pas 2004-07-26 16:46:37.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.pas 2004-08-04 23:02:04.000000000 +0200 @@ -357,7 +357,7 @@ end; -procedure pakuit_f(var infile: file; var outfile: file; tekst: string[255]; var h: header); +procedure pakuit_f(var infile: file; var outfile: file; tekst: string; var h: header); begin @@ -371,7 +371,7 @@ end; -procedure pakuit_d(var infile: file; var outfile: file; tekst: string[255]; var h: header); +procedure pakuit_d(var infile: file; var outfile: file; tekst: string; var h: header); begin @@ -384,7 +384,7 @@ end; -procedure pakuit_c(var infile: file; var outfile: file; tekst: string[255]; var h: header); +procedure pakuit_c(var infile: file; var outfile: file; tekst: string; var h: header); var c : string; @@ -417,7 +417,7 @@ end; -procedure pakuit_t(var infile: file; var outfile: file; tekst: string[255]; var h: header); +procedure pakuit_t(var infile: file; var outfile: file; tekst: string; var h: header); var c : string; diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-07-30 17:39:46.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-08-05 00:02:39.000000000 +0200 @@ -1,4 +1,4 @@ -def dlls(file, notthedefaults=true) +def dlls(file, path=File.dirname(file)) # Only the dependencies in the same directory as the executable. @@ -17,7 +17,7 @@ strings.delete_if{|s| s !~ /\.dll$/i} strings.each do |lib| - lib = File.expand_path(lib, File.dirname(file)) + lib = File.expand_path(lib, path) if not lib.nil? and File.file?(lib) and not res.include?(lib) todo << lib diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/ftools.rb 2007-05-30 10:17:45.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/ftools.rb 2004-08-05 00:02:39.000000000 +0200 @@ -0,0 +1,161 @@ +require "ftools" + +class Dir + def self.mkdirrec(dir) + pdir = File.dirname(dir) + + if not pdir.empty? and not File.directory?(pdir) + Dir.mkdirrec(pdir) + end + + Dir.mkdir(dir) rescue nil + end + + def self.copy(from, to) + if File.directory?(from) + pdir = Dir.pwd + todir = File.expand_path(to) + + mkdirrec(todir) + + Dir.chdir(from) + Dir.new(".").each do |e| + Dir.copy(e, todir+"/"+e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + else + todir = File.dirname(File.expand_path(to)) + + mkdirrec(todir) + + File.copy(from, to) + end + end + + def self.move(from, to) + Dir.copy(from, to) + Dir.rm_rf(from) + end + + def self.rm_rf(entry) + if File.ftype(entry) == "directory" + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + Dir.rm_rf(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.delete(entry) + else + File.delete(entry) + end + end + + def self.find(entry=nil, mask=nil) + entry = @dir if entry.nil? + + entry.gsub!(/[\/\\]*$/, "") unless entry.nil? + + res = [] + + if File.directory?(entry) + pdir = Dir.pwd + + res += ["%s/" % entry] if mask.nil? or entry =~ mask + + Dir.chdir(entry) + Dir.new(".").each do |e| + res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + end + Dir.chdir(pdir) + else + res += [entry] if mask.nil? or entry =~ mask + end + + res + end +end + +class File + def self.rollbackup(file, mode=nil) + backupfile = file + ".RB.BACKUP" + controlfile = file + ".RB.CONTROL" + + File.touch(file) unless File.file?(file) + + # Rollback + + if File.file?(backupfile) and File.file?(controlfile) + $stdout.puts "Restoring #{file}..." + + File.copy(backupfile, file) # Rollback from phase 3 + end + + # Reset + + File.delete(backupfile) if File.file?(backupfile) # Reset from phase 2 or 3 + File.delete(controlfile) if File.file?(controlfile) # Reset from phase 3 or 4 + + # Backup + + File.copy(file, backupfile) # Enter phase 2 + File.touch(controlfile) # Enter phase 3 + + # The real thing + + if block_given? + if mode.nil? + yield + else + File.open(file, mode) do |f| + yield(f) + end + end + end + + # Cleanup + + File.delete(backupfile) # Enter phase 4 + File.delete(controlfile) # Enter phase 5 + + # Return, like File.open + + if block_given? + return nil + else + return File.open(file, (mode or "r")) + end + end + + def self.touch(file) + File.open(file, "a"){|f|} + end + + def self.which(file) + res = nil + + if windows? + file = file.gsub(/\.exe$/i, "") + ".exe" + sep = ";" + else + sep = ":" + end + + catch :stop do + ENV["PATH"].split(/#{sep}/).reverse.each do |d| + if File.directory?(d) + Dir.new(d).each do |e| + if e.downcase == file.downcase + res = File.expand_path(e, d) + throw :stop + end + end + end + end + end + + res + end +end diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-07-30 17:39:46.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-08-05 00:02:39.000000000 +0200 @@ -1,5 +1,5 @@ -ENV["OLDDIR"] = Dir.pwd if not ENV.include?("OLDDIR") -ENV["NEWDIR"] = Dir.pwd if not ENV.include?("NEWDIR") +ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") +ENV["NEWDIR"] = File.dirname($0) unless ENV.include?("NEWDIR") begin oldlocation @@ -15,7 +15,7 @@ res = yield Dir.chdir(pdir) else - res = File.expand_path(file, dir) if not file.nil? + res = File.expand_path(file, dir) unless file.nil? end res @@ -36,7 +36,7 @@ res = yield Dir.chdir(pdir) else - res = File.expand_path(file, dir) if not file.nil? + res = File.expand_path(file, dir) unless file.nil? end res diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb 2004-07-29 16:31:46.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/init.rb 2004-08-05 00:02:02.000000000 +0200 @@ -1,6 +1,6 @@ require "ev/oldandnewlocation" require "ev/dependencies" -require "ftools" +require "ev/ftools" require "rbconfig" def backslashes(s) @@ -51,7 +51,14 @@ dlls("#{bindir}/ruby.exe").each do |dll| file = File.basename(dll) - File.copy(dll, "bin/#{file}") unless file == "ruby.exe" + File.copy(dll, "bin/#{file}") + end + + Dir.find(libdir, /\.so$/).each do |file| + dlls(file, bindir).each do |dll| + file = File.basename(dll) + File.copy(dll, "bin/#{file}") + end end $stderr.puts "Creating #{app}.exe..." @@ -75,7 +82,10 @@ system(backslashes("./eee app.eee #{appexe} #{eeeexe}")) oldlocation do - File.copy(newlocation(appexe), appexe) + from = newlocation(appexe) + to = oldlocation(appexe) + + File.copy(from, to) unless from == to system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) end diff -ur rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/require2lib.rb 2004-07-30 17:39:46.000000000 +0200 +++ rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/require2lib.rb 2004-08-05 00:02:39.000000000 +0200 @@ -32,7 +32,7 @@ fromfile = File.expand_path(req, lib) tofile = File.expand_path(req, LIBDIR) - if FileTest.file?(fromfile) + if File.file?(fromfile) unless fromfile == tofile or fromfile == THISFILE if JUSTSITE and fromfile.include?(SITEDIR) $stderr.puts "Skipped #{fromfile} ." Binary files rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.pas 2004-08-04 23:02:04.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.pas 2004-12-08 14:07:51.000000000 +0100 @@ -1,6 +1,8 @@ {$mode DELPHI} -{$R eee.res} +{$IFDEF WIN32} + {$R eee.res} +{$ENDIF} uses @@ -49,6 +51,48 @@ parms : string; quotedparms : string; justextract : boolean; + currentdir : string[255]; + + +procedure getdir2(drivenr: byte; var dir: string[255]); + +begin + + {$IFDEF LINUX} // Foutje indien bovenliggende dirs niet benaderbaar zijn. + if currentdir = '' then begin + if (paramcount > 3) then begin + currentdir := paramstr(4); + end + else begin + currentdir := getenv('PWD'); // PWD wordt alleen gezet als het parent process een shell is. + end; + end; + + dir := currentdir; + {$ELSE} + getdir(drivenr, dir); + {$ENDIF} + +end; + + +procedure chdir2(dir: string[255]); + +begin + + {$IFDEF LINUX} // Foutje indien bovenliggende dirs niet benaderbaar zijn. + if copy(dir, 1, 1) <> '/' then begin + dir := currentdir + '/' + dir; + end; + + currentdir := dir; + + chdir(dir); + {$ELSE} + chdir(dir); + {$ENDIF} + +end; procedure recursivedelete(var path: string[255]); @@ -61,8 +105,8 @@ begin - getdir(0, dir); - chdir(path); + getdir2(0, dir); + chdir2(path); findfirst('*.*', anyfile or directory, sr); while(doserror = 0) do begin @@ -90,7 +134,7 @@ end; findclose(sr); - chdir(dir); + chdir2(dir); {$I-} rmdir(path + slash); @@ -227,8 +271,8 @@ pakin_d(outfile, 'd', tekst, entry, t); - getdir(0, dir); - chdir(entry); + getdir2(0, dir); + chdir2(entry); findfirst('*.*', anyfile or directory, sr); while(doserror = 0) do begin @@ -248,7 +292,7 @@ end; findclose(sr); - chdir(dir); + chdir2(dir); end; @@ -305,7 +349,7 @@ assign(eeefile, paramstr(1)); reset(eeefile); - if (paramcount > 2) then begin + if (paramcount > 2) then begin assign(infile, paramstr(3)); t.exename := paramstr(3); end @@ -390,6 +434,7 @@ c : string; p : string; i : longint; + sr : searchrec; begin @@ -398,6 +443,16 @@ h := h; {$IFDEF LINUX} + findfirst(workdir + '/eee.sh', archive, sr); + if (doserror = 0) then begin + c := '/bin/sh'; + p := '-c "chmod +x ' + workdir + '/eee.sh"'; + executeprocess(c, p); + end; + {$ENDIF} + + {$IFDEF LINUX} + i := 0; c := getenv('SHELL'); p := '-c "' + tekst + '"'; {$ELSE} @@ -424,6 +479,7 @@ p : string; i : longint; dir : string[255]; + sr : searchrec; begin @@ -432,6 +488,16 @@ h := h; {$IFDEF LINUX} + findfirst(workdir + '/eee.sh', archive, sr); + if (doserror = 0) then begin + c := '/bin/sh'; + p := '-c "chmod +x ' + workdir + '/eee.sh"'; + executeprocess(c, p); + end; + {$ENDIF} + + {$IFDEF LINUX} + i := 0; c := getenv('SHELL'); p := '-c "' + tekst + '"'; {$ELSE} @@ -446,10 +512,10 @@ end; {$ENDIF} - getdir(0, dir); - chdir(workdir); + getdir2(0, dir); + chdir2(workdir); executeprocess(c, p); - chdir(dir); + chdir2(dir); end; @@ -460,8 +526,8 @@ randomize; - getdir(0, dir); - chdir(tempdir); + getdir2(0, dir); + chdir2(tempdir); {$I-} repeat str(random(1000), s); @@ -471,7 +537,7 @@ {$I+} workdir := tempdir + slash + workdir; - chdir(dir); + chdir2(dir); assign(infile, paramstr(0)); reset(infile, 1); @@ -582,7 +648,6 @@ tempdir := '/tmp' end; - me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; justextract := false; diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-08-05 00:02:39.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-12-08 14:07:51.000000000 +0100 @@ -1,6 +1,6 @@ def dlls(file, path=File.dirname(file)) - # Only the dependencies in the same directory as the executable. + # Only the dependencies in the same directory as the executable or the given directory. todo = [] res = [] @@ -30,3 +30,44 @@ res end + +def ldds(file, notthedefaults=true) + + # All dependencies. + + todo = [] + res = [] + tempfile = "/tmp/ev.dependencies.%d.tmp" % Process.pid + + todo << File.expand_path(file) + + while todo.length > 0 + todo2 = todo + todo = [] + + todo2.each do |file| + File.copy(file, tempfile) # Libraries on Debian are no executables. + File.chmod(0755, tempfile) + + `ldd #{tempfile}`.split(/\r*\n/).collect{|line| line.split(/\s+/)[3]}.each do |lib| + if not lib.nil? and File.file?(lib) and not res.include?(lib) + todo << lib + res << lib + end + end + + File.delete(tempfile) + end + end + + # http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/rlibraries.html + # http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/IA32/spec/rlibraries.html + + lsb_common = ["libX11.so.6", "libXt.so.6", "libGL.so.1", "libXext.so.6", "libICE.so.6", "libSM.so.6", "libdl.so.2", "libcrypt.so.1", "libz.so.1", "libncurses.so.5", "libutil.so.1", "libpthread.so.0", "libpam.so.0", "libgcc_s.so.1"] + lsb_ia32 = ["libm.so.6", "libdl.so.2", "libcrypt.so.1", "libc.so.6", "libpthread.so.0", "ld-lsb.so.1"] + lsb = lsb_common + lsb_ia32 + + res.delete_if{|s| lsb.include?(File.basename(s))} if notthedefaults + + res +end diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/ftools.rb 2004-08-05 00:02:39.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/ftools.rb 2004-12-08 14:07:51.000000000 +0100 @@ -54,9 +54,11 @@ end def self.find(entry=nil, mask=nil) - entry = @dir if entry.nil? + entry = "." if entry.nil? - entry.gsub!(/[\/\\]*$/, "") unless entry.nil? + entry = entry.gsub!(/[\/\\]*$/, "") unless entry.nil? + + mask = /^#{mask}$/i if mask.kind_of?(String) res = [] @@ -65,11 +67,19 @@ res += ["%s/" % entry] if mask.nil? or entry =~ mask - Dir.chdir(entry) - Dir.new(".").each do |e| - res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + begin + Dir.chdir(entry) + + begin + Dir.new(".").each do |e| + res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + end + ensure + Dir.chdir(pdir) end - Dir.chdir(pdir) + rescue Errno::EACCES => error + puts error + end else res += [entry] if mask.nil? or entry =~ mask end @@ -82,6 +92,7 @@ def self.rollbackup(file, mode=nil) backupfile = file + ".RB.BACKUP" controlfile = file + ".RB.CONTROL" + res = nil File.touch(file) unless File.file?(file) @@ -107,10 +118,10 @@ if block_given? if mode.nil? - yield + res = yield else File.open(file, mode) do |f| - yield(f) + res = yield(f) end end end @@ -122,11 +133,9 @@ # Return, like File.open - if block_given? - return nil - else - return File.open(file, (mode or "r")) - end + res = File.open(file, (mode or "r")) unless block_given? + + res end def self.touch(file) diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-08-05 00:02:39.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2004-12-08 14:07:51.000000000 +0100 @@ -1,5 +1,27 @@ +temp = (ENV["TMPDIR"] or ENV["TMP"] or ENV["TEMP"] or "/tmp").gsub(/\\/, "/") +dir = "#{temp}/oldandnewlocation.#{Process.pid}" + ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") ENV["NEWDIR"] = File.dirname($0) unless ENV.include?("NEWDIR") +ENV["TEMPDIR"] = dir unless ENV.include?("TEMPDIR") + +class Dir + def self.rm_rf(entry) + if File.ftype(entry) == "directory" + pdir = Dir.pwd + + Dir.chdir(entry) + Dir.new(".").each do |e| + Dir.rm_rf(e) if not [".", ".."].include?(e) + end + Dir.chdir(pdir) + + Dir.delete(entry) + else + File.delete(entry) + end + end +end begin oldlocation @@ -42,3 +64,37 @@ res end end + +begin + tmplocation +rescue NameError + dir = ENV["TEMPDIR"] + + Dir.rm_rf(dir) if File.directory?(dir) + Dir.mkdir(dir) + + at_exit do + if File.directory?(dir) + Dir.chdir(dir) + Dir.chdir("..") + Dir.rm_rf(dir) + end + end + + def tmplocation(file="") + dir = ENV["TEMPDIR"] + res = nil + + if block_given? + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) unless file.nil? + end + + res + end +end diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/init.rb 2004-08-05 00:02:02.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/init.rb 2004-12-08 13:48:37.000000000 +0100 @@ -3,13 +3,27 @@ require "ev/ftools" require "rbconfig" +exit if ARGV.include?("--rubyscript2exe-exit") + def backslashes(s) s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? s end +def linux? + not windows? and not cygwin? # Hack ??? +end + +def linux? + not windows? and not cygwin? # Hack ??? +end + def windows? - not (target_os.downcase =~ /32/).nil? # Hack ??? + not (target_os.downcase =~ /32/).nil? # Hack ??? +end + +def cygwin? + not (target_os.downcase =~ /cyg/).nil? # Hack ??? end def target_os @@ -18,6 +32,20 @@ script = ARGV.shift +if script.nil? + $stderr.puts <<-EOF + + Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] + + On Linux, there's no difference between ruby and rubyw. + + For more information, see + http://www.erikveen.dds.nl/rubyscript2exe/index.html . + EOF + + exit 1 +end + rubyw = false rubyw = true if script =~ /\.rbw$/ rubyw = false if ARGV.include?("--rubyscript2exe-ruby") @@ -25,68 +53,129 @@ ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} -bindir = Config::CONFIG["bindir"] +bindir1 = Config::CONFIG["bindir"] +libdir1 = Config::CONFIG["libdir"] +bindir2 = tmplocation("bin/") +libdir2 = tmplocation("lib/") +appdir2 = tmplocation("app/") -if not script.nil? - script = "#{script}.rb" if not script =~ /\.rbw?$/ - app = File.basename(script.gsub(/\.rbw?$/, "")) - libdir = File.expand_path("lib") +script = "#{script}.rb" unless script =~ /\.rbw?$/ +app = File.basename(script.gsub(/\.rbw?$/, "")) - $stderr.puts "Tracing #{app}..." +$stderr.puts "Tracing #{app}..." - libs = $:.collect{|a| " -I " + a} +libs = $:.collect{|a| " -I " + a} - oldlocation do - system(backslashes("#{bindir}/ruby #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir}' ") + ARGV.collect{|a| "'" + a + "'"}.join(" ")) - end +oldlocation do + system(backslashes("#{bindir1}/ruby #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir2}' ") + ARGV.collect{|a| "'" + a + "'"}.join(" ")) +end - $stderr.puts "Copying files..." +$stderr.puts "Copying files..." - Dir.mkdir("bin") - Dir.mkdir("app") +Dir.mkdir(bindir2) unless File.directory?(bindir2) +Dir.mkdir(libdir2) unless File.directory?(libdir2) +Dir.mkdir(appdir2) unless File.directory?(appdir2) + +if linux? + rubyexe = "#{bindir1}/ruby" +else + rubyexe = "#{bindir1}/ruby.exe" + rubywexe = "#{bindir1}/rubyw.exe" +end - File.copy("#{bindir}/ruby.exe" , "bin/ruby.exe" ) - File.copy("#{bindir}/rubyw.exe" , "bin/rubyw.exe" ) - File.copy("#{oldlocation(script)}" , "app/app.rb" ) - - dlls("#{bindir}/ruby.exe").each do |dll| - file = File.basename(dll) - File.copy(dll, "bin/#{file}") - end +if linux? + tocopy = ldds(rubyexe) + tocopy << rubyexe if File.file?(rubyexe) +else + tocopy = dlls(rubyexe) + tocopy << rubyexe if File.file?(rubyexe) + tocopy << rubywexe if File.file?(rubywexe) +end - Dir.find(libdir, /\.so$/).each do |file| - dlls(file, bindir).each do |dll| - file = File.basename(dll) - File.copy(dll, "bin/#{file}") - end - end +tocopy.each do |s1| + file = File.basename(s1) + s2 = File.expand_path(file, bindir2) + + $stderr.puts "Copying #{s1} ..." + File.copy(s1, s2) unless File.file?(s2) +end + +begin + s1 = oldlocation(script) + s2 = File.expand_path("app.rb", appdir2) + + $stderr.puts "Copying #{s1} ..." + File.copy(s1, s2) unless File.file?(s2) +end + +if linux? + tocopy = Dir.find(libdir2, /\.so$/).collect{|file| ldds(file)}.flatten.sort.uniq +else + tocopy = Dir.find(libdir2, /\.so$/).collect{|file| dlls(file, bindir1)}.flatten.sort.uniq +end - $stderr.puts "Creating #{app}.exe..." +tocopy.each do |s1| + file = File.basename(s1) + s2 = File.expand_path(file, bindir2) - File.open("app.eee", "w") do |f| - f.puts "r bin" - f.puts "r lib" - f.puts "r app" + $stderr.puts "Copying #{s1} ..." + File.copy(s1, s2) unless File.file?(s2) +end - rubyexe = "ruby.exe" - rubyexe = "rubyw.exe" if rubyw +eeeexe = "eee.exe" +eeeexe = "eeew.exe" if rubyw +eeeexe = "eee.bin" if linux? +appexe = "#{app}.exe" +appexe = "#{app}.bin" if linux? +appico = "#{app}.ico" + +$stderr.puts "Creating #{appexe} ..." + +if linux? + File.open(tmplocation("eee.sh"), "w") do |f| + f.puts "PDIR=$1;shift" + f.puts "DIR=$(pwd)" + f.puts "cd $PDIR" + f.puts " chmod +x bin/ruby" + f.puts " export PATH=$(pwd)/bin:$PATH" + f.puts " export LD_LIBRARY_PATH=$(pwd)/bin:LD_LIBRARY_PATH" + f.puts "cd $DIR" + f.puts "$*" + end +end +File.open(tmplocation("app.eee"), "w") do |f| + rubyexe = "ruby.exe" + rubyexe = "rubyw.exe" if rubyw + rubyexe = "ruby" if linux? + + f.puts "r bin" + f.puts "r lib" + f.puts "f eee.sh" if linux? + f.puts "r app" + if linux? + f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -I %tempdir%/lib %tempdir%/app/app.rb %quotedparms%" + else f.puts "c %tempdir%/bin/#{rubyexe} -I %tempdir%/lib %tempdir%/app/app.rb %quotedparms%" end +end + +from = newlocation(eeeexe) +to = tmplocation(eeeexe) - eeeexe = "eee.exe" - eeeexe = "eeew.exe" if rubyw - appexe = "#{app}.exe" - appico = "#{app}.ico" +File.copy(from, to) unless from == to +File.chmod(0755, to) if linux? - system(backslashes("./eee app.eee #{appexe} #{eeeexe}")) +tmplocation do + system(backslashes("#{(linux? or cygwin?) ? "./" : ""}#{eeeexe} app.eee #{appexe} #{eeeexe} #{Dir.pwd}")) +end - oldlocation do - from = newlocation(appexe) - to = oldlocation(appexe) +from = tmplocation(appexe) +to = oldlocation(appexe) - File.copy(from, to) unless from == to +File.copy(from, to) unless from == to +File.chmod(0755, to) if linux? - system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) - end +oldlocation do + system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) end diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/README rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/README 2004-07-26 18:46:52.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/README 2004-12-04 00:13:27.000000000 +0100 @@ -4,5 +4,7 @@ Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] +On Linux, there's no difference between ruby and rubyw. + For more information, see -http://www.erikveen.dds.nl/rubyscript2exe/ . +http://www.erikveen.dds.nl/rubyscript2exe/index.html . diff -ur rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/require2lib.rb 2004-08-05 00:02:39.000000000 +0200 +++ rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/require2lib.rb 2004-12-08 14:07:51.000000000 +0100 @@ -1,9 +1,21 @@ require "ftools" require "rbconfig" +$require2lib_loaded = [] + +module Kernel + alias :old_load :load + def load(filename, wrap=false) + $require2lib_loaded << filename unless $require2lib_loaded.include?(filename) + + old_load(filename, wrap) + end +end + module Require JUSTEV = ARGV.include?("--require2lib-justev") JUSTSITE = ARGV.include?("--require2lib-justsite") + VERBOSE = ARGV.include?("--require2lib-verbose") ARGV.delete_if do |arg| arg =~ /^--require2lib-/ @@ -25,7 +37,7 @@ File.makedirs(LIBDIR) - $".each do |req| + ($" + $require2lib_loaded).each do |req| if not JUSTEV or req =~ /^ev\// catch :found do $:.each do |lib| @@ -34,10 +46,10 @@ if File.file?(fromfile) unless fromfile == tofile or fromfile == THISFILE - if JUSTSITE and fromfile.include?(SITEDIR) - $stderr.puts "Skipped #{fromfile} ." + if JUSTSITE and not fromfile.include?(SITEDIR) + $stderr.puts "Skipped #{fromfile} ." if VERBOSE else - #$stderr.puts "Found #{fromfile} ." + $stderr.puts "Found #{fromfile} ." if VERBOSE File.makedirs(File.dirname(tofile)) File.copy(fromfile, tofile) Binary files rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.bin and rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.bin differ Binary files rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.21.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.pas 2004-12-08 14:07:51.000000000 +0100 +++ rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.pas 2004-12-18 18:02:07.000000000 +0100 @@ -51,6 +51,7 @@ parms : string; quotedparms : string; justextract : boolean; + list : boolean; currentdir : string[255]; @@ -595,7 +596,7 @@ begin - assign(infile, paramstr(0)); + assign(infile, paramstr(0)); reset(infile, 1); assign(outfile, t.exename); @@ -641,6 +642,39 @@ end; +procedure tooninhoud; + +begin + + assign(infile, paramstr(0)); + reset(infile, 1); + + blockeat(infile, filesize(infile)-t.length); + + try + + for teller := 1 to t.number do begin + blockread(infile, h, sizeof(h)); + + if (h.klasse = 'f') then begin + writeln(h.klasse, ' ', h.tekst, ' (', h.length, ')'); + blockeat(infile, h.length); + end + else begin + writeln(h.klasse, ' ', h.tekst); + end; + + end; + + finally + + close(infile); + + end; + +end; + + begin tempdir := getenv('TEMP'); @@ -651,6 +685,7 @@ me := 'EEE: Dit is mijn herkennigsstring voor het herkennen van pakin of pakuit mode.'; justextract := false; + list := false; parms := ''; quotedparms := ''; @@ -659,6 +694,10 @@ justextract := true; end; + if (paramstr(teller) = '--eee-list') then begin + list := true; + end; + if ((parms = '') and (quotedparms = '')) then begin parms := paramstr(teller); quotedparms := '''' + paramstr(teller) + ''''; @@ -685,7 +724,12 @@ pakhieruit; end else begin - pakuit; + if (list) then begin + tooninhoud; + end + else begin + pakuit; + end; end; end; diff -ur rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/require2lib.rb 2004-12-08 14:07:51.000000000 +0100 +++ rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/require2lib.rb 2004-12-18 18:02:07.000000000 +0100 @@ -14,7 +14,8 @@ module Require JUSTEV = ARGV.include?("--require2lib-justev") - JUSTSITE = ARGV.include?("--require2lib-justsite") + JUSTRUBYLIB = ARGV.include?("--require2lib-justrubylib") + JUSTSITELIB = ARGV.include?("--require2lib-justsitelib") VERBOSE = ARGV.include?("--require2lib-verbose") ARGV.delete_if do |arg| @@ -24,7 +25,8 @@ ORGDIR = Dir.pwd THISFILE = File.expand_path(__FILE__) LIBDIR = File.expand_path(ARGV.shift) - SITEDIR = Config::CONFIG["sitedir"] + RUBYLIBDIR = Config::CONFIG["rubylibdir"] + SITELIBDIR = Config::CONFIG["sitelibdir"] at_exit do Dir.chdir(ORGDIR) @@ -39,30 +41,73 @@ ($" + $require2lib_loaded).each do |req| if not JUSTEV or req =~ /^ev\// - catch :found do - $:.each do |lib| - fromfile = File.expand_path(req, lib) - tofile = File.expand_path(req, LIBDIR) - - if File.file?(fromfile) - unless fromfile == tofile or fromfile == THISFILE - if JUSTSITE and not fromfile.include?(SITEDIR) - $stderr.puts "Skipped #{fromfile} ." if VERBOSE - else + unless req =~ /^rubygems[\.\/]/ + catch :found do + $:.each do |lib| + fromfile = File.expand_path(req, lib) + tofile = File.expand_path(req, LIBDIR) + + if File.file?(fromfile) + unless fromfile == tofile or fromfile == THISFILE + if (not JUSTRUBYLIB and not JUSTSITELIB) or + (JUSTRUBYLIB and fromfile.include?(RUBYLIBDIR)) or + (JUSTSITELIB and fromfile.include?(SITELIBDIR)) + $stderr.puts "Found #{fromfile} ." if VERBOSE + + File.makedirs(File.dirname(tofile)) + File.copy(fromfile, tofile) + else + $stderr.puts "Skipped #{fromfile} ." if VERBOSE + end + end + + throw :found + end + end + + $stderr.puts "Can't find #{req} ." unless req =~ /^ev\// + end + end + end + end + + if $".include?("rubygems.rb") or $".include?("rubygems.so") + autorequire = {} + + Gem::Specification.list.each do |gem| + + unless gem.autorequire.nil? + unless $".collect{|s| (s =~ /^#{gem.autorequire}\.\w+$/)}.compact.empty? + autorequire[gem.name] = gem.autorequire + + gem.require_paths.flatten.each do |lib| + lib = File.expand_path(lib, gem.full_gem_path) + + gem.files.each do |file| + fromfile = File.expand_path(file, gem.full_gem_path) + tofile = File.expand_path(file, File.dirname(LIBDIR)) + + if fromfile.include?(lib) and File.file?(fromfile) $stderr.puts "Found #{fromfile} ." if VERBOSE File.makedirs(File.dirname(tofile)) File.copy(fromfile, tofile) end end - - throw :found end end - - $stderr.puts "Can't find #{req} ." unless req =~ /^ev\// end end + + File.open(File.expand_path("rubygems.rb", LIBDIR), "w") do |f| + f.puts "module Kernel" + f.puts " def require_gem(file, version=nil)" + f.puts " autorequire = %s" % autorequire.inspect + f.puts " file = autorequire[file] if autorequire.include?(file)" + f.puts " require(file)" + f.puts " end" + f.puts "end" + end end end end Binary files rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.bin and rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.bin differ Binary files rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.2.0.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.pas 2004-12-18 18:02:07.000000000 +0100 +++ rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eee.pas 2004-12-27 13:17:55.000000000 +0100 @@ -6,14 +6,14 @@ uses - SysUtils, Dos; + SysUtils, Dos, GZio; const - {$IFDEF LINUX} - slash = '/'; - {$ELSE} + {$IFDEF WIN32} slash = '\'; + {$ELSE} + slash = '/'; {$ENDIF} type @@ -21,23 +21,28 @@ header = record klasse : string[1]; tekst : string[255]; - length : longint; + datalength : longint; end; tail = record - length : longint; - number : longint; - who : string[255]; exename : string[255]; + gzlength : longint; + who : string[255]; + number : longint; end; var tempdir : string[255]; workdir : string[255]; + workdir1 : string[255]; + workdir2 : string[255]; + workfile : string[255]; + exename : string[255]; me : string[255]; infile : file of byte; outfile : file of byte; + zfile : gzFile; eeefile : Text; klasse : string[1]; tekst1 : string[255]; @@ -52,26 +57,27 @@ quotedparms : string; justextract : boolean; list : boolean; - currentdir : string[255]; + {$IFDEF WIN32} + {$ELSE} + currentdir : string[255]; + {$ENDIF} procedure getdir2(drivenr: byte; var dir: string[255]); begin - {$IFDEF LINUX} // Foutje indien bovenliggende dirs niet benaderbaar zijn. - if currentdir = '' then begin - if (paramcount > 3) then begin - currentdir := paramstr(4); - end - else begin - currentdir := getenv('PWD'); // PWD wordt alleen gezet als het parent process een shell is. + {$IFDEF WIN32} + getdir(drivenr, dir); + {$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn. + if (currentdir = '') then begin + currentdir := getenv('EEEDIR'); + if (currentdir = '') then begin + currentdir := getenv('PWD'); end; end; dir := currentdir; - {$ELSE} - getdir(drivenr, dir); {$ENDIF} end; @@ -81,7 +87,9 @@ begin - {$IFDEF LINUX} // Foutje indien bovenliggende dirs niet benaderbaar zijn. + {$IFDEF WIN32} + chdir(dir); + {$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn. if copy(dir, 1, 1) <> '/' then begin dir := currentdir + '/' + dir; end; @@ -89,8 +97,6 @@ currentdir := dir; chdir(dir); - {$ELSE} - chdir(dir); {$ENDIF} end; @@ -147,21 +153,53 @@ end; -procedure bufferxor(var b: array of byte); +procedure blockeat(var infile: file; inlength: longint); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + +begin + + c := inlength div sizeof(b); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b) + else l := sizeof(b); + + blockread(infile, b, l); + + dec(c); + end; + +end; + + +procedure blockeatfromgz(var zfile: gzFile; inlength: longint); var - i : longint; + b : array[0..99999] of byte; + l : longint; + c : longint; begin - for i := 0 to sizeof(b)-1 do begin - b[i] := 123 xor b[i]; + c := inlength div sizeof(b); + + while (c >= 0) do begin + if (c = 0) then l := inlength-(inlength div sizeof(b))*sizeof(b) + else l := sizeof(b); + + gzread(zfile, addr(b), l); + + dec(c); end; end; -procedure blockeat(var infile: file; inlength: longint); +procedure blockcopy(var infile: file; var outfile: file; inlength: longint); var b : array[0..99999] of byte; @@ -178,6 +216,7 @@ else l := sizeof(b); blockread(infile, b, l, n); + blockwrite(outfile, b, n); dec(c); end; @@ -185,7 +224,7 @@ end; -procedure blockcopy(var infile: file; var outfile: file; inlength: longint; encrypt: boolean); +procedure blockcopytogz(var infile: file; var zfile: gzFile; inlength: longint); var b : array[0..99999] of byte; @@ -202,9 +241,31 @@ else l := sizeof(b); blockread(infile, b, l, n); - if (encrypt) then begin - bufferxor(b); - end; + gzwrite(zfile, addr(b), n); + + dec(c); + end; + +end; + + +procedure blockcopyfromgz(var zfile: gzFile; var outfile: file; inlength: longint); + +var + b : array[0..99999] of byte; + l : longint; + c : longint; + n : longint; + +begin + + c := inlength div sizeof(b); + + while (c >= 0) do begin + 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); dec(c); @@ -213,7 +274,7 @@ end; -procedure pakin_f(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); +procedure pakin_f(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); var infile : file of byte; @@ -226,10 +287,9 @@ assign(infile, entry); reset(infile, 1); - h.length := filesize(infile); - t.length := t.length + h.length + sizeof(h); - blockwrite(outfile, h, sizeof(h)); - blockcopy(infile, outfile, h.length, true); + h.datalength := filesize(infile); + gzwrite(zfile, addr(h), sizeof(h)); + blockcopytogz(infile, zfile, h.datalength); close(infile); t.number := t.number + 1; @@ -237,7 +297,7 @@ end; -procedure pakin_d(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); +procedure pakin_d(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); var h : header; @@ -248,17 +308,16 @@ h.klasse := klasse; h.tekst := tekst; - h.length := 0; - t.length := t.length + sizeof(h); + h.datalength := 0; - blockwrite(outfile, h, sizeof(h)); + gzwrite(zfile, addr(h), sizeof(h)); t.number := t.number + 1; end; -procedure pakin_r(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); +procedure pakin_r(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); var f : file; @@ -270,7 +329,7 @@ klasse := klasse; - pakin_d(outfile, 'd', tekst, entry, t); + pakin_d(zfile, 'd', tekst, entry, t); getdir2(0, dir); chdir2(entry); @@ -282,11 +341,11 @@ if (attr and directory > 0) then begin if ((not (sr.name = '.')) and (not (sr.name = '..'))) then begin - pakin_r(outfile, 'r', tekst + slash + sr.name, sr.name, t); + pakin_r(zfile, 'r', tekst + slash + sr.name, sr.name, t); end; end else begin - pakin_f(outfile, 'f', tekst + slash + sr.name, sr.name, t); + pakin_f(zfile, 'f', tekst + slash + sr.name, sr.name, t); end; findnext(sr); @@ -298,7 +357,7 @@ end; -procedure pakin_c(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); +procedure pakin_c(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); var h : header; @@ -309,17 +368,16 @@ h.klasse := klasse; h.tekst := tekst; - h.length := 0; - t.length := t.length + sizeof(h); + h.datalength := 0; - blockwrite(outfile, h, sizeof(h)); + gzwrite(zfile, addr(h), sizeof(h)); t.number := t.number + 1; end; -procedure pakin_t(var outfile: file; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); +procedure pakin_t(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); var h : header; @@ -330,10 +388,9 @@ h.klasse := klasse; h.tekst := tekst; - h.length := 0; - t.length := t.length + sizeof(h); + h.datalength := 0; - blockwrite(outfile, h, sizeof(h)); + gzwrite(zfile, addr(h), sizeof(h)); t.number := t.number + 1; @@ -344,28 +401,17 @@ begin - assign(outfile, paramstr(2)); - rewrite(outfile, 1); - assign(eeefile, paramstr(1)); reset(eeefile); - if (paramcount > 2) then begin - assign(infile, paramstr(3)); - t.exename := paramstr(3); - end - else begin - assign(infile, paramstr(0)); - t.exename := paramstr(0); + exename := getenv('EEEEXE'); + if (exename = '') then begin + exename := paramstr(0); end; - reset(infile, 1); - blockcopy(infile, outfile, filesize(infile), false); - close(infile); - - t.length := 0; + t.exename := exename; t.number := 0; - t.who := me; + t.who := me; s := slash; i := pos(s, t.exename); @@ -374,6 +420,8 @@ i := pos(s, t.exename); end; + zfile := gzopen(workfile, 'w'); + repeat readln(eeefile, s); @@ -382,45 +430,59 @@ tekst1 := copy(s, 3, length(s)-2); case klasse[1] of - 'f': pakin_f(outfile, klasse, tekst1, tekst1, t); - 'd': pakin_d(outfile, klasse, tekst1, tekst1, t); - 'r': pakin_r(outfile, klasse, tekst1, tekst1, t); - 'c': pakin_c(outfile, klasse, tekst1, tekst1, t); - 't': pakin_t(outfile, klasse, tekst1, tekst1, t); + 'f': pakin_f(zfile, klasse, tekst1, tekst1, t); + 'd': pakin_d(zfile, klasse, tekst1, tekst1, t); + 'r': pakin_r(zfile, klasse, tekst1, tekst1, t); + 'c': pakin_c(zfile, klasse, tekst1, tekst1, t); + 't': pakin_t(zfile, klasse, tekst1, tekst1, t); end; end; until eof(eeefile); - t.length := t.length + sizeof(t); - - blockwrite(outfile, t, sizeof(t)); + gzclose(zfile); close(eeefile); + assign(outfile, paramstr(2)); + rewrite(outfile, 1); + + assign(infile, exename); + reset(infile, 1); + blockcopy(infile, outfile, filesize(infile)); + close(infile); + + assign(infile, workfile); + reset(infile, 1); + blockcopy(infile, outfile, filesize(infile)); + t.gzlength := filesize(infile); + close(infile); + + blockwrite(outfile, t, sizeof(t)); + close(outfile); end; -procedure pakuit_f(var infile: file; var outfile: file; tekst: string; var h: header); +procedure pakuit_f(var zfile: gzFile; var outfile: file; tekst: string; var h: header); begin assign(outfile, workdir + slash + tekst); rewrite(outfile, 1); - blockcopy(infile, outfile, h.length, true); + blockcopyfromgz(zfile, outfile, h.datalength); close(outfile); end; -procedure pakuit_d(var infile: file; var outfile: file; tekst: string; var h: header); +procedure pakuit_d(var zfile: gzFile; var outfile: file; tekst: string; var h: header); begin - infile := infile; + zfile := zfile; outfile := outfile; h := h; @@ -429,21 +491,25 @@ end; -procedure pakuit_c(var infile: file; var outfile: file; tekst: string; var h: header); +procedure pakuit_c(var zfile: gzFile; var outfile: file; tekst: string; var h: header); var c : string; p : string; - i : longint; - sr : searchrec; + {$IFDEF WIN32} + i : longint; + {$ELSE} + sr : searchrec; + {$ENDIF} begin - infile := infile; + zfile := zfile; outfile := outfile; h := h; - {$IFDEF LINUX} + {$IFDEF WIN32} + {$ELSE} findfirst(workdir + '/eee.sh', archive, sr); if (doserror = 0) then begin c := '/bin/sh'; @@ -452,11 +518,7 @@ end; {$ENDIF} - {$IFDEF LINUX} - i := 0; - c := getenv('SHELL'); - p := '-c "' + tekst + '"'; - {$ELSE} + {$IFDEF WIN32} i := pos(' ', tekst); if (i = 0) then begin c := tekst; @@ -466,6 +528,10 @@ c := copy(tekst, 1, i-1); p := copy(tekst, i+1, length(tekst)-i); end; + {$ELSE} + i := 0; + c := getenv('SHELL'); + p := '-c "' + tekst + '"'; {$ENDIF} executeprocess(c, p); @@ -473,22 +539,26 @@ end; -procedure pakuit_t(var infile: file; var outfile: file; tekst: string; var h: header); +procedure pakuit_t(var zfile: gzFile; var outfile: file; tekst: string; var h: header); var c : string; p : string; - i : longint; dir : string[255]; - sr : searchrec; + {$IFDEF WIN32} + i : longint; + {$ELSE} + sr : searchrec; + {$ENDIF} begin - infile := infile; + zfile := zfile; outfile := outfile; h := h; - {$IFDEF LINUX} + {$IFDEF WIN32} + {$ELSE} findfirst(workdir + '/eee.sh', archive, sr); if (doserror = 0) then begin c := '/bin/sh'; @@ -497,11 +567,7 @@ end; {$ENDIF} - {$IFDEF LINUX} - i := 0; - c := getenv('SHELL'); - p := '-c "' + tekst + '"'; - {$ELSE} + {$IFDEF WIN32} i := pos(' ', tekst); if (i = 0) then begin c := tekst; @@ -511,6 +577,9 @@ c := copy(tekst, 1, i-1); p := copy(tekst, i+1, length(tekst)-i); end; + {$ELSE} + c := getenv('SHELL'); + p := '-c "' + tekst + '"'; {$ENDIF} getdir2(0, dir); @@ -525,70 +594,71 @@ begin - randomize; + assign(infile, paramstr(0)); + reset(infile, 1); - getdir2(0, dir); - chdir2(tempdir); - {$I-} - repeat - str(random(1000), s); - workdir := 'eee.' + s; - mkdir(workdir); - until (ioresult = 0); - {$I+} + blockeat(infile, filesize(infile)-t.gzlength-sizeof(t)); - workdir := tempdir + slash + workdir; - chdir2(dir); + assign(outfile, workfile); + rewrite(outfile, 1); + blockcopy(infile, outfile, t.gzlength); + close(outfile); - assign(infile, paramstr(0)); - reset(infile, 1); - blockeat(infile, filesize(infile)-t.length); + close(infile); - try + zfile := gzopen(workfile, 'r'); - for teller := 1 to t.number do begin - blockread(infile, h, sizeof(h)); + for teller := 1 to t.number do begin + gzread(zfile, addr(h), sizeof(h)); - klasse := h.klasse; - tekst2 := h.tekst; + klasse := h.klasse; + tekst2 := h.tekst; - s := '%tempdir%'; + s := '%tempdir%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; + end; - s := '%parms%'; + s := '%tempdir1%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + workdir1 + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; + end; - s := '%quotedparms%'; + s := '%tempdir2%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + workdir2 + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - - case klasse[1] of - 'f': pakuit_f(infile, outfile, tekst2, h); - 'd': pakuit_d(infile, outfile, tekst2, h); - 'c': pakuit_c(infile, outfile, tekst2, h); - 't': pakuit_t(infile, outfile, tekst2, h); - end; end; - finally - - close(infile); + s := '%parms%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; - recursivedelete(workdir); + s := '%quotedparms%'; + i := pos(s, tekst2); + while (i > 0) do begin + tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); + i := pos(s, tekst2); + end; + case klasse[1] of + 'f': pakuit_f(zfile, outfile, tekst2, h); + 'd': pakuit_d(zfile, outfile, tekst2, h); + 'c': pakuit_c(zfile, outfile, tekst2, h); + 't': pakuit_t(zfile, outfile, tekst2, h); + end; end; + gzclose(zfile); + end; @@ -601,44 +671,48 @@ assign(outfile, t.exename); rewrite(outfile); - blockcopy(infile, outfile, filesize(infile)-t.length, false); + blockcopy(infile, outfile, filesize(infile)-t.gzlength-sizeof(t)); close(outfile); - assign(eeefile, 'app.eee'); - rewrite(eeefile); - - try - for teller := 1 to t.number do begin - blockread(infile, h, sizeof(h)); + assign(outfile, workfile); + rewrite(outfile, 1); + blockcopy(infile, outfile, t.gzlength); + close(outfile); - writeln(eeefile, h.klasse, ' ', h.tekst); + close(infile); - if (h.klasse = 'f') then begin - assign(outfile, h.tekst); - rewrite(outfile, 1); + zfile := gzopen(workfile, 'r'); - blockcopy(infile, outfile, h.length, true); + assign(eeefile, 'app.eee'); + rewrite(eeefile); - close(outfile); - end; + for teller := 1 to t.number do begin + gzread(zfile, addr(h), sizeof(h)); - if (h.klasse = 'd') then begin - {$I-} - mkdir(h.tekst); - if (ioresult = 0) then; - {$I+} - end; - end; + writeln(eeefile, h.klasse, ' ', h.tekst); - finally + if (h.klasse = 'f') then begin + assign(outfile, h.tekst); + rewrite(outfile, 1); - close(eeefile); + blockcopyfromgz(zfile, outfile, h.datalength); - close(infile); + close(outfile); + end; + if (h.klasse = 'd') then begin + {$I-} + mkdir(h.tekst); + if (ioresult = 0) then; + {$I+} + end; end; + close(eeefile); + + gzclose(zfile); + end; @@ -649,29 +723,32 @@ assign(infile, paramstr(0)); reset(infile, 1); - blockeat(infile, filesize(infile)-t.length); - - try + blockeat(infile, filesize(infile)-t.gzlength-sizeof(t)); - for teller := 1 to t.number do begin - blockread(infile, h, sizeof(h)); + assign(outfile, workfile); + rewrite(outfile, 1); + blockcopy(infile, outfile, t.gzlength); + close(outfile); - if (h.klasse = 'f') then begin - writeln(h.klasse, ' ', h.tekst, ' (', h.length, ')'); - blockeat(infile, h.length); - end - else begin - writeln(h.klasse, ' ', h.tekst); - end; + close(infile); - end; + zfile := gzopen(workfile, 'r'); - finally + for teller := 1 to t.number do begin + gzread(zfile, addr(h), sizeof(h)); - close(infile); + if (h.klasse = 'f') then begin + writeln(h.klasse, ' ', h.tekst, ' (', h.datalength, ')'); + blockeatfromgz(zfile, h.datalength); + end + else begin + writeln(h.klasse, ' ', h.tekst); + end; end; + gzclose(zfile); + end; @@ -708,6 +785,39 @@ end; end; + randomize; + + getdir2(0, dir); + chdir2(tempdir); + {$I-} + repeat + str(random(1000), s); + workdir := 'eee.' + s; + mkdir(workdir); + until (ioresult = 0); + {$I+} + + workdir := tempdir + slash + workdir; + workfile := workdir + slash + 'eee.gz'; + + workdir1 := workdir; + workdir2 := workdir; + + s := '\'; + i := pos(s, workdir1); + while (i > 0) do begin + workdir1 := copy(workdir1, 1, i-1) + '/' + copy(workdir1, i+length(s), length(workdir1)-(i+length(s))+1); + i := pos(s, workdir1); + end; + + s := '/'; + i := pos(s, workdir2); + while (i > 0) do begin + workdir2 := copy(workdir2, 1, i-1) + '\' + copy(workdir2, i+length(s), length(workdir2)-(i+length(s))+1); + i := pos(s, workdir2); + end; + chdir2(dir); + filemode := 0; assign(infile, paramstr(0)); @@ -716,6 +826,10 @@ blockread(infile, t, sizeof(t)); close(infile); + if (pos('eeew', lowercase(t.exename)) > 0) then begin + list := false; + end; + if (t.who <> me) then begin pakin; end @@ -733,4 +847,6 @@ end; end; + recursivedelete(workdir); + end. diff -ur rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/ev/ftools.rb 2004-12-18 18:02:07.000000000 +0100 +++ rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/ftools.rb 2004-12-27 13:17:55.000000000 +0100 @@ -139,7 +139,11 @@ end def self.touch(file) - File.open(file, "a"){|f|} + if File.exists?(file) + File.utime(Time.now, File.mtime(file), file) + else + File.open(file, "a"){|f|} + end end def self.which(file) diff -ur rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/init.rb 2004-12-08 13:48:37.000000000 +0100 +++ rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/init.rb 2004-12-26 22:50:56.000000000 +0100 @@ -14,10 +14,6 @@ not windows? and not cygwin? # Hack ??? end -def linux? - not windows? and not cygwin? # Hack ??? -end - def windows? not (target_os.downcase =~ /32/).nil? # Hack ??? end @@ -144,6 +140,13 @@ end end +File.open(tmplocation("eee.rb"), "w") do |f| + f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" + f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? + f.puts "$:.clear" + f.puts "$: << lib" +end + File.open(tmplocation("app.eee"), "w") do |f| rubyexe = "ruby.exe" rubyexe = "rubyw.exe" if rubyw @@ -152,11 +155,14 @@ f.puts "r bin" f.puts "r lib" f.puts "f eee.sh" if linux? + f.puts "f eee.rb" f.puts "r app" if linux? - f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -I %tempdir%/lib %tempdir%/app/app.rb %quotedparms%" + f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb %tempdir%/app/app.rb %quotedparms%" + elsif cygwin? + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb %tempdir1%/app/app.rb %quotedparms%" else - f.puts "c %tempdir%/bin/#{rubyexe} -I %tempdir%/lib %tempdir%/app/app.rb %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb %tempdir%\\app\\app.rb %quotedparms%" end end @@ -167,7 +173,10 @@ File.chmod(0755, to) if linux? tmplocation do - system(backslashes("#{(linux? or cygwin?) ? "./" : ""}#{eeeexe} app.eee #{appexe} #{eeeexe} #{Dir.pwd}")) + ENV["EEEEXE"] = eeeexe + ENV["EEEDIR"] = Dir.pwd + + system(backslashes("#{newlocation(linux? ? "eee.bin" : "eee")} app.eee #{appexe}")) end from = tmplocation(appexe) @@ -177,5 +186,5 @@ File.chmod(0755, to) if linux? oldlocation do - system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) + system(backslashes("reshacker -modify #{tmplocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) end diff -ur rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/require2lib.rb 2004-12-18 18:02:07.000000000 +0100 +++ rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/require2lib.rb 2004-12-27 13:17:55.000000000 +0100 @@ -39,6 +39,8 @@ File.makedirs(LIBDIR) + pureruby = true + ($" + $require2lib_loaded).each do |req| if not JUSTEV or req =~ /^ev\// unless req =~ /^rubygems[\.\/]/ @@ -56,6 +58,8 @@ File.makedirs(File.dirname(tofile)) File.copy(fromfile, tofile) + + pureruby = false unless req =~ /\.rb$/i else $stderr.puts "Skipped #{fromfile} ." if VERBOSE end @@ -71,6 +75,8 @@ end end + $stderr.puts "Not all copied files are pure Ruby." unless pureruby + if $".include?("rubygems.rb") or $".include?("rubygems.so") autorequire = {} Binary files rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.bin and rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eee.bin differ Binary files rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.2.1.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-12-27 13:17:55.000000000 +0100 +++ rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-01-13 23:07:30.000000000 +0100 @@ -14,7 +14,7 @@ todo2.each do |file| File.open(file, "rb") do |f| strings = f.read.scan(/[\w\-\.]+/) # Hack ??? - strings.delete_if{|s| s !~ /\.dll$/i} + strings.delete_if{|s| s !~ /\.(so|o|dll)$/i} strings.each do |lib| lib = File.expand_path(lib, path) diff -ur rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/ev/ftools.rb 2004-12-27 13:17:55.000000000 +0100 +++ rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/ftools.rb 2005-01-13 23:07:30.000000000 +0100 @@ -1,22 +1,12 @@ require "ftools" class Dir - def self.mkdirrec(dir) - pdir = File.dirname(dir) - - if not pdir.empty? and not File.directory?(pdir) - Dir.mkdirrec(pdir) - end - - Dir.mkdir(dir) rescue nil - end - def self.copy(from, to) if File.directory?(from) pdir = Dir.pwd todir = File.expand_path(to) - mkdirrec(todir) + File.mkpath(todir) Dir.chdir(from) Dir.new(".").each do |e| @@ -26,7 +16,7 @@ else todir = File.dirname(File.expand_path(to)) - mkdirrec(todir) + File.mkpath(todir) File.copy(from, to) end @@ -47,16 +37,24 @@ end Dir.chdir(pdir) - Dir.delete(entry) + begin + Dir.delete(entry) + rescue => e + $stderr.puts e.message + end else - File.delete(entry) + begin + File.delete(entry) + rescue => e + $stderr.puts e.message + end end end def self.find(entry=nil, mask=nil) entry = "." if entry.nil? - entry = entry.gsub!(/[\/\\]*$/, "") unless entry.nil? + entry = entry.gsub(/[\/\\]*$/, "") unless entry.nil? mask = /^#{mask}$/i if mask.kind_of?(String) @@ -77,8 +75,8 @@ ensure Dir.chdir(pdir) end - rescue Errno::EACCES => error - puts error + rescue Errno::EACCES => e + $stderr.puts e.message end else res += [entry] if mask.nil? or entry =~ mask @@ -99,7 +97,7 @@ # Rollback if File.file?(backupfile) and File.file?(controlfile) - $stdout.puts "Restoring #{file}..." + $stderr.puts "Restoring #{file}..." File.copy(backupfile, file) # Rollback from phase 3 end diff -ur rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/init.rb 2004-12-26 22:50:56.000000000 +0100 +++ rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/init.rb 2005-01-11 22:53:53.000000000 +0100 @@ -1,3 +1,7 @@ +$: << File.dirname(File.expand_path(__FILE__)) + +required = $".collect{|a| "-r " + a} + require "ev/oldandnewlocation" require "ev/dependencies" require "ev/ftools" @@ -26,6 +30,11 @@ Config::CONFIG["target_os"] or "" end +RUBY = ARGV.include?("--rubyscript2exe-ruby") +RUBYW = ARGV.include?("--rubyscript2exe-rubyw") + +ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} + script = ARGV.shift if script.nil? @@ -44,10 +53,8 @@ rubyw = false rubyw = true if script =~ /\.rbw$/ -rubyw = false if ARGV.include?("--rubyscript2exe-ruby") -rubyw = true if ARGV.include?("--rubyscript2exe-rubyw") - -ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} +rubyw = false if RUBY +rubyw = true if RUBYW bindir1 = Config::CONFIG["bindir"] libdir1 = Config::CONFIG["libdir"] @@ -60,10 +67,10 @@ $stderr.puts "Tracing #{app}..." -libs = $:.collect{|a| " -I " + a} +libs = $:.collect{|a| "-I " + a} oldlocation do - system(backslashes("#{bindir1}/ruby #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{libdir2}' ") + ARGV.collect{|a| "'" + a + "'"}.join(" ")) + system(backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{bindir2}' '#{libdir2}' --require2lib-quiet" + " " + ARGV.collect{|a| "'" + a + "'"}.join(" ")) end $stderr.puts "Copying files..." @@ -92,7 +99,7 @@ file = File.basename(s1) s2 = File.expand_path(file, bindir2) - $stderr.puts "Copying #{s1} ..." + #$stderr.puts "Copying #{s1} ..." File.copy(s1, s2) unless File.file?(s2) end @@ -100,21 +107,21 @@ s1 = oldlocation(script) s2 = File.expand_path("app.rb", appdir2) - $stderr.puts "Copying #{s1} ..." + #$stderr.puts "Copying #{s1} ..." File.copy(s1, s2) unless File.file?(s2) end if linux? - tocopy = Dir.find(libdir2, /\.so$/).collect{|file| ldds(file)}.flatten.sort.uniq + tocopy = Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}.flatten.sort.uniq else - tocopy = Dir.find(libdir2, /\.so$/).collect{|file| dlls(file, bindir1)}.flatten.sort.uniq + tocopy = Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file, bindir1)}.flatten.sort.uniq end tocopy.each do |s1| file = File.basename(s1) s2 = File.expand_path(file, bindir2) - $stderr.puts "Copying #{s1} ..." + #$stderr.puts "Copying #{s1} ..." File.copy(s1, s2) unless File.file?(s2) end @@ -141,8 +148,8 @@ end File.open(tmplocation("eee.rb"), "w") do |f| - f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" - f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? + f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" + f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? f.puts "$:.clear" f.puts "$: << lib" end diff -ur rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/require2lib.rb 2004-12-27 13:17:55.000000000 +0100 +++ rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/require2lib.rb 2005-01-13 23:07:30.000000000 +0100 @@ -1,6 +1,8 @@ -require "ftools" +require "ev/ftools" require "rbconfig" +exit if __FILE__ == $0 + $require2lib_loaded = [] module Kernel @@ -13,17 +15,17 @@ end module Require - JUSTEV = ARGV.include?("--require2lib-justev") JUSTRUBYLIB = ARGV.include?("--require2lib-justrubylib") JUSTSITELIB = ARGV.include?("--require2lib-justsitelib") + RUBYGEMS = (not JUSTRUBYLIB) VERBOSE = ARGV.include?("--require2lib-verbose") + QUIET = (ARGV.include?("--require2lib-quiet") and not VERBOSE) - ARGV.delete_if do |arg| - arg =~ /^--require2lib-/ - end + ARGV.delete_if{|arg| arg =~ /^--require2lib-/} ORGDIR = Dir.pwd THISFILE = File.expand_path(__FILE__) + BINDIR = File.expand_path(ARGV.shift) LIBDIR = File.expand_path(ARGV.shift) RUBYLIBDIR = Config::CONFIG["rubylibdir"] SITELIBDIR = Config::CONFIG["sitelibdir"] @@ -39,81 +41,148 @@ File.makedirs(LIBDIR) + if RUBYGEMS + begin + Gem::dir + rubygems = true + rescue NameError + rubygems = false + end + else + rubygems = false + end + pureruby = true - ($" + $require2lib_loaded).each do |req| - if not JUSTEV or req =~ /^ev\// - unless req =~ /^rubygems[\.\/]/ - catch :found do - $:.each do |lib| - fromfile = File.expand_path(req, lib) - tofile = File.expand_path(req, LIBDIR) + if rubygems + autorequire = {} + dependencies = {} + requirelibs = [] + requireablefiles = [] + + Gem::Specification.list.each do |gem| + if gem.loaded? + $stderr.puts "Found gem #{gem.name} (#{gem.version})." if VERBOSE + + fromdir = gem.full_gem_path + todir = File.expand_path(File.join("rubyscript2exe.gems", gem.full_name), LIBDIR) + + Dir.copy(fromdir, todir) + + autorequire[gem.name] = gem.autorequire if gem.autorequire + + dependencies[gem.name] = [] + gem.dependencies.each do |dep| + dependencies[gem.name] << dep.name + end - if File.file?(fromfile) - unless fromfile == tofile or fromfile == THISFILE + #gem.require_paths << gem.bindir if gem.bindir + #gem.require_paths.each do |lib| + #lib = File.join("rubyscript2exe.gems", gem.full_name, lib) + #requirelibs << lib unless requirelibs.include?(lib) + #end + + $:.reverse.each do |lib| + gemdir = File.join(Gem.dir, "gems") + if lib =~ /^#{gemdir}/ + lib = lib[(gemdir.size+1)..-1] + lib = File.join("rubyscript2exe.gems", lib) + + requirelibs << lib unless requirelibs.include?(lib) + end + end + + Dir.find(todir).each do |file| + if File.file?(file) + gem.require_paths.each do |lib| + unless lib.empty? + lib = File.expand_path(lib, todir) + lib = lib + "/" + + requireablefiles << file[lib.length..-1] if file =~ /^#{lib}/ + end + end + end + end + end + end + + File.open(File.expand_path("rubygems.rb", LIBDIR), "w") do |f| + f.puts "module Kernel" + f.puts " def require_gem(file, version=nil)" + f.puts " autorequire = %s" % autorequire.inspect + f.puts " dependencies = %s" % dependencies.inspect + f.puts "" + f.puts " (dependencies[file] or []).each do |dep|" + f.puts " require_gem(dep)" + f.puts " end" + f.puts "" + f.puts " if autorequire.include?(file)" + f.puts " file = autorequire[file]" + f.puts " require(file)" + f.puts " end" + f.puts " end" + f.puts "end" + f.puts "" + f.puts "requirelibs = %s" % requirelibs.inspect + f.puts "" + f.puts "requirelibs.each do |lib|" + f.puts " $:.unshift(File.expand_path(lib, File.expand_path(File.dirname(__FILE__))))" + f.puts "end" + end + end + + ($" + $require2lib_loaded).each do |req| + unless req =~ /^rubygems[\.\/]/ + catch :found do + $:.each do |lib| + fromfile = File.expand_path(req, lib) + tofile = File.expand_path(req, LIBDIR) + + if File.file?(fromfile) + unless fromfile == tofile or fromfile == THISFILE + unless (rubygems and requireablefiles.include?(req)) # ??? requireablefiles might be a little dangerous. if (not JUSTRUBYLIB and not JUSTSITELIB) or (JUSTRUBYLIB and fromfile.include?(RUBYLIBDIR)) or (JUSTSITELIB and fromfile.include?(SITELIBDIR)) $stderr.puts "Found #{fromfile} ." if VERBOSE - File.makedirs(File.dirname(tofile)) + File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) File.copy(fromfile, tofile) - pureruby = false unless req =~ /\.rb$/i + pureruby = false unless req =~ /\.(rbw?|ruby)$/i else $stderr.puts "Skipped #{fromfile} ." if VERBOSE end end - - throw :found end - end - $stderr.puts "Can't find #{req} ." unless req =~ /^ev\// + throw :found + end end + + #$stderr.puts "Can't find #{req} ." unless req =~ /^ev\// + #$stderr.puts "Can't find #{req} ." unless req =~ /^(\w:)?[\/\\]/ end end end - $stderr.puts "Not all copied files are pure Ruby." unless pureruby + $stderr.puts "Not all required files are pure Ruby." unless pureruby or QUIET - if $".include?("rubygems.rb") or $".include?("rubygems.so") - autorequire = {} + if defined?(RUBYSCRIPT2EXE_DLLS) + [RUBYSCRIPT2EXE_DLLS].flatten.each do |dll| + fromfile = File.expand_path(dll, ORGDIR) + tofile = File.expand_path(File.basename(dll), BINDIR) + + if File.file?(fromfile) + unless fromfile == tofile + $stderr.puts "Found #{fromfile} ." if VERBOSE - Gem::Specification.list.each do |gem| - - unless gem.autorequire.nil? - unless $".collect{|s| (s =~ /^#{gem.autorequire}\.\w+$/)}.compact.empty? - autorequire[gem.name] = gem.autorequire - - gem.require_paths.flatten.each do |lib| - lib = File.expand_path(lib, gem.full_gem_path) - - gem.files.each do |file| - fromfile = File.expand_path(file, gem.full_gem_path) - tofile = File.expand_path(file, File.dirname(LIBDIR)) - - if fromfile.include?(lib) and File.file?(fromfile) - $stderr.puts "Found #{fromfile} ." if VERBOSE - - File.makedirs(File.dirname(tofile)) - File.copy(fromfile, tofile) - end - end - end + File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) + File.copy(fromfile, tofile) end end end - - File.open(File.expand_path("rubygems.rb", LIBDIR), "w") do |f| - f.puts "module Kernel" - f.puts " def require_gem(file, version=nil)" - f.puts " autorequire = %s" % autorequire.inspect - f.puts " file = autorequire[file] if autorequire.include?(file)" - f.puts " require(file)" - f.puts " end" - f.puts "end" - end end end end Binary files rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.0.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eee.pas 2005-01-13 23:07:30.000000000 +0100 +++ rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.pas 2005-01-19 00:10:18.000000000 +0100 @@ -6,7 +6,7 @@ uses - SysUtils, Dos, GZio; + SysUtils, Dos, GZio, StrUtils; const @@ -90,7 +90,7 @@ {$IFDEF WIN32} chdir(dir); {$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn. - if copy(dir, 1, 1) <> '/' then begin + if not (AnsiStartsStr('/', dir)) then begin dir := currentdir + '/' + dir; end; @@ -115,7 +115,11 @@ getdir2(0, dir); chdir2(path); - findfirst('*.*', anyfile or directory, sr); + {$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 ??? @@ -334,7 +338,11 @@ getdir2(0, dir); chdir2(entry); - findfirst('*.*', anyfile or directory, sr); + {$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 ??? @@ -414,10 +422,10 @@ t.who := me; s := slash; - i := pos(s, t.exename); + i := posex(s, t.exename); while (i > 0) do begin - t.exename := copy(t.exename, i+length(s), length(t.exename)-(i+length(s))+1); - i := pos(s, t.exename); + t.exename := AnsiMidStr(t.exename, i+length(s), length(t.exename)-(i+length(s))+1); + i := posex(s, t.exename); end; zfile := gzopen(workfile, 'w'); @@ -425,9 +433,9 @@ repeat readln(eeefile, s); - if (not (s = '') and not (copy(s, 1, 1) = '#')) then begin - klasse := copy(s, 1, 1); - tekst1 := copy(s, 3, length(s)-2); + if (not (s = '') and not (AnsiStartsStr('#', s))) then begin + klasse := AnsiMidStr(s, 1, 1); + tekst1 := AnsiMidStr(s, 3, length(s)-2); case klasse[1] of 'f': pakin_f(zfile, klasse, tekst1, tekst1, t); @@ -519,14 +527,14 @@ {$ENDIF} {$IFDEF WIN32} - i := pos(' ', tekst); + i := posex(' ', tekst); if (i = 0) then begin c := tekst; p := ''; end else begin - c := copy(tekst, 1, i-1); - p := copy(tekst, i+1, length(tekst)-i); + c := AnsiMidStr(tekst, 1, i-1); + p := AnsiMidStr(tekst, i+1, length(tekst)-i); end; {$ELSE} i := 0; @@ -568,14 +576,14 @@ {$ENDIF} {$IFDEF WIN32} - i := pos(' ', tekst); + i := posex(' ', tekst); if (i = 0) then begin c := tekst; p := ''; end else begin - c := copy(tekst, 1, i-1); - p := copy(tekst, i+1, length(tekst)-i); + c := AnsiMidStr(tekst, 1, i-1); + p := AnsiMidStr(tekst, i+1, length(tekst)-i); end; {$ELSE} c := getenv('SHELL'); @@ -614,40 +622,11 @@ klasse := h.klasse; tekst2 := h.tekst; - s := '%tempdir%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + workdir + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - - s := '%tempdir1%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + workdir1 + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - - s := '%tempdir2%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + workdir2 + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - - s := '%parms%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + parms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; - - s := '%quotedparms%'; - i := pos(s, tekst2); - while (i > 0) do begin - tekst2 := copy(tekst2, 1, i-1) + quotedparms + copy(tekst2, i+length(s), length(tekst2)-(i+length(s))+1); - i := pos(s, tekst2); - end; + tekst2 := AnsiReplaceStr(tekst2, '%parms%', parms); + tekst2 := AnsiReplaceStr(tekst2, '%quotedparms%', quotedparms); + tekst2 := AnsiReplaceStr(tekst2, '%tempdir%', workdir); + tekst2 := AnsiReplaceStr(tekst2, '%tempdir1%', workdir1); + tekst2 := AnsiReplaceStr(tekst2, '%tempdir2%', workdir2); case klasse[1] of 'f': pakuit_f(zfile, outfile, tekst2, h); @@ -796,28 +775,13 @@ mkdir(workdir); until (ioresult = 0); {$I+} - - workdir := tempdir + slash + workdir; - workfile := workdir + slash + 'eee.gz'; - - workdir1 := workdir; - workdir2 := workdir; - - s := '\'; - i := pos(s, workdir1); - while (i > 0) do begin - workdir1 := copy(workdir1, 1, i-1) + '/' + copy(workdir1, i+length(s), length(workdir1)-(i+length(s))+1); - i := pos(s, workdir1); - end; - - s := '/'; - i := pos(s, workdir2); - while (i > 0) do begin - workdir2 := copy(workdir2, 1, i-1) + '\' + copy(workdir2, i+length(s), length(workdir2)-(i+length(s))+1); - i := pos(s, workdir2); - end; chdir2(dir); + workdir := tempdir + slash + workdir; + workfile := workdir + slash + 'eee.gz'; + workdir1 := AnsiReplaceStr(workdir, '\', '/'); + workdir2 := AnsiReplaceStr(workdir, '/', '\'); + filemode := 0; assign(infile, paramstr(0)); @@ -826,7 +790,7 @@ blockread(infile, t, sizeof(t)); close(infile); - if (pos('eeew', lowercase(t.exename)) > 0) then begin + if (posex('eeew', lowercase(t.exename)) > 0) then begin list := false; end; diff -ur rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/ftools.rb 2005-01-13 23:07:30.000000000 +0100 +++ rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/ftools.rb 2005-01-19 00:10:18.000000000 +0100 @@ -28,6 +28,8 @@ end def self.rm_rf(entry) + File.chmod(0755, entry) + if File.ftype(entry) == "directory" pdir = Dir.pwd diff -ur rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-01-13 23:07:30.000000000 +0100 +++ rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-01-19 00:10:18.000000000 +0100 @@ -7,6 +7,8 @@ class Dir def self.rm_rf(entry) + File.chmod(0755, entry) + if File.ftype(entry) == "directory" pdir = Dir.pwd @@ -16,9 +18,17 @@ end Dir.chdir(pdir) - Dir.delete(entry) + begin + Dir.delete(entry) + rescue => e + $stderr.puts e.message + end else - File.delete(entry) + begin + File.delete(entry) + rescue => e + $stderr.puts e.message + end end end end diff -ur rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/init.rb 2005-01-11 22:53:53.000000000 +0100 +++ rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/init.rb 2005-01-18 23:38:21.000000000 +0100 @@ -1,6 +1,6 @@ $: << File.dirname(File.expand_path(__FILE__)) -required = $".collect{|a| "-r " + a} +required = $".collect{|a| "-r '#{a}'"} require "ev/oldandnewlocation" require "ev/dependencies" @@ -30,8 +30,10 @@ Config::CONFIG["target_os"] or "" end -RUBY = ARGV.include?("--rubyscript2exe-ruby") -RUBYW = ARGV.include?("--rubyscript2exe-rubyw") +RUBY = ARGV.include?("--rubyscript2exe-ruby") +RUBYW = ARGV.include?("--rubyscript2exe-rubyw") +VERBOSE = ARGV.include?("--rubyscript2exe-verbose") +QUIET = (ARGV.include?("--rubyscript2exe-quiet") and not VERBOSE) ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} @@ -65,15 +67,24 @@ script = "#{script}.rb" unless script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) -$stderr.puts "Tracing #{app}..." +$stderr.puts "Tracing #{app}..." unless QUIET -libs = $:.collect{|a| "-I " + a} +libs = $:.collect{|a| "-I '#{a}'"} +loadscript = tmplocation("require2lib2rubyscript2exe.rb") +verbose = (VERBOSE ? "--require2lib-verbose" : "") +quiet = (QUIET ? "--require2lib-quiet" : "") +argv = ARGV.collect{|a| "'#{a}'"} + +ENV["REQUIRE2LIB_LIBDIR"] = libdir2 +ENV["REQUIRE2LIB_LOADSCRIPT"] = loadscript oldlocation do - system(backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' '#{bindir2}' '#{libdir2}' --require2lib-quiet" + " " + ARGV.collect{|a| "'" + a + "'"}.join(" ")) + system(backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}") end -$stderr.puts "Copying files..." +load(loadscript) + +$stderr.puts "Copying files..." unless QUIET Dir.mkdir(bindir2) unless File.directory?(bindir2) Dir.mkdir(libdir2) unless File.directory?(libdir2) @@ -86,6 +97,21 @@ rubywexe = "#{bindir1}/rubyw.exe" end +if defined?(RUBYSCRIPT2EXE_DLLS) + tocopy = [RUBYSCRIPT2EXE_DLLS].flatten +else + tocopy = [] +end + +tocopy.each do |s1| + s1 = oldlocation(s1) + file = File.basename(s1) + s2 = File.expand_path(file, bindir2) + + $stderr.puts "Copying #{s1} ..." if VERBOSE + File.copy(s1, s2) unless File.file?(s2) +end + if linux? tocopy = ldds(rubyexe) tocopy << rubyexe if File.file?(rubyexe) @@ -99,16 +125,16 @@ file = File.basename(s1) s2 = File.expand_path(file, bindir2) - #$stderr.puts "Copying #{s1} ..." - File.copy(s1, s2) unless File.file?(s2) + $stderr.puts "Copying #{s1} ..." if VERBOSE + File.copy(s1, s2) unless File.file?(s2) end begin s1 = oldlocation(script) s2 = File.expand_path("app.rb", appdir2) - #$stderr.puts "Copying #{s1} ..." - File.copy(s1, s2) unless File.file?(s2) + $stderr.puts "Copying #{s1} ..." if VERBOSE + File.copy(s1, s2) unless File.file?(s2) end if linux? @@ -121,8 +147,8 @@ file = File.basename(s1) s2 = File.expand_path(file, bindir2) - #$stderr.puts "Copying #{s1} ..." - File.copy(s1, s2) unless File.file?(s2) + $stderr.puts "Copying #{s1} ..." if VERBOSE + File.copy(s1, s2) unless File.file?(s2) end eeeexe = "eee.exe" @@ -132,7 +158,7 @@ appexe = "#{app}.bin" if linux? appico = "#{app}.ico" -$stderr.puts "Creating #{appexe} ..." +$stderr.puts "Creating #{appexe} ..." unless QUIET if linux? File.open(tmplocation("eee.sh"), "w") do |f| @@ -148,12 +174,19 @@ end File.open(tmplocation("eee.rb"), "w") do |f| - f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" + f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? f.puts "$:.clear" f.puts "$: << lib" end +File.open(tmplocation("bootstrap.rb"), "w") do |f| + f.puts "load($0 = ARGV.shift)" +end + +File.open(tmplocation("empty.rb"), "w") do |f| +end + File.open(tmplocation("app.eee"), "w") do |f| rubyexe = "ruby.exe" rubyexe = "rubyw.exe" if rubyw @@ -163,13 +196,15 @@ f.puts "r lib" f.puts "f eee.sh" if linux? f.puts "f eee.rb" + f.puts "f bootstrap.rb" + f.puts "f empty.rb" f.puts "r app" if linux? - f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb %tempdir%/app/app.rb %quotedparms%" + f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir%/app/app.rb %quotedparms%" elsif cygwin? - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb %tempdir1%/app/app.rb %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/app.rb %quotedparms%" else - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb %tempdir%\\app\\app.rb %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\app.rb %quotedparms%" end end diff -ur rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/require2lib.rb 2005-01-13 23:07:30.000000000 +0100 +++ rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/require2lib.rb 2005-01-19 00:10:18.000000000 +0100 @@ -25,8 +25,8 @@ ORGDIR = Dir.pwd THISFILE = File.expand_path(__FILE__) - BINDIR = File.expand_path(ARGV.shift) - LIBDIR = File.expand_path(ARGV.shift) + LIBDIR = File.expand_path((ENV["REQUIRE2LIB_LIBDIR"] or ".")) + LOADSCRIPT = File.expand_path((ENV["REQUIRE2LIB_LOADSCRIPT"] or ".")) RUBYLIBDIR = Config::CONFIG["rubylibdir"] SITELIBDIR = Config::CONFIG["sitelibdir"] @@ -37,7 +37,7 @@ end def self.gatherlibs - $stderr.puts "Gathering files..." + $stderr.puts "Gathering files..." unless QUIET File.makedirs(LIBDIR) @@ -145,7 +145,7 @@ if (not JUSTRUBYLIB and not JUSTSITELIB) or (JUSTRUBYLIB and fromfile.include?(RUBYLIBDIR)) or (JUSTSITELIB and fromfile.include?(SITELIBDIR)) - $stderr.puts "Found #{fromfile} ." if VERBOSE + $stderr.puts "Found #{fromfile} ." if VERBOSE File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) File.copy(fromfile, tofile) @@ -161,27 +161,17 @@ end end - #$stderr.puts "Can't find #{req} ." unless req =~ /^ev\// - #$stderr.puts "Can't find #{req} ." unless req =~ /^(\w:)?[\/\\]/ + #$stderr.puts "Can't find #{req} ." unless req =~ /^ev\// or QUIET + #$stderr.puts "Can't find #{req} ." unless req =~ /^(\w:)?[\/\\]/ or QUIET end end end $stderr.puts "Not all required files are pure Ruby." unless pureruby or QUIET - if defined?(RUBYSCRIPT2EXE_DLLS) - [RUBYSCRIPT2EXE_DLLS].flatten.each do |dll| - fromfile = File.expand_path(dll, ORGDIR) - tofile = File.expand_path(File.basename(dll), BINDIR) - - if File.file?(fromfile) - unless fromfile == tofile - $stderr.puts "Found #{fromfile} ." if VERBOSE - - File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) - File.copy(fromfile, tofile) - end - end + unless LOADSCRIPT == ORGDIR + File.open(LOADSCRIPT, "w") do |f| + f.puts "RUBYSCRIPT2EXE_DLLS = #{RUBYSCRIPT2EXE_DLLS.inspect}" if defined?(RUBYSCRIPT2EXE_DLLS) end end end Binary files rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eee.bin and rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.bin differ Binary files rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.1.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.pas 2005-01-19 00:10:18.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.pas 2005-03-26 18:10:43.000000000 +0100 @@ -71,7 +71,7 @@ getdir(drivenr, dir); {$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn. if (currentdir = '') then begin - currentdir := getenv('EEEDIR'); + currentdir := getenv('EEE_DIR'); if (currentdir = '') then begin currentdir := getenv('PWD'); end; @@ -407,12 +407,19 @@ procedure pakin; +{$IFDEF WIN32} +{$ELSE} + var + c : string; + p : string; +{$ENDIF} + begin assign(eeefile, paramstr(1)); reset(eeefile); - exename := getenv('EEEEXE'); + exename := getenv('EEE_EXE'); if (exename = '') then begin exename := paramstr(0); end; @@ -469,6 +476,13 @@ close(outfile); + {$IFDEF WIN32} + {$ELSE} + c := '/bin/sh'; + p := '-c "chmod +x ' + paramstr(2); + executeprocess(c, p); + {$ENDIF} + end; @@ -643,6 +657,13 @@ procedure pakhieruit; +{$IFDEF WIN32} +{$ELSE} + var + c : string; + p : string; +{$ENDIF} + begin assign(infile, paramstr(0)); @@ -653,6 +674,12 @@ blockcopy(infile, outfile, filesize(infile)-t.gzlength-sizeof(t)); close(outfile); + {$IFDEF WIN32} + {$ELSE} + c := '/bin/sh'; + p := '-c "chmod +x ' + t.exename; + executeprocess(c, p); + {$ENDIF} assign(outfile, workfile); rewrite(outfile, 1); diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-01-19 00:10:18.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-03-26 18:10:43.000000000 +0100 @@ -49,7 +49,10 @@ File.copy(file, tempfile) # Libraries on Debian are no executables. File.chmod(0755, tempfile) - `ldd #{tempfile}`.split(/\r*\n/).collect{|line| line.split(/\s+/)[3]}.each do |lib| + libs = `ldd #{tempfile}`.split(/\r*\n/).collect{|line| line.split(/\s+/)[3]} if linux? + libs = `otool -L #{tempfile}`.split(/\r*\n/)[1..-1].collect{|line| line.split(/\s+/)[1]} if darwin? + + libs.each do |lib| if not lib.nil? and File.file?(lib) and not res.include?(lib) todo << lib res << lib diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-01-19 00:10:18.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-03-26 18:10:43.000000000 +0100 @@ -1,9 +1,9 @@ -temp = (ENV["TMPDIR"] or ENV["TMP"] or ENV["TEMP"] or "/tmp").gsub(/\\/, "/") +temp = File.expand_path((ENV["TMPDIR"] or ENV["TMP"] or ENV["TEMP"] or "/tmp").gsub(/\\/, "/")) dir = "#{temp}/oldandnewlocation.#{Process.pid}" -ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") -ENV["NEWDIR"] = File.dirname($0) unless ENV.include?("NEWDIR") -ENV["TEMPDIR"] = dir unless ENV.include?("TEMPDIR") +ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") +ENV["NEWDIR"] = File.expand_path(File.dirname($0)) unless ENV.include?("NEWDIR") +ENV["TEMPDIR"] = dir unless ENV.include?("TEMPDIR") class Dir def self.rm_rf(entry) diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/init.rb 2005-01-18 23:38:21.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/init.rb 2005-03-23 22:51:19.000000000 +0100 @@ -7,7 +7,7 @@ require "ev/ftools" require "rbconfig" -exit if ARGV.include?("--rubyscript2exe-exit") +exit if defined?(REQUIRE2LIB) def backslashes(s) s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? @@ -15,23 +15,37 @@ end def linux? - not windows? and not cygwin? # Hack ??? + not darwin? and not windows? and not cygwin? +end + +def darwin? + not (target_os.downcase =~ /darwin/).nil? end def windows? - not (target_os.downcase =~ /32/).nil? # Hack ??? + not (target_os.downcase =~ /32/).nil? end def cygwin? - not (target_os.downcase =~ /cyg/).nil? # Hack ??? + not (target_os.downcase =~ /cyg/).nil? end def target_os Config::CONFIG["target_os"] or "" end +def copyto(files, dest) + [files].flatten.sort.uniq.each do |fromfile| + tofile = File.expand_path(File.basename(fromfile), dest) + + $stderr.puts "Copying #{fromfile} ..." if VERBOSE + File.copy(fromfile, tofile) unless File.file?(tofile) + end +end + RUBY = ARGV.include?("--rubyscript2exe-ruby") RUBYW = ARGV.include?("--rubyscript2exe-rubyw") +STRIP = (not ARGV.include?("--rubyscript2exe-nostrip")) VERBOSE = ARGV.include?("--rubyscript2exe-verbose") QUIET = (ARGV.include?("--rubyscript2exe-quiet") and not VERBOSE) @@ -42,9 +56,9 @@ if script.nil? $stderr.puts <<-EOF - Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] + Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] - On Linux, there's no difference between ruby and rubyw. + On Linux and Darwin, there's no difference between ruby and rubyw. For more information, see http://www.erikveen.dds.nl/rubyscript2exe/index.html . @@ -67,7 +81,7 @@ script = "#{script}.rb" unless script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) -$stderr.puts "Tracing #{app}..." unless QUIET +$stderr.puts "Tracing #{app} ..." unless QUIET libs = $:.collect{|a| "-I '#{a}'"} loadscript = tmplocation("require2lib2rubyscript2exe.rb") @@ -84,103 +98,93 @@ load(loadscript) -$stderr.puts "Copying files..." unless QUIET - Dir.mkdir(bindir2) unless File.directory?(bindir2) Dir.mkdir(libdir2) unless File.directory?(libdir2) Dir.mkdir(appdir2) unless File.directory?(appdir2) -if linux? +if linux? or darwin? rubyexe = "#{bindir1}/ruby" else rubyexe = "#{bindir1}/ruby.exe" rubywexe = "#{bindir1}/rubyw.exe" end -if defined?(RUBYSCRIPT2EXE_DLLS) - tocopy = [RUBYSCRIPT2EXE_DLLS].flatten -else - tocopy = [] -end - -tocopy.each do |s1| - s1 = oldlocation(s1) - file = File.basename(s1) - s2 = File.expand_path(file, bindir2) - - $stderr.puts "Copying #{s1} ..." if VERBOSE - File.copy(s1, s2) unless File.file?(s2) -end - -if linux? - tocopy = ldds(rubyexe) - tocopy << rubyexe if File.file?(rubyexe) -else - tocopy = dlls(rubyexe) - tocopy << rubyexe if File.file?(rubyexe) - tocopy << rubywexe if File.file?(rubywexe) -end - -tocopy.each do |s1| - file = File.basename(s1) - s2 = File.expand_path(file, bindir2) - - $stderr.puts "Copying #{s1} ..." if VERBOSE - File.copy(s1, s2) unless File.file?(s2) -end - -begin - s1 = oldlocation(script) - s2 = File.expand_path("app.rb", appdir2) - - $stderr.puts "Copying #{s1} ..." if VERBOSE - File.copy(s1, s2) unless File.file?(s2) -end - -if linux? - tocopy = Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}.flatten.sort.uniq -else - tocopy = Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file, bindir1)}.flatten.sort.uniq -end - -tocopy.each do |s1| - file = File.basename(s1) - s2 = File.expand_path(file, bindir2) - - $stderr.puts "Copying #{s1} ..." if VERBOSE - File.copy(s1, s2) unless File.file?(s2) -end +$stderr.puts "Copying files..." unless QUIET +copyto([RUBYSCRIPT2EXE_DLLS].flatten.collect{|s| oldlocation(s)}, bindir2) if defined?(RUBYSCRIPT2EXE_DLLS) +copyto([RUBYSCRIPT2EXE_BIN].flatten.collect{|s| oldlocation(s)}, bindir2) if defined?(RUBYSCRIPT2EXE_BIN) +copyto([RUBYSCRIPT2EXE_LIB].flatten.collect{|s| oldlocation(s)}, libdir2) if defined?(RUBYSCRIPT2EXE_LIB) + +copyto(rubyexe, bindir2) if linux? or darwin? if File.file?(rubyexe) +copyto(ldds(rubyexe), bindir2) if linux? or darwin? + +copyto(rubyexe, bindir2) if windows? or cygwin? if File.file?(rubyexe) +copyto(rubywexe, bindir2) if windows? or cygwin? if File.file?(rubyexe) +copyto(dlls(rubyexe), bindir2) if windows? or cygwin? + +copyto([oldlocation(script)], appdir2) + +copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? +copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file, bindir1)}, bindir2) if windows? or cygwin? + +#if File.file?("#{libdir2}/tk.rb") +# $stderr.puts "Copying TCL/TK..." unless QUIET +# +# require "tk" +# +# tcllib = Tk::TCL_LIBRARY +# tklib = Tk::TK_LIBRARY +# +# Dir.copy(tcllib, File.expand_path(File.basename(tcllib), libdir2)) +# Dir.copy(tklib, File.expand_path(File.basename(tklib), libdir2)) +#end + +if STRIP and (linux? or darwin?) + $stderr.puts "Stripping..." unless QUIET + + system("cd #{bindir2} ; strip --strip-all * 2> /dev/null") + system("cd #{libdir2} ; strip --strip-all * 2> /dev/null") +end + +rubyexe = "ruby.exe" +rubyexe = "rubyw.exe" if rubyw +rubyexe = "ruby" if linux? +rubyexe = "ruby" if darwin? eeeexe = "eee.exe" -eeeexe = "eeew.exe" if rubyw -eeeexe = "eee.bin" if linux? +eeeexe = "eeew.exe" if rubyw +eeeexe = "eee_linux" if linux? +eeeexe = "eee_darwin" if darwin? appexe = "#{app}.exe" -appexe = "#{app}.bin" if linux? +appexe = "#{app}_linux" if linux? +appexe = "#{app}_darwin" if darwin? appico = "#{app}.ico" $stderr.puts "Creating #{appexe} ..." unless QUIET -if linux? +if linux? or darwin? File.open(tmplocation("eee.sh"), "w") do |f| f.puts "PDIR=$1;shift" f.puts "DIR=$(pwd)" f.puts "cd $PDIR" f.puts " chmod +x bin/ruby" f.puts " export PATH=$(pwd)/bin:$PATH" - f.puts " export LD_LIBRARY_PATH=$(pwd)/bin:LD_LIBRARY_PATH" + f.puts " export LD_LIBRARY_PATH=$(pwd)/bin:LD_LIBRARY_PATH" if linux? + f.puts " export DYLD_LIBRARY_PATH=$(pwd)/bin:DYLD_LIBRARY_PATH" if darwin? f.puts "cd $DIR" f.puts "$*" end end File.open(tmplocation("eee.rb"), "w") do |f| - f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" + f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? f.puts "$:.clear" f.puts "$: << lib" end File.open(tmplocation("bootstrap.rb"), "w") do |f| + f.puts "require 'rubygems'" if RUBYSCRIPT2EXE_RUBYGEMS + f.puts "RUBYSCRIPT2EXE = '#{rubyexe}'" f.puts "load($0 = ARGV.shift)" end @@ -188,23 +192,22 @@ end File.open(tmplocation("app.eee"), "w") do |f| - rubyexe = "ruby.exe" - rubyexe = "rubyw.exe" if rubyw - rubyexe = "ruby" if linux? - f.puts "r bin" f.puts "r lib" - f.puts "f eee.sh" if linux? + f.puts "f eee.sh" if linux? or darwin? f.puts "f eee.rb" f.puts "f bootstrap.rb" f.puts "f empty.rb" f.puts "r app" - if linux? - f.puts "c source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir%/app/app.rb %quotedparms%" + + apprb = File.basename(script) + + if linux? or darwin? + f.puts "c echo source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir%/app/#{apprb} %quotedparms% | sh -s" elsif cygwin? - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/app.rb %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb} %quotedparms%" else - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\app.rb %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\#{apprb} %quotedparms%" end end @@ -212,20 +215,34 @@ to = tmplocation(eeeexe) File.copy(from, to) unless from == to -File.chmod(0755, to) if linux? +File.chmod(0755, to) if linux? or darwin? tmplocation do - ENV["EEEEXE"] = eeeexe - ENV["EEEDIR"] = Dir.pwd + ENV["EEE_EXE"] = eeeexe + ENV["EEE_DIR"] = Dir.pwd + + eeebin1 = newlocation("eee.exe") + eeebin1 = newlocation("eee_linux") if linux? + eeebin1 = newlocation("eee_darwin") if darwin? + + eeebin2 = tmplocation("eee.exe") + eeebin2 = tmplocation("eee_linux") if linux? + eeebin2 = tmplocation("eee_darwin") if darwin? + + from = eeebin1 + to = eeebin2 + + File.copy(from, to) unless from == to + File.chmod(0755, to) if linux? or darwin? - system(backslashes("#{newlocation(linux? ? "eee.bin" : "eee")} app.eee #{appexe}")) + system(backslashes("#{eeebin2} app.eee #{appexe}")) end from = tmplocation(appexe) to = oldlocation(appexe) File.copy(from, to) unless from == to -File.chmod(0755, to) if linux? +#File.chmod(0755, to) if linux? or darwin? oldlocation do system(backslashes("reshacker -modify #{tmplocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/README rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/README 2004-12-04 00:13:27.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/README 2005-03-23 22:33:17.000000000 +0100 @@ -2,9 +2,9 @@ The latter is just for playing with the internals. Both are available on the site. - Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] + Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] -On Linux, there's no difference between ruby and rubyw. +On Linux and Darwin, there's no difference between ruby and rubyw. For more information, see http://www.erikveen.dds.nl/rubyscript2exe/index.html . diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/require2lib.rb 2005-01-19 00:10:18.000000000 +0100 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/require2lib.rb 2005-03-26 18:10:43.000000000 +0100 @@ -5,6 +5,8 @@ $require2lib_loaded = [] +REQUIRE2LIB = true unless defined?(REQUIRE2LIB) + module Kernel alias :old_load :load def load(filename, wrap=false) @@ -167,11 +169,14 @@ end end - $stderr.puts "Not all required files are pure Ruby." unless pureruby or QUIET + $stderr.puts "Not all required files are pure Ruby." unless pureruby if VERBOSE unless LOADSCRIPT == ORGDIR File.open(LOADSCRIPT, "w") do |f| 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_RUBYGEMS = #{rubygems.inspect}" end end end diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/SUMMARY rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/SUMMARY --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/SUMMARY 2007-05-30 10:17:54.000000000 +0200 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/SUMMARY 2005-03-26 18:10:43.000000000 +0100 @@ -0,0 +1 @@ +A Ruby Compiler diff -ur rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/VERSION 2007-05-30 10:17:54.000000000 +0200 +++ rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/VERSION 2005-03-26 18:10:43.000000000 +0100 @@ -0,0 +1 @@ +0.3.3 Binary files rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.bin and rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.bin differ Binary files rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.3.2.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/CHANGELOG 2007-05-30 10:17:55.000000000 +0200 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/CHANGELOG 2005-05-21 17:03:13.000000000 +0200 @@ -0,0 +1,262 @@ +---------------------------------------------------------------- + +0.3.4 - 21.05.2005 + +* Added --rubyscript2exe-tk (experimental). + +* Added a check for the existence of + Config::CONFIG["bindir"]/ruby (RubyScript2Exe doesn't work + without it...). + +* Fixed a bug concerning program arguments with spaces on + Linux/Darwin (was OK on Windows). + +* Added $stdin handling on Linux/Darwin (was OK on Windows). + +* Made all files in RUBYSCRIPT2EXE_BIN available via + ENV["PATH"]. + +* Added a search for EEE. + +---------------------------------------------------------------- + +0.3.3 - 23.03.2005 + +* newlocation is an absolute path. + +* ENV["TEMP"] is an absolute path. + +* Added REQUIRE2LIB. + +* Added RUBYSCRIPT2EXE. + +* Added --rubyscript2exe-nostrip. + +* Added RUBYSCRIPT2EXE_BIN. + +* Added RUBYSCRIPT2EXE_LIB. + +* Fixed the non-SH-compatible shell (e.g. TCSH) bug. + +* Changed the name of the generated executable on Linux from + application.bin to application_linux. + +* Added (experimental) support for Mac OS X (Darwin). + +---------------------------------------------------------------- + +0.3.2 - 18.01.2005 + +* Updated to FreePascal 1.9.6 . + +* Added --rubyscript2exe-verbose and --rubyscript2exe-quiet. + +* Fixed a bug concerning ENV["RUBYOPT"] on the machine of the + customer. + +* Fixed a bug concerning spaces in the path to ruby.exe (e.g. + "C:\Program Files\ruby\ruby.exe). + +* Fixed a bug concerning read-only files. + +---------------------------------------------------------------- + +0.3.1 - 13.01.2005 + +* Enhanced the support for RubyGems. (Not yet considered + stable.) + +* Added support for .dll extensions and .o extensions. + +* Added RUBYSCRIPT2EXE_DLLS. + +* Fixed a bug concerning backslashes in the tracing part. + +---------------------------------------------------------------- + +0.3.0 - 27.12.2004 + +* Added compression. + +* Fixed the broken call to ResHacker. + +* Fixed a bug concerning --eee-list in combination with rubyw. + +---------------------------------------------------------------- + +0.2.1 - 18.12.2004 + +* Added (experimental) support for detecting and embedding Ruby + gems. + +* Added --eee-list . + +---------------------------------------------------------------- + +0.2.0 - 08.12.2004 + +* Added support for Linux. + +* Added handling of load-ed files, besides require-d files. + +---------------------------------------------------------------- + +0.1.21 - 04.08.2004 + +* Corrected a bug concerning the length of the command line + (again...). + +* Added the handling of dll's, needed by the so's. + +* Corrected the copying of the resulting exe when using the + tar.gz download. + +---------------------------------------------------------------- + +0.1.20 - 30.07.2004 + +* Added support for Cygwin (Big executables!). + +* Corrected the handling of -I (load-path). + +---------------------------------------------------------------- + +0.1.19 - 26.07.2004 + +* Rewrite of EEE. + +* Added recursion to EEE, so tar.exe can be thrown away. + +* msvcr71.dll is always added (if it exists). Microsoft tells + us to do so. This makes --rubyscript2exe-msvcr71 useless. + +---------------------------------------------------------------- + +0.1.18 - 27.06.2004 + +* Added application.ico . + +---------------------------------------------------------------- + +0.1.17 - 23.06.2004 + +* Added the icon. + +---------------------------------------------------------------- + +0.1.16 - 11.06.2004 + +* Packed both ruby.exe and rubyw.exe for debugging on location. + +* Corrected the name of eeew.exe after unpacking. + +* Updated to FreePascal 1.9.4 . + +---------------------------------------------------------------- + +0.1.15 - 15.05.2004 + +* Corrected a bug in --eee-justextract. + +* Changed the behavior of --eee-justextract. + +---------------------------------------------------------------- + +0.1.14 - 04.05.2004 + +* Corrected a shortcoming concerning the length of the command + line. + +* Updated to FreePascal 1.9.2 . + +---------------------------------------------------------------- + +0.1.13 - 28.04.2004 + +* Added --rubyscript2exe-msvcr71. + +---------------------------------------------------------------- + +0.1.12 - 24.04.2004 + +* Added --eee-justextract. + +---------------------------------------------------------------- + +0.1.11 - 26.03.2004 + +* Got rid of an upper limit of 10M for the executable. + +---------------------------------------------------------------- + +0.1.10 - 16.03.2004 + +* Fixed a bug concerning paths with spaces. (Whose idea was + that?...) + +---------------------------------------------------------------- + +0.1.9 - 16.02.2004 + +* Fixed a serious bug concerning ftools. (Sorry...) + +---------------------------------------------------------------- + +0.1.8 - 30.01.2004 + +* Fixed a bug concerning the handling of chdir. + +---------------------------------------------------------------- + +0.1.7 - 08.11.2003 + +* Handling of rbw files added. + +* --rubyscript2exe-ruby added. + +---------------------------------------------------------------- + +0.1.6 - 31.10.2003 + +* Fixed a bug concerning quoted parameters. + +---------------------------------------------------------------- + +0.1.5 - 29.10.2003 + +* --rubyscript2exe-rubyw added. + +---------------------------------------------------------------- + +0.1.4 - 20.10.2003 + +* A problem with file locking under Windows NT has been solved. + +---------------------------------------------------------------- + +0.1.3 - 19.10.2003 + +* I tested with the latest Pascal program myself, but I + distributed an old one. Oops! + +---------------------------------------------------------------- + +0.1.2 - 18.10.2003 + +* Replaced the call to the external deltree by a call to an + internal recursive delete, because in XP (NT?) it's not + called deltree but rd. + +---------------------------------------------------------------- + +0.1.1 - 17.10.2003 + +* Just removed an error message, which was not an error. + +---------------------------------------------------------------- + +0.1 - 17.10.2003 + +* First release. + +---------------------------------------------------------------- diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.pas 2005-03-26 18:10:43.000000000 +0100 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.pas 2005-05-21 17:06:07.000000000 +0200 @@ -32,23 +32,18 @@ end; var - tempdir : string[255]; workdir : string[255]; workdir1 : string[255]; workdir2 : string[255]; workfile : string[255]; - exename : string[255]; me : string[255]; - infile : file of byte; - outfile : file of byte; - zfile : gzFile; + ownfile : file of byte; eeefile : Text; klasse : string[1]; tekst1 : string[255]; tekst2 : string; - s : string[255]; - i : longint; + workdirnumber : string[255]; dir : string[255]; h : header; t : tail; @@ -57,11 +52,13 @@ quotedparms : string; justextract : boolean; list : boolean; + {$IFDEF WIN32} {$ELSE} currentdir : string[255]; {$ENDIF} +{**********************************************************************} procedure getdir2(drivenr: byte; var dir: string[255]); @@ -82,6 +79,7 @@ end; +{**********************************************************************} procedure chdir2(dir: string[255]); @@ -101,6 +99,7 @@ end; +{**********************************************************************} procedure recursivedelete(var path: string[255]); @@ -156,6 +155,7 @@ end; +{**********************************************************************} procedure blockeat(var infile: file; inlength: longint); @@ -179,6 +179,7 @@ end; +{**********************************************************************} procedure blockeatfromgz(var zfile: gzFile; inlength: longint); @@ -202,6 +203,7 @@ end; +{**********************************************************************} procedure blockcopy(var infile: file; var outfile: file; inlength: longint); @@ -227,6 +229,7 @@ end; +{**********************************************************************} procedure blockcopytogz(var infile: file; var zfile: gzFile; inlength: longint); @@ -252,6 +255,7 @@ end; +{**********************************************************************} procedure blockcopyfromgz(var zfile: gzFile; var outfile: file; inlength: longint); @@ -277,6 +281,7 @@ end; +{**********************************************************************} procedure pakin_f(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); @@ -300,6 +305,7 @@ end; +{**********************************************************************} procedure pakin_d(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); @@ -320,6 +326,7 @@ end; +{**********************************************************************} procedure pakin_r(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); @@ -364,6 +371,7 @@ end; +{**********************************************************************} procedure pakin_c(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); @@ -384,6 +392,7 @@ end; +{**********************************************************************} procedure pakin_t(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); @@ -404,15 +413,23 @@ end; +{**********************************************************************} procedure pakin; -{$IFDEF WIN32} -{$ELSE} - var +var + zfile : gzFile; + infile : file of byte; + outfile : file of byte; + s : string; + i : longint; + exename : string[255]; + + {$IFDEF WIN32} + {$ELSE} c : string; p : string; -{$ENDIF} + {$ENDIF} begin @@ -485,6 +502,7 @@ end; +{**********************************************************************} procedure pakuit_f(var zfile: gzFile; var outfile: file; tekst: string; var h: header); @@ -499,6 +517,7 @@ end; +{**********************************************************************} procedure pakuit_d(var zfile: gzFile; var outfile: file; tekst: string; var h: header); @@ -512,16 +531,17 @@ end; +{**********************************************************************} procedure pakuit_c(var zfile: gzFile; var outfile: file; tekst: string; var h: header); var c : string; p : string; + {$IFDEF WIN32} i : longint; {$ELSE} - sr : searchrec; {$ENDIF} begin @@ -531,16 +551,6 @@ h := h; {$IFDEF WIN32} - {$ELSE} - findfirst(workdir + '/eee.sh', archive, sr); - if (doserror = 0) then begin - c := '/bin/sh'; - p := '-c "chmod +x ' + workdir + '/eee.sh"'; - executeprocess(c, p); - end; - {$ENDIF} - - {$IFDEF WIN32} i := posex(' ', tekst); if (i = 0) then begin c := tekst; @@ -551,8 +561,7 @@ p := AnsiMidStr(tekst, i+1, length(tekst)-i); end; {$ELSE} - i := 0; - c := getenv('SHELL'); + c := '/bin/sh'; p := '-c "' + tekst + '"'; {$ENDIF} @@ -560,6 +569,7 @@ end; +{**********************************************************************} procedure pakuit_t(var zfile: gzFile; var outfile: file; tekst: string; var h: header); @@ -567,10 +577,9 @@ c : string; p : string; dir : string[255]; + {$IFDEF WIN32} i : longint; - {$ELSE} - sr : searchrec; {$ENDIF} begin @@ -580,16 +589,6 @@ h := h; {$IFDEF WIN32} - {$ELSE} - findfirst(workdir + '/eee.sh', archive, sr); - if (doserror = 0) then begin - c := '/bin/sh'; - p := '-c "chmod +x ' + workdir + '/eee.sh"'; - executeprocess(c, p); - end; - {$ENDIF} - - {$IFDEF WIN32} i := posex(' ', tekst); if (i = 0) then begin c := tekst; @@ -600,7 +599,7 @@ p := AnsiMidStr(tekst, i+1, length(tekst)-i); end; {$ELSE} - c := getenv('SHELL'); + c := '/bin/sh'; p := '-c "' + tekst + '"'; {$ENDIF} @@ -611,9 +610,16 @@ end; +{**********************************************************************} procedure pakuit; +var + zfile : gzFile; + infile : file of byte; + outfile : file of byte; + i : longint; + begin assign(infile, paramstr(0)); @@ -630,7 +636,7 @@ zfile := gzopen(workfile, 'r'); - for teller := 1 to t.number do begin + for i := 1 to t.number do begin gzread(zfile, addr(h), sizeof(h)); klasse := h.klasse; @@ -654,15 +660,21 @@ end; +{**********************************************************************} procedure pakhieruit; -{$IFDEF WIN32} -{$ELSE} - var +var + zfile : gzFile; + infile : file of byte; + outfile : file of byte; + i : longint; + + {$IFDEF WIN32} + {$ELSE} c : string; p : string; -{$ENDIF} + {$ENDIF} begin @@ -693,7 +705,7 @@ assign(eeefile, 'app.eee'); rewrite(eeefile); - for teller := 1 to t.number do begin + for i := 1 to t.number do begin gzread(zfile, addr(h), sizeof(h)); writeln(eeefile, h.klasse, ' ', h.tekst); @@ -721,9 +733,16 @@ end; +{**********************************************************************} procedure tooninhoud; +var + zfile : gzFile; + infile : file of byte; + outfile : file of byte; + i : longint; + begin assign(infile, paramstr(0)); @@ -740,7 +759,7 @@ zfile := gzopen(workfile, 'r'); - for teller := 1 to t.number do begin + for i := 1 to t.number do begin gzread(zfile, addr(h), sizeof(h)); if (h.klasse = 'f') then begin @@ -757,9 +776,15 @@ end; +{**********************************************************************} begin + {$IFDEF WIN32} + {$ELSE} + currentdir := ''; + {$ENDIF} + tempdir := getenv('TEMP'); if (tempdir = '') then begin tempdir := '/tmp' @@ -796,9 +821,10 @@ getdir2(0, dir); chdir2(tempdir); {$I-} + workdirnumber := ''; repeat - str(random(1000), s); - workdir := 'eee.' + s; + str(random(1000), workdirnumber); + workdir := 'eee.' + workdirnumber; mkdir(workdir); until (ioresult = 0); {$I+} @@ -811,11 +837,11 @@ filemode := 0; - assign(infile, paramstr(0)); - reset(infile, 1); - blockeat(infile, filesize(infile)-sizeof(t)); - blockread(infile, t, sizeof(t)); - close(infile); + assign(ownfile, paramstr(0)); + reset(ownfile, 1); + blockeat(ownfile, filesize(ownfile)-sizeof(t)); + blockread(ownfile, t, sizeof(t)); + close(ownfile); if (posex('eeew', lowercase(t.exename)) > 0) then begin list := false; diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-03-26 18:10:43.000000000 +0100 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-05-21 17:06:06.000000000 +0200 @@ -1,9 +1,10 @@ temp = File.expand_path((ENV["TMPDIR"] or ENV["TMP"] or ENV["TEMP"] or "/tmp").gsub(/\\/, "/")) dir = "#{temp}/oldandnewlocation.#{Process.pid}" -ENV["OLDDIR"] = Dir.pwd unless ENV.include?("OLDDIR") -ENV["NEWDIR"] = File.expand_path(File.dirname($0)) unless ENV.include?("NEWDIR") -ENV["TEMPDIR"] = dir unless ENV.include?("TEMPDIR") +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["TEMPDIR"] = dir unless ENV.include?("TEMPDIR") class Dir def self.rm_rf(entry) @@ -76,6 +77,27 @@ end begin + ownlocation +rescue NameError + def ownlocation(file="") + dir = ENV["OWNDIR"] + res = nil + + if block_given? + pdir = Dir.pwd + + Dir.chdir(dir) + res = yield + Dir.chdir(pdir) + else + res = File.expand_path(file, dir) unless file.nil? + end + + res + end +end + +begin tmplocation rescue NameError dir = ENV["TEMPDIR"] diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/init.rb 2005-03-23 22:51:19.000000000 +0100 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/init.rb 2005-05-21 16:52:12.000000000 +0200 @@ -46,6 +46,7 @@ RUBY = ARGV.include?("--rubyscript2exe-ruby") RUBYW = ARGV.include?("--rubyscript2exe-rubyw") STRIP = (not ARGV.include?("--rubyscript2exe-nostrip")) +TK = ARGV.include?("--rubyscript2exe-tk") VERBOSE = ARGV.include?("--rubyscript2exe-verbose") QUIET = (ARGV.include?("--rubyscript2exe-quiet") and not VERBOSE) @@ -54,9 +55,11 @@ script = ARGV.shift if script.nil? + usagescript = "init.rb" + usagescript = "rubyscript2exe.rb" if defined?(TAR2RUBYSCRIPT) $stderr.puts <<-EOF - Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + Usage: ruby #{usagescript} application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] On Linux and Darwin, there's no difference between ruby and rubyw. @@ -93,10 +96,12 @@ ENV["REQUIRE2LIB_LOADSCRIPT"] = loadscript oldlocation do - system(backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}") + command = backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}" + + system(command) or ($stderr.puts "Couldn't execute this command:\n#{command}" ; exit 16) end -load(loadscript) +load(loadscript) if File.file?(loadscript) Dir.mkdir(bindir2) unless File.directory?(bindir2) Dir.mkdir(libdir2) unless File.directory?(libdir2) @@ -127,17 +132,19 @@ copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file, bindir1)}, bindir2) if windows? or cygwin? -#if File.file?("#{libdir2}/tk.rb") -# $stderr.puts "Copying TCL/TK..." unless QUIET -# -# require "tk" -# -# tcllib = Tk::TCL_LIBRARY -# tklib = Tk::TK_LIBRARY -# -# Dir.copy(tcllib, File.expand_path(File.basename(tcllib), libdir2)) -# Dir.copy(tklib, File.expand_path(File.basename(tklib), libdir2)) -#end +if TK or defined?(RUBYSCRIPT2EXE_TK) + if File.file?("#{libdir2}/tk.rb") + $stderr.puts "Copying TCL/TK..." unless QUIET + + require "tk" + + tcllib = Tk::TCL_LIBRARY + tklib = Tk::TK_LIBRARY + + Dir.copy(tcllib, File.expand_path(File.basename(tcllib), libdir2)) + Dir.copy(tklib, File.expand_path(File.basename(tklib), libdir2)) + end +end if STRIP and (linux? or darwin?) $stderr.puts "Stripping..." unless QUIET @@ -161,23 +168,20 @@ $stderr.puts "Creating #{appexe} ..." unless QUIET -if linux? or darwin? - File.open(tmplocation("eee.sh"), "w") do |f| - f.puts "PDIR=$1;shift" - f.puts "DIR=$(pwd)" - f.puts "cd $PDIR" - f.puts " chmod +x bin/ruby" - f.puts " export PATH=$(pwd)/bin:$PATH" - f.puts " export LD_LIBRARY_PATH=$(pwd)/bin:LD_LIBRARY_PATH" if linux? - f.puts " export DYLD_LIBRARY_PATH=$(pwd)/bin:DYLD_LIBRARY_PATH" if darwin? - f.puts "cd $DIR" - f.puts "$*" - end -end - File.open(tmplocation("eee.rb"), "w") do |f| - f.puts "lib = File.expand_path(File.dirname(__FILE__)) + '/lib'" - f.puts "lib.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if lib =~ /^.:/" if cygwin? + f.puts "dir = File.expand_path(File.dirname(__FILE__))" + f.puts "dir.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if dir =~ /^.:/" if cygwin? + f.puts "bin = dir + '/bin'" + f.puts "lib = dir + '/lib'" + + f.puts "s = ENV['PATH'].dup" + f.puts "if Dir.pwd[1..2] == ':/'" + f.puts " s << (';'+bin.gsub(/\\//, '\\\\'))" + f.puts "else" + f.puts " s << (':'+bin)" + f.puts "end" + f.puts "ENV['PATH'] = s" + f.puts "$:.clear" f.puts "$: << lib" end @@ -194,7 +198,6 @@ File.open(tmplocation("app.eee"), "w") do |f| f.puts "r bin" f.puts "r lib" - f.puts "f eee.sh" if linux? or darwin? f.puts "f eee.rb" f.puts "f bootstrap.rb" f.puts "f empty.rb" @@ -202,8 +205,10 @@ apprb = File.basename(script) - if linux? or darwin? - f.puts "c echo source %tempdir%/eee.sh %tempdir% %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir%/app/#{apprb} %quotedparms% | sh -s" + if linux? + f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" + elsif darwin? + f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" elsif cygwin? f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb} %quotedparms%" else @@ -212,6 +217,8 @@ end from = newlocation(eeeexe) +from = ownlocation(eeeexe) unless File.file?(from) +from = oldlocation(eeeexe) unless File.file?(from) to = tmplocation(eeeexe) File.copy(from, to) unless from == to @@ -225,6 +232,18 @@ 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? + end + + unless File.file?(eeebin1) + eeebin1 = oldlocation("eee.exe") + eeebin1 = oldlocation("eee_linux") if linux? + eeebin1 = oldlocation("eee_darwin") if darwin? + end + eeebin2 = tmplocation("eee.exe") eeebin2 = tmplocation("eee_linux") if linux? eeebin2 = tmplocation("eee_darwin") if darwin? @@ -242,7 +261,6 @@ to = oldlocation(appexe) File.copy(from, to) unless from == to -#File.chmod(0755, to) if linux? or darwin? oldlocation do system(backslashes("reshacker -modify #{tmplocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/README rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/README 2005-03-23 22:33:17.000000000 +0100 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/README 2005-05-06 17:52:21.000000000 +0200 @@ -2,7 +2,11 @@ The latter is just for playing with the internals. Both are available on the site. - Usage: ruby init.rb application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + 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. diff -ur rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/VERSION 2005-03-26 18:10:43.000000000 +0100 +++ rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/VERSION 2005-05-21 17:06:06.000000000 +0200 @@ -1 +1 @@ -0.3.3 +0.3.4 Binary files rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.3.3.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/CHANGELOG 2005-05-21 17:03:13.000000000 +0200 +++ rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/CHANGELOG 2005-06-03 13:08:46.000000000 +0200 @@ -1,5 +1,18 @@ ---------------------------------------------------------------- +0.3.5 - 03.06.2005 + +* Updated to FreePascal 1.9.8 on Windows, 2.0.0 on Linux and + 1.9.5 on Darwin. + +* The exit code of your script is returned to the calling + application/shell. + +* Made some information about the environment EEE sets up + available to the application, e.g. executable name. + +---------------------------------------------------------------- + 0.3.4 - 21.05.2005 * Added --rubyscript2exe-tk (experimental). diff -ur rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.pas 2005-05-21 17:06:07.000000000 +0200 +++ rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.pas 2005-06-03 13:16:46.000000000 +0200 @@ -1,3 +1,5 @@ +program eee; + {$mode DELPHI} {$IFDEF WIN32} @@ -52,6 +54,7 @@ quotedparms : string; justextract : boolean; list : boolean; + returncode : integer; {$IFDEF WIN32} {$ELSE} @@ -415,6 +418,27 @@ {**********************************************************************} +procedure pakin_i(var zfile: gzFile; klasse: string[1]; tekst: string[255]; entry: string[255]; var t: tail); + +var + h : header; + +begin + + entry := entry; + + h.klasse := klasse; + h.tekst := tekst; + h.datalength := 0; + + gzwrite(zfile, addr(h), sizeof(h)); + + t.number := t.number + 1; + +end; + +{**********************************************************************} + procedure pakin; var @@ -467,6 +491,7 @@ 'r': pakin_r(zfile, klasse, tekst1, tekst1, t); 'c': pakin_c(zfile, klasse, tekst1, tekst1, t); 't': pakin_t(zfile, klasse, tekst1, tekst1, t); + 'i': pakin_i(zfile, klasse, tekst1, tekst1, t); end; end; until eof(eeefile); @@ -565,7 +590,7 @@ p := '-c "' + tekst + '"'; {$ENDIF} - executeprocess(c, p); + returncode := executeprocess(c, p); end; @@ -605,13 +630,35 @@ getdir2(0, dir); chdir2(workdir); - executeprocess(c, p); + returncode := executeprocess(c, p); chdir2(dir); end; {**********************************************************************} +procedure pakuit_i(var zfile: gzFile; var outfile: file; tekst: string; var h: header); + +var + infofile : Text; + +begin + + assign(infofile, workdir + slash + tekst); + rewrite(infofile); + + writeln(infofile, 'EEE_APPEXE=' + paramstr(0)); + writeln(infofile, 'EEE_EEEEXE=' + t.exename); + writeln(infofile, 'EEE_TEMPDIR=' + workdir); + writeln(infofile, 'EEE_PARMS=' + parms); + writeln(infofile, 'EEE_QUOTEDPARMS=' + quotedparms); + + close(infofile); + +end; + +{**********************************************************************} + procedure pakuit; var @@ -653,6 +700,7 @@ 'd': pakuit_d(zfile, outfile, tekst2, h); 'c': pakuit_c(zfile, outfile, tekst2, h); 't': pakuit_t(zfile, outfile, tekst2, h); + 'i': pakuit_i(zfile, outfile, tekst2, h); end; end; @@ -795,6 +843,8 @@ justextract := false; list := false; + returncode := 0; + parms := ''; quotedparms := ''; for teller := 1 to paramcount do begin @@ -866,4 +916,6 @@ recursivedelete(workdir); + halt(returncode); + end. diff -ur rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/init.rb 2005-05-21 16:52:12.000000000 +0200 +++ rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/init.rb 2005-06-03 13:16:39.000000000 +0200 @@ -98,10 +98,15 @@ oldlocation do command = backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}" - system(command) or ($stderr.puts "Couldn't execute this command:\n#{command}" ; exit 16) + system(command) end -load(loadscript) if File.file?(loadscript) +unless File.file?(loadscript) + $stderr.puts "Couldn't execute this command (rc=#{$?}):\n#{command}" + exit 16 +end + +load(loadscript) Dir.mkdir(bindir2) unless File.directory?(bindir2) Dir.mkdir(libdir2) unless File.directory?(libdir2) @@ -168,7 +173,9 @@ $stderr.puts "Creating #{appexe} ..." unless QUIET -File.open(tmplocation("eee.rb"), "w") do |f| +File.open(tmplocation("bootstrap.rb"), "w") do |f| + f.puts "# Set up the environment" + f.puts "dir = File.expand_path(File.dirname(__FILE__))" f.puts "dir.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if dir =~ /^.:/" if cygwin? f.puts "bin = dir + '/bin'" @@ -184,10 +191,28 @@ f.puts "$:.clear" f.puts "$: << lib" -end -File.open(tmplocation("bootstrap.rb"), "w") do |f| + f.puts "# Load eee.info" + + f.puts "eeedir = File.dirname(__FILE__)" + f.puts "eeeinfo = File.expand_path('eee.info', eeedir)" + f.puts "if File.file?(eeeinfo)" + f.puts " File.open(eeeinfo) do |f|" + f.puts " while line = f.gets" + f.puts " k, v = line.strip.split(/\s*=\s*/, 2)" + f.puts " k.gsub!(/^EEE_/, 'RUBYSCRIPT2EXE_')" + f.puts " v = File.expand_path(v) if k == 'RUBYSCRIPT2EXE_APPEXE'" + f.puts " eval('%s=%s' % [k, v.inspect])" + f.puts " end" + f.puts " end" + f.puts "end" + + f.puts "# Requirements" + f.puts "require 'rubygems'" if RUBYSCRIPT2EXE_RUBYGEMS + + f.puts "# Start the application" + f.puts "RUBYSCRIPT2EXE = '#{rubyexe}'" f.puts "load($0 = ARGV.shift)" end @@ -198,21 +223,21 @@ File.open(tmplocation("app.eee"), "w") do |f| f.puts "r bin" f.puts "r lib" - f.puts "f eee.rb" f.puts "f bootstrap.rb" f.puts "f empty.rb" f.puts "r app" + f.puts "i eee.info" apprb = File.basename(script) if linux? - f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" + f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" elsif darwin? - f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/eee.rb -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" + f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" elsif cygwin? - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/eee.rb -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb} %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb} %quotedparms%" else - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\eee.rb -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\#{apprb} %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\#{apprb} %quotedparms%" end end diff -ur rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/README rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/README --- rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/README 2005-05-06 17:52:21.000000000 +0200 +++ rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/README 2005-05-22 18:09:36.000000000 +0200 @@ -8,7 +8,8 @@ [--rubyscript2exe-nostrip] [--rubyscript2exe-tk] -On Linux and Darwin, there's no difference between ruby and rubyw. +On Linux and Darwin, there's no difference between ruby and +rubyw. For more information, see http://www.erikveen.dds.nl/rubyscript2exe/index.html . diff -ur rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/VERSION 2005-05-21 17:06:06.000000000 +0200 +++ rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/VERSION 2005-06-03 13:16:46.000000000 +0200 @@ -1 +1 @@ -0.3.4 +0.3.5 Binary files rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.3.4.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/CHANGELOG 2005-06-03 13:08:46.000000000 +0200 +++ rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/CHANGELOG 2005-06-14 21:42:20.000000000 +0200 @@ -1,5 +1,11 @@ ---------------------------------------------------------------- +0.3.6 - 14.06.2005 + +* Fixed a bug concerning spaces in %TEMP%. + +---------------------------------------------------------------- + 0.3.5 - 03.06.2005 * Updated to FreePascal 1.9.8 on Windows, 2.0.0 on Linux and diff -ur rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.pas 2005-06-03 13:16:46.000000000 +0200 +++ rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.pas 2005-06-14 21:44:16.000000000 +0200 @@ -63,6 +63,37 @@ {**********************************************************************} +{$IFDEF WIN32} + function GetShortPathNameA(LongName, ShortName: Pchar; ccbuffer: Dword): Dword; stdcall external 'kernel32.dll' name 'GetShortPathNameA'; +{$ENDIF} + +function getshortpathname(dir: String): String; + +{$IFDEF WIN32} + var + longname : pchar; + shortname : pchar; + buffer : dword; +{$ENDIF} + +begin + + {$IFDEF WIN32} + longname := pchar(dir+''); + shortname := pchar(dir+''); + buffer := 255; + + GetShortPathNameA(longname, shortname, buffer); + + dir := shortname; + {$ENDIF} + + getshortpathname := dir; + +end; + +{**********************************************************************} + procedure getdir2(drivenr: byte; var dir: string[255]); begin @@ -71,9 +102,9 @@ getdir(drivenr, dir); {$ELSE} // Foutje indien bovenliggende dirs niet benaderbaar zijn. if (currentdir = '') then begin - currentdir := getenv('EEE_DIR'); + currentdir := getshortpathname(getenv('EEE_DIR')); if (currentdir = '') then begin - currentdir := getenv('PWD'); + currentdir := getshortpathname(getenv('PWD')); end; end; @@ -137,7 +168,7 @@ assign(f, sr.name); erase(f); if (ioresult <> 0) then begin - // writeln('Couldn''t delete file ' + sr.name); + // Somehow, ioresult has to be touched. end; {$I+} @@ -152,7 +183,7 @@ {$I-} rmdir(path + slash); if (ioresult <> 0) then begin - // writeln('Couldn''t delete directory ' + path + ' (Known Error).'); + // Somehow, ioresult has to be touched. end; {$I+} @@ -460,7 +491,7 @@ assign(eeefile, paramstr(1)); reset(eeefile); - exename := getenv('EEE_EXE'); + exename := getshortpathname(getenv('EEE_EXE')); if (exename = '') then begin exename := paramstr(0); end; @@ -833,7 +864,7 @@ currentdir := ''; {$ENDIF} - tempdir := getenv('TEMP'); + tempdir := getshortpathname(getenv('TEMP')); if (tempdir = '') then begin tempdir := '/tmp' end; diff -ur rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/VERSION 2005-06-03 13:16:46.000000000 +0200 +++ rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/VERSION 2005-06-14 21:44:16.000000000 +0200 @@ -1 +1 @@ -0.3.5 +0.3.6 Binary files rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.3.5.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.3.6.tar.gz/rubyscript2exe/eeew.exe differ 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 diff -ur rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/CHANGELOG 2005-08-06 12:59:17.000000000 +0200 +++ rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/CHANGELOG 2005-12-03 14:25:38.000000000 +0100 @@ -1,6 +1,12 @@ ---------------------------------------------------------------- -0.3.7 - 06.08.2005 +0.4.1 - 03.12.2005 + +* Fixed a bug concerning multiline parameters. + +---------------------------------------------------------------- + +0.4.0 - 06.08.2005 * Added better error detection and error reporting in EEE. diff -ur rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-08-06 12:59:36.000000000 +0200 +++ rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-12-03 14:29:03.000000000 +0100 @@ -52,8 +52,8 @@ libs = `ldd #{tempfile}`.split(/\r*\n/).collect{|line| line.split(/\s+/)[3]} if linux? libs = `otool -L #{tempfile}`.split(/\r*\n/)[1..-1].collect{|line| line.split(/\s+/)[1]} if darwin? - libs.each do |lib| - if not lib.nil? and File.file?(lib) and not res.include?(lib) + libs.compact.each do |lib| + if File.file?(lib) and not res.include?(lib) todo << lib res << lib end diff -ur rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/ev/ftools.rb 2005-08-06 12:59:37.000000000 +0200 +++ rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/ftools.rb 2005-12-03 14:29:03.000000000 +0100 @@ -160,7 +160,7 @@ ENV["PATH"].split(/#{sep}/).reverse.each do |d| if File.directory?(d) Dir.new(d).each do |e| - if e.downcase == file.downcase + if (linux? and e == file) or (windows? and e.downcase == file.downcase) res = File.expand_path(e, d) throw :stop end diff -ur rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/init.rb 2005-08-04 22:01:28.000000000 +0200 +++ rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/init.rb 2005-12-03 14:09:32.000000000 +0100 @@ -198,13 +198,19 @@ f.puts "eeedir = File.dirname(__FILE__)" f.puts "eeeinfo = File.expand_path('eee.info', eeedir)" f.puts "if File.file?(eeeinfo)" - f.puts " File.open(eeeinfo) do |f|" - f.puts " while line = f.gets" - f.puts " k, v = line.strip.split(/\s*=\s*/, 2)" - f.puts " k.gsub!(/^EEE_/, 'RUBYSCRIPT2EXE_')" - f.puts " v = File.expand_path(v) if k == 'RUBYSCRIPT2EXE_APPEXE'" - f.puts " eval('%s=%s' % [k, v.inspect])" - f.puts " end" + f.puts " lines = File.open(eeeinfo){|f| f.readlines}" + f.puts " badline = lines.find{|line| line !~ /^EEE_/}" + f.puts " while badline" + f.puts " pos = lines.index(badline)" + f.puts " raise 'Found badline at position 0.' if pos == 0" + f.puts " lines[pos-1..pos] = lines[pos-1] + lines[pos]" + f.puts " badline = lines.find{|line| line !~ /^EEE_/}" + f.puts " end" + f.puts " lines.each do |line|" + f.puts " k, v = line.strip.split(/\s*=\s*/, 2)" + f.puts " k.gsub!(/^EEE_/, 'RUBYSCRIPT2EXE_')" + f.puts " v = File.expand_path(v) if k == 'RUBYSCRIPT2EXE_APPEXE'" + f.puts " eval('%s=%s' % [k, v.inspect])" f.puts " end" f.puts "end" diff -ur rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.4.0.tar.gz/rubyscript2exe/VERSION 2005-08-06 12:59:36.000000000 +0200 +++ rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/VERSION 2005-12-03 14:29:03.000000000 +0100 @@ -1 +1 @@ -0.4.0 +0.4.1 diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/CHANGELOG 2005-12-03 14:25:38.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/CHANGELOG 2006-03-08 17:57:17.000000000 +0100 @@ -1,5 +1,22 @@ ---------------------------------------------------------------- +0.4.2 - 08.03.2006 + +* Got rid of warning "Insecure world writable dir". + +* Fixed a bug concerning parameters with quotes and other + escapable characters. + +* Fixed a bug concerning "Too many open files". + +* Fixed a bug concerning spaced parameters on Linux and Darwin. + +* More DLL's are found and embedded. + +* AllInOneRuby and RubyScript2Exe now work together. + +---------------------------------------------------------------- + 0.4.1 - 03.12.2005 * Fixed a bug concerning multiline parameters. diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/eee.pas 2005-12-03 14:29:03.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/eee.pas 2006-03-08 18:29:17.000000000 +0100 @@ -54,6 +54,7 @@ teller : longint; parms : string; quotedparms : string; + parmslist : string; justextract : boolean; list : boolean; info : boolean; @@ -796,6 +797,7 @@ writeln(infofile, 'EEE_TEMPDIR=' + tempdir); writeln(infofile, 'EEE_PARMS=' + parms); writeln(infofile, 'EEE_QUOTEDPARMS=' + quotedparms); + writeln(infofile, 'EEE_PARMSLIST=' + parmslist); close(infofile); @@ -843,6 +845,7 @@ tekst2 := AnsiReplaceStr(tekst2, '%parms%', parms); tekst2 := AnsiReplaceStr(tekst2, '%quotedparms%', quotedparms); + tekst2 := AnsiReplaceStr(tekst2, '%parmslist%', parmslist); tekst2 := AnsiReplaceStr(tekst2, '%orgdir%', orgdir); tekst2 := AnsiReplaceStr(tekst2, '%tempdir%', tempdir); tekst2 := AnsiReplaceStr(tekst2, '%tempdir1%', workdir1); @@ -1035,6 +1038,7 @@ parms := ''; quotedparms := ''; + parmslist := ''; for teller := 1 to paramcount do begin if (paramstr(teller) = '--eee-justextract') then begin justextract := true; @@ -1048,13 +1052,15 @@ info := true; end; - if ((parms = '') and (quotedparms = '')) then begin + if ((parms = '') and (quotedparms = '') and (parmslist = '')) then begin parms := paramstr(teller); quotedparms := '''' + paramstr(teller) + ''''; + parmslist := paramstr(teller) + #0; end else begin parms := parms + ' ' + paramstr(teller); quotedparms := quotedparms + ' ''' + paramstr(teller) + ''''; + parmslist := parmslist + paramstr(teller) + #0; end; end; diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/dependencies.rb 2005-12-03 14:29:03.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/dependencies.rb 2006-03-08 18:29:17.000000000 +0100 @@ -1,27 +1,47 @@ -def dlls(file, path=File.dirname(file)) +def dlls(file) - # Only the dependencies in the same directory as the executable or the given directory. + # Only the dependencies in the same directory as the executable or any non-Windows directory in %PATH%. todo = [] res = [] todo << File.expand_path(file) + paden = ENV["PATH"].split(/;/) + paden = ENV["PATH"].split(/:/) if paden.length == 1 + + paden << File.dirname(file) + + windir1 = (ENV["WINDIR"] || "").gsub(/\\/, "/").downcase + drive = windir1.scan(/^(.):/).shift.shift + windir2 = windir1.sub(/^#{drive}:/, "/cygdrive/#{drive.downcase}") + + paden = paden.collect{|pad| pad.gsub(/\\/, "/").downcase} + paden = paden.select{|pad| pad.downcase} + paden = paden.reject{|pad| pad =~ /^#{windir1}/} + paden = paden.reject{|pad| pad =~ /^#{windir2}/} + while todo.length > 0 todo2 = todo todo = [] todo2.each do |file| File.open(file, "rb") do |f| - strings = f.read.scan(/[\w\-\.]+/) # Hack ??? - strings.delete_if{|s| s !~ /\.(so|o|dll)$/i} - - strings.each do |lib| - lib = File.expand_path(lib, path) - - if not lib.nil? and File.file?(lib) and not res.include?(lib) - todo << lib - res << lib + while (line = f.gets) + strings = line.scan(/[\w\-\.]+/) # Hack ??? + strings = strings.reject{|s| s !~ /\.(so|o|dll)$/i} + + strings.each do |lib| + pad = paden.find{|pad| File.file?(File.expand_path(lib, pad))} + + unless pad.nil? + lib = File.expand_path(lib, pad) + + if File.file?(lib) and not res.include?(lib) + todo << lib + res << lib + end + end end end end @@ -70,7 +90,7 @@ lsb_ia32 = ["libm.so.6", "libdl.so.2", "libcrypt.so.1", "libc.so.6", "libpthread.so.0", "ld-lsb.so.1"] lsb = lsb_common + lsb_ia32 - res.delete_if{|s| lsb.include?(File.basename(s))} if notthedefaults + res.reject!{|s| lsb.include?(File.basename(s))} if notthedefaults res end diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/ftools.rb 2005-12-03 14:29:03.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/ftools.rb 2006-03-08 18:29:18.000000000 +0100 @@ -9,8 +9,10 @@ File.mkpath(todir) Dir.chdir(from) - Dir.new(".").each do |e| - Dir.copy(e, todir+"/"+e) if not [".", ".."].include?(e) + Dir.open(".") do |dir| + dir.each do |e| + Dir.copy(e, todir+"/"+e) if not [".", ".."].include?(e) + end end Dir.chdir(pdir) else @@ -28,14 +30,19 @@ end def self.rm_rf(entry) - File.chmod(0755, entry) + begin + File.chmod(0755, entry) + rescue + end if File.ftype(entry) == "directory" pdir = Dir.pwd Dir.chdir(entry) - Dir.new(".").each do |e| - Dir.rm_rf(e) if not [".", ".."].include?(e) + Dir.open(".") do |dir| + dir.each do |e| + Dir.rm_rf(e) if not [".", ".."].include?(e) + end end Dir.chdir(pdir) @@ -71,8 +78,10 @@ Dir.chdir(entry) begin - Dir.new(".").each do |e| - res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + Dir.open(".") do |dir| + dir.each do |e| + res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + end end ensure Dir.chdir(pdir) @@ -159,10 +168,12 @@ catch :stop do ENV["PATH"].split(/#{sep}/).reverse.each do |d| if File.directory?(d) - Dir.new(d).each do |e| - if (linux? and e == file) or (windows? and e.downcase == file.downcase) - res = File.expand_path(e, d) - throw :stop + Dir.open(d) do |dir| + dir.each do |e| + if (linux? and e == file) or (windows? and e.downcase == file.downcase) + res = File.expand_path(e, d) + throw :stop + end end end end @@ -171,4 +182,35 @@ res end + + def self.same_content?(file1, file2, blocksize=4096) + res = false + + if File.file?(file1) and File.file?(file2) + res = true + + data1 = nil + data2 = nil + + File.open(file1, "rb") do |f1| + File.open(file2, "rb") do |f2| + catch :not_the_same do + while (data1 = f1.read(blocksize)) + data2 = f2.read(blocksize) + + unless data1 == data2 + res = false + + throw :not_the_same + end + end + + res = false if f2.read(blocksize) + end + end + end + end + + res + end end diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2005-12-03 14:29:03.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2006-03-08 18:29:17.000000000 +0100 @@ -14,8 +14,10 @@ pdir = Dir.pwd Dir.chdir(entry) - Dir.new(".").each do |e| - Dir.rm_rf(e) if not [".", ".."].include?(e) + Dir.open(".") do |dir| + dir.each do |e| + Dir.rm_rf(e) if not [".", ".."].include?(e) + end end Dir.chdir(pdir) diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/init.rb 2005-12-03 14:09:32.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/init.rb 2006-02-04 00:55:33.000000000 +0100 @@ -1,6 +1,8 @@ $: << File.dirname(File.expand_path(__FILE__)) -required = $".collect{|a| "-r '#{a}'"} +required = $" +required = required.reject{|a| File.dirname(a) == ALLINONERUBY_TEMPDIR} if defined?(ALLINONERUBY_TEMPDIR) +required = required.collect{|a| "-r '#{a}'"} require "ev/oldandnewlocation" require "ev/dependencies" @@ -102,6 +104,7 @@ unless File.file?(loadscript) $stderr.puts "Couldn't execute this command (rc=#{$?}):\n#{command}" + exit 16 end end @@ -134,8 +137,8 @@ copyto([oldlocation(script)], appdir2) -copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? -copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file, bindir1)}, bindir2) if windows? or cygwin? +copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? +copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file)}, bindir2) if windows? or cygwin? if TK or defined?(RUBYSCRIPT2EXE_TK) if File.file?("#{libdir2}/tk.rb") @@ -182,7 +185,10 @@ f.puts "bin = dir + '/bin'" f.puts "lib = dir + '/lib'" - f.puts "s = ENV['PATH'].dup" + f.puts "verbose = $VERBOSE" + f.puts "$VERBOSE = nil" + f.puts "s = ENV['PATH'].dup" + f.puts "$VERBOSE = verbose" f.puts "if Dir.pwd[1..2] == ':/'" f.puts " s << (';'+bin.gsub(/\\//, '\\\\'))" f.puts "else" @@ -212,6 +218,7 @@ f.puts " v = File.expand_path(v) if k == 'RUBYSCRIPT2EXE_APPEXE'" f.puts " eval('%s=%s' % [k, v.inspect])" f.puts " end" + f.puts " ARGV.concat(RUBYSCRIPT2EXE_PARMSLIST.split(/\000/))" f.puts "end" f.puts "# Requirements" @@ -238,13 +245,13 @@ apprb = File.basename(script) if linux? - f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" + f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif darwin? - f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T %tempdir%/empty.rb %tempdir%/app/#{apprb} %quotedparms%" + f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif cygwin? - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb} %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb}" else - f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\#{apprb} %quotedparms%" + f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir%\\bootstrap.rb -T1 %tempdir%\\empty.rb %tempdir%\\app\\#{apprb}" end end diff -ur rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/VERSION 2005-12-03 14:29:03.000000000 +0100 +++ rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/VERSION 2006-03-08 18:29:17.000000000 +0100 @@ -1 +1 @@ -0.4.1 +0.4.2 Binary files rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.4.1.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/CHANGELOG 2006-03-08 17:57:17.000000000 +0100 +++ rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/CHANGELOG 2006-06-27 21:00:39.000000000 +0200 @@ -1,5 +1,12 @@ ---------------------------------------------------------------- +0.4.3 - 27.06.2006 + +* Enhanced the support for RubyGems, again... I now use the + real RubyGems, instead of a fake one. + +---------------------------------------------------------------- + 0.4.2 - 08.03.2006 * Got rid of warning "Insecure world writable dir". diff -ur rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/init.rb 2006-02-04 00:55:33.000000000 +0100 +++ rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/init.rb 2006-06-27 20:24:25.000000000 +0200 @@ -221,9 +221,15 @@ f.puts " ARGV.concat(RUBYSCRIPT2EXE_PARMSLIST.split(/\000/))" f.puts "end" - f.puts "# Requirements" + f.puts "# Set the RubyGems environment." - f.puts "require 'rubygems'" if RUBYSCRIPT2EXE_RUBYGEMS + if RUBYSCRIPT2EXE_RUBYGEMS + f.puts "ENV.keys.each do |key|" + f.puts " ENV.delete[key] if key =~ /^gem_/i" + f.puts "end" + f.puts "ENV['GEM_PATH']=lib+'/rubyscript2exe.gems'" + f.puts "require 'rubygems'" + end f.puts "# Start the application" diff -ur rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/require2lib.rb 2006-03-08 18:29:17.000000000 +0100 +++ rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/require2lib.rb 2006-06-27 21:02:19.000000000 +0200 @@ -45,7 +45,7 @@ if RUBYGEMS begin - Gem::dir + Gem.dir rubygems = true rescue NameError rubygems = false @@ -57,42 +57,28 @@ pureruby = true if rubygems - autorequire = {} - dependencies = {} - requirelibs = [] requireablefiles = [] + Dir.mkdir(File.expand_path("rubyscript2exe.gems", LIBDIR)) + Dir.mkdir(File.expand_path("rubyscript2exe.gems/gems", LIBDIR)) + Dir.mkdir(File.expand_path("rubyscript2exe.gems/specifications", LIBDIR)) + Gem::Specification.list.each do |gem| if gem.loaded? $stderr.puts "Found gem #{gem.name} (#{gem.version})." if VERBOSE - fromdir = gem.full_gem_path - todir = File.expand_path(File.join("rubyscript2exe.gems", gem.full_name), LIBDIR) - - Dir.copy(fromdir, todir) + fromdir = File.join(gem.installation_path, "specifications") + todir = File.expand_path("rubyscript2exe.gems/specifications", LIBDIR) - autorequire[gem.name] = gem.autorequire if gem.autorequire + fromfile = File.join(fromdir, "#{gem.full_name}.gemspec") + tofile = File.join(todir, "#{gem.full_name}.gemspec") - dependencies[gem.name] = [] - gem.dependencies.each do |dep| - dependencies[gem.name] << dep.name - end + File.copy(fromfile, tofile) - #gem.require_paths << gem.bindir if gem.bindir - #gem.require_paths.each do |lib| - #lib = File.join("rubyscript2exe.gems", gem.full_name, lib) - #requirelibs << lib unless requirelibs.include?(lib) - #end - - $:.reverse.each do |lib| - gemdir = File.join(Gem.dir, "gems") - if lib =~ /^#{gemdir}/ - lib = lib[(gemdir.size+1)..-1] - lib = File.join("rubyscript2exe.gems", lib) + fromdir = gem.full_gem_path + todir = File.expand_path(File.join("rubyscript2exe.gems/gems", gem.full_name), LIBDIR) - requirelibs << lib unless requirelibs.include?(lib) - end - end + Dir.copy(fromdir, todir) Dir.find(todir).each do |file| if File.file?(file) @@ -108,64 +94,38 @@ end end end - - File.open(File.expand_path("rubygems.rb", LIBDIR), "w") do |f| - f.puts "module Kernel" - f.puts " def require_gem(file, version=nil)" - f.puts " autorequire = %s" % autorequire.inspect - f.puts " dependencies = %s" % dependencies.inspect - f.puts "" - f.puts " (dependencies[file] or []).each do |dep|" - f.puts " require_gem(dep)" - f.puts " end" - f.puts "" - f.puts " if autorequire.include?(file)" - f.puts " file = autorequire[file]" - f.puts " require(file)" - f.puts " end" - f.puts " end" - f.puts "end" - f.puts "" - f.puts "requirelibs = %s" % requirelibs.inspect - f.puts "" - f.puts "requirelibs.each do |lib|" - f.puts " $:.unshift(File.expand_path(lib, File.expand_path(File.dirname(__FILE__))))" - f.puts "end" - end end ($" + $require2lib_loaded).each do |req| - unless req =~ /^rubygems[\.\/]/ - catch :found do - $:.each do |lib| - fromfile = File.expand_path(req, lib) - tofile = File.expand_path(req, LIBDIR) - - if File.file?(fromfile) - unless fromfile == tofile or fromfile == THISFILE - unless (rubygems and requireablefiles.include?(req)) # ??? requireablefiles might be a little dangerous. - if (not JUSTRUBYLIB and not JUSTSITELIB) or - (JUSTRUBYLIB and fromfile.include?(RUBYLIBDIR)) or - (JUSTSITELIB and fromfile.include?(SITELIBDIR)) - $stderr.puts "Found #{fromfile} ." if VERBOSE - - File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) - File.copy(fromfile, tofile) - - pureruby = false unless req =~ /\.(rbw?|ruby)$/i - else - $stderr.puts "Skipped #{fromfile} ." if VERBOSE - end + catch :found do + $:.each do |lib| + fromfile = File.expand_path(req, lib) + tofile = File.expand_path(req, LIBDIR) + + if File.file?(fromfile) + unless fromfile == tofile or fromfile == THISFILE + unless (rubygems and requireablefiles.include?(req)) # ??? requireablefiles might be a little dangerous. + if (not JUSTRUBYLIB and not JUSTSITELIB) or + (JUSTRUBYLIB and fromfile.include?(RUBYLIBDIR)) or + (JUSTSITELIB and fromfile.include?(SITELIBDIR)) + $stderr.puts "Found #{fromfile} ." if VERBOSE + + File.makedirs(File.dirname(tofile)) unless File.directory?(File.dirname(tofile)) + File.copy(fromfile, tofile) + + pureruby = false unless req =~ /\.(rbw?|ruby)$/i + else + $stderr.puts "Skipped #{fromfile} ." if VERBOSE end end - - throw :found end - end - #$stderr.puts "Can't find #{req} ." unless req =~ /^ev\// or QUIET - #$stderr.puts "Can't find #{req} ." unless req =~ /^(\w:)?[\/\\]/ or QUIET + throw :found + end end + + #$stderr.puts "Can't find #{req} ." unless req =~ /^ev\// or QUIET + #$stderr.puts "Can't find #{req} ." unless req =~ /^(\w:)?[\/\\]/ or QUIET end end diff -ur rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.4.2.tar.gz/rubyscript2exe/VERSION 2006-03-08 18:29:17.000000000 +0100 +++ rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/VERSION 2006-06-27 21:02:18.000000000 +0200 @@ -1 +1 @@ -0.4.2 +0.4.3 diff -ur rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/CHANGELOG 2006-06-27 21:00:39.000000000 +0200 +++ rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/CHANGELOG 2006-06-28 17:17:28.000000000 +0200 @@ -1,5 +1,11 @@ ---------------------------------------------------------------- +0.4.4 - 28.06.2006 + +* Fixed a bug concerning "ENV.delete(key)". + +---------------------------------------------------------------- + 0.4.3 - 27.06.2006 * Enhanced the support for RubyGems, again... I now use the diff -ur rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/init.rb 2006-06-27 20:24:25.000000000 +0200 +++ rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/init.rb 2006-06-28 09:57:40.000000000 +0200 @@ -225,7 +225,7 @@ if RUBYSCRIPT2EXE_RUBYGEMS f.puts "ENV.keys.each do |key|" - f.puts " ENV.delete[key] if key =~ /^gem_/i" + f.puts " ENV.delete(key) if key =~ /^gem_/i" f.puts "end" f.puts "ENV['GEM_PATH']=lib+'/rubyscript2exe.gems'" f.puts "require 'rubygems'" diff -ur rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.4.3.tar.gz/rubyscript2exe/VERSION 2006-06-27 21:02:18.000000000 +0200 +++ rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/VERSION 2006-06-28 17:18:44.000000000 +0200 @@ -1 +1 @@ -0.4.3 +0.4.4 diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/CHANGELOG 2006-06-28 17:17:28.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/CHANGELOG 2006-07-29 20:27:05.000000000 +0200 @@ -1,5 +1,25 @@ ---------------------------------------------------------------- +0.5.0 - 29.07.2006 + +* Added support for directories. + +* Introduced require "rubyscript2exe.rb". + +* Added a check for readability in EEE. + +* Replaced RUBYSCRIPT2EXE_* by RUBYSCRIPT.*= and + RUBYSCRIPT2EXE::* (see application.rb). + +* Added RUBYSCRIPT2EXE.appdir(item) and + RUBYSCRIPT2EXE.is_compil*?. + +* If you already used RubyScript2Exe before, please reread the + section "From Inside your Application", since it isn't 100% + backwards compatible. + +---------------------------------------------------------------- + 0.4.4 - 28.06.2006 * Fixed a bug concerning "ENV.delete(key)". diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/eee.pas 2006-06-28 17:18:44.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/eee.pas 2006-07-29 20:28:12.000000000 +0200 @@ -812,6 +812,7 @@ infile : file of byte; outfile : file of byte; i : longint; + n : longint; begin @@ -837,9 +838,11 @@ for i := 1 to t.number do begin {$I-} - gzread(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t read: "' + workfile + '"'); + n := gzread(zfile, addr(h), sizeof(h)); if (ioresult <> 0) then error('Couldn''t read: "' + workfile + '"'); {$I+} + if (n <> sizeof(h)) then error('Couldn''t read: "' + workfile + '"'); + klasse := h.klasse; tekst2 := h.tekst; diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/init.rb 2006-06-28 09:57:40.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/init.rb 2006-07-29 18:39:59.000000000 +0200 @@ -1,7 +1,12 @@ +$".delete "rubyscript2exe.rb" +require "rubyscript2exe" + +if __FILE__ == $0 + $: << File.dirname(File.expand_path(__FILE__)) required = $" -required = required.reject{|a| File.dirname(a) == ALLINONERUBY_TEMPDIR} if defined?(ALLINONERUBY_TEMPDIR) +required = required.reject{|a| File.dirname(a) == ALLINONERUBY::TEMPDIR} if defined?(ALLINONERUBY::TEMPDIR) required = required.collect{|a| "-r '#{a}'"} require "ev/oldandnewlocation" @@ -9,7 +14,7 @@ require "ev/ftools" require "rbconfig" -exit if defined?(REQUIRE2LIB) +exit if RUBYSCRIPT2EXE.is_compiling? def backslashes(s) s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? @@ -41,6 +46,7 @@ tofile = File.expand_path(File.basename(fromfile), dest) $stderr.puts "Copying #{fromfile} ..." if VERBOSE + File.copy(fromfile, tofile) unless File.file?(tofile) end end @@ -61,7 +67,9 @@ usagescript = "rubyscript2exe.rb" if defined?(TAR2RUBYSCRIPT) $stderr.puts <<-EOF - Usage: ruby #{usagescript} application[.rb[w]] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + Usage: ruby #{usagescript} application.rb[w] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + or + ruby #{usagescript} application[/] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] On Linux and Darwin, there's no difference between ruby and rubyw. @@ -83,7 +91,6 @@ libdir2 = tmplocation("lib/") appdir2 = tmplocation("app/") -script = "#{script}.rb" unless script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) $stderr.puts "Tracing #{app} ..." unless QUIET @@ -98,12 +105,28 @@ ENV["REQUIRE2LIB_LOADSCRIPT"] = loadscript oldlocation do - command = backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{script}' #{verbose} #{quiet} #{argv.join(" ")}" + unless File.exist?(script) + $stderr.puts "#{script} doesn't exist." + + exit 1 + end + + apprb = script if File.file?(script) + apprb = "#{script}/init.rb" if File.directory?(script) + + unless File.file?(apprb) + $stderr.puts "#{apprb} doesn't exist." + + exit 1 + end + + command = backslashes("#{bindir1}/ruby") + " #{required.join(" ")} #{libs.join(" ")} -r '#{newlocation("require2lib.rb")}' '#{apprb}' #{verbose} #{quiet} #{argv.join(" ")}" system(command) unless File.file?(loadscript) $stderr.puts "Couldn't execute this command (rc=#{$?}):\n#{command}" + $stderr.puts "Stopped." exit 16 end @@ -124,23 +147,24 @@ $stderr.puts "Copying files..." unless QUIET -copyto([RUBYSCRIPT2EXE_DLLS].flatten.collect{|s| oldlocation(s)}, bindir2) if defined?(RUBYSCRIPT2EXE_DLLS) -copyto([RUBYSCRIPT2EXE_BIN].flatten.collect{|s| oldlocation(s)}, bindir2) if defined?(RUBYSCRIPT2EXE_BIN) -copyto([RUBYSCRIPT2EXE_LIB].flatten.collect{|s| oldlocation(s)}, libdir2) if defined?(RUBYSCRIPT2EXE_LIB) - -copyto(rubyexe, bindir2) if linux? or darwin? if File.file?(rubyexe) -copyto(ldds(rubyexe), bindir2) if linux? or darwin? - -copyto(rubyexe, bindir2) if windows? or cygwin? if File.file?(rubyexe) -copyto(rubywexe, bindir2) if windows? or cygwin? if File.file?(rubyexe) -copyto(dlls(rubyexe), bindir2) if windows? or cygwin? +copyto([RUBYSCRIPT2EXE::DLLS].flatten.collect{|s| oldlocation(s)}, bindir2) +copyto([RUBYSCRIPT2EXE::BIN].flatten.collect{|s| oldlocation(s)}, bindir2) +copyto([RUBYSCRIPT2EXE::LIB].flatten.collect{|s| oldlocation(s)}, libdir2) + +copyto(rubyexe, bindir2) if (linux? or darwin?) and File.file?(rubyexe) +copyto(ldds(rubyexe), bindir2) if (linux? or darwin?) + +copyto(rubyexe, bindir2) if (windows? or cygwin?) and File.file?(rubyexe) +copyto(rubywexe, bindir2) if (windows? or cygwin?) and File.file?(rubywexe) +copyto(dlls(rubyexe), bindir2) if (windows? or cygwin?) and File.file?(rubyexe) -copyto([oldlocation(script)], appdir2) +copyto(oldlocation(script), appdir2) if File.file?(oldlocation(script)) +Dir.copy(oldlocation(script), appdir2) if File.directory?(oldlocation(script)) copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file)}, bindir2) if windows? or cygwin? -if TK or defined?(RUBYSCRIPT2EXE_TK) +if TK or RUBYSCRIPT2EXE::TK if File.file?("#{libdir2}/tk.rb") $stderr.puts "Copying TCL/TK..." unless QUIET @@ -180,10 +204,15 @@ File.open(tmplocation("bootstrap.rb"), "w") do |f| f.puts "# Set up the environment" + f.puts "module RUBYSCRIPT2EXE" + f.puts "end" + f.puts "dir = File.expand_path(File.dirname(__FILE__))" f.puts "dir.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if dir =~ /^.:/" if cygwin? - f.puts "bin = dir + '/bin'" - f.puts "lib = dir + '/lib'" + f.puts "bin = dir + '/bin'" + f.puts "lib = dir + '/lib'" + f.puts "appbin = dir + '/app/bin'" + f.puts "applib = dir + '/app/lib'" f.puts "verbose = $VERBOSE" f.puts "$VERBOSE = nil" @@ -198,6 +227,7 @@ f.puts "$:.clear" f.puts "$: << lib" + f.puts "$: << applib" f.puts "# Load eee.info" @@ -214,16 +244,16 @@ f.puts " end" f.puts " lines.each do |line|" f.puts " k, v = line.strip.split(/\s*=\s*/, 2)" - f.puts " k.gsub!(/^EEE_/, 'RUBYSCRIPT2EXE_')" - f.puts " v = File.expand_path(v) if k == 'RUBYSCRIPT2EXE_APPEXE'" - f.puts " eval('%s=%s' % [k, v.inspect])" + f.puts " k.gsub!(/^EEE_/, '')" + f.puts " v = File.expand_path(v) if k == 'APPEXE'" + f.puts " RUBYSCRIPT2EXE.module_eval{const_set(k, v)}" f.puts " end" - f.puts " ARGV.concat(RUBYSCRIPT2EXE_PARMSLIST.split(/\000/))" + f.puts " ARGV.concat(RUBYSCRIPT2EXE::PARMSLIST.split(/\000/))" f.puts "end" f.puts "# Set the RubyGems environment." - if RUBYSCRIPT2EXE_RUBYGEMS + if RUBYSCRIPT2EXE::RUBYGEMS f.puts "ENV.keys.each do |key|" f.puts " ENV.delete(key) if key =~ /^gem_/i" f.puts "end" @@ -231,9 +261,13 @@ f.puts "require 'rubygems'" end + f.puts "module RUBYSCRIPT2EXE" + f.puts " RUBYEXE = '#{rubyexe}'" + f.puts " COMPILED = true" + f.puts "end" + f.puts "# Start the application" - f.puts "RUBYSCRIPT2EXE = '#{rubyexe}'" f.puts "load($0 = ARGV.shift)" end @@ -248,8 +282,10 @@ f.puts "r app" f.puts "i eee.info" - apprb = File.basename(script) + apprb = File.basename(script) if File.file?(oldlocation(script)) + apprb = "init.rb" if File.directory?(oldlocation(script)) + # ??? nog iets met app/bin? if linux? f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif darwin? @@ -261,6 +297,18 @@ end end +too_long = File.read(tmplocation(appeee)).split(/\r*\n/).select{|line| line.length > 255} + +unless too_long.empty? + too_long.each do |line| + $stderr.puts "Line is too long (#{line.length}): #{line}" + end + + $stderr.puts "Stopped." + + exit 16 +end + from = newlocation(eeeexe) from = applocation(eeeexe) unless File.file?(from) from = oldlocation(eeeexe) unless File.file?(from) @@ -272,7 +320,7 @@ tmplocation do ENV["EEE_EXE"] = eeeexe ENV["EEE_DIR"] = Dir.pwd - ENV["EEE_TEMPDIR"] = RUBYSCRIPT2EXE_TEMPDIR if defined?(RUBYSCRIPT2EXE_TEMPDIR) + ENV["EEE_TEMPDIR"] = RUBYSCRIPT2EXE::TEMPDIR if RUBYSCRIPT2EXE::TEMPDIR eeebin1 = newlocation("eee.exe") eeebin1 = newlocation("eee_linux") if linux? @@ -311,3 +359,5 @@ oldlocation do system(backslashes("reshacker -modify #{tmplocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) and (windows? or cygwin?) end + +end # if __FILE__ == $0 diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/require2lib.rb 2006-06-28 17:18:44.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/require2lib.rb 2006-07-29 20:28:12.000000000 +0200 @@ -3,25 +3,16 @@ exit if __FILE__ == $0 -$require2lib_loaded = [] - -REQUIRE2LIB = true unless defined?(REQUIRE2LIB) - -module Kernel - alias :old_load :load - def load(filename, wrap=false) - $require2lib_loaded << filename unless $require2lib_loaded.include?(filename) - - old_load(filename, wrap) - end +module RUBYSCRIPT2EXE end -module Require +module REQUIRE2LIB JUSTRUBYLIB = ARGV.include?("--require2lib-justrubylib") JUSTSITELIB = ARGV.include?("--require2lib-justsitelib") RUBYGEMS = (not JUSTRUBYLIB) VERBOSE = ARGV.include?("--require2lib-verbose") QUIET = (ARGV.include?("--require2lib-quiet") and not VERBOSE) + LOADED = [] ARGV.delete_if{|arg| arg =~ /^--require2lib-/} @@ -35,7 +26,7 @@ at_exit do Dir.chdir(ORGDIR) - Require.gatherlibs + REQUIRE2LIB.gatherlibs end def self.gatherlibs @@ -57,6 +48,8 @@ pureruby = true if rubygems + require "fileutils" # Hack ??? + requireablefiles = [] Dir.mkdir(File.expand_path("rubyscript2exe.gems", LIBDIR)) @@ -96,7 +89,7 @@ end end - ($" + $require2lib_loaded).each do |req| + ($" + LOADED).each do |req| catch :found do $:.each do |lib| fromfile = File.expand_path(req, lib) @@ -133,12 +126,23 @@ unless LOADSCRIPT == ORGDIR File.open(LOADSCRIPT, "w") do |f| - 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}" + f.puts "module RUBYSCRIPT2EXE" + RUBYSCRIPT2EXE.class_variables.each do |const| + const = const[2..-1] + f.puts " #{const.upcase}=#{RUBYSCRIPT2EXE.send(const).inspect}" + end + f.puts " RUBYGEMS=#{rubygems.inspect}" + f.puts "end" end end end end + +module Kernel + alias :old_load :load + def load(filename, wrap=false) + REQUIRE2LIB::LOADED << filename unless REQUIRE2LIB::LOADED.include?(filename) + + old_load(filename, wrap) + end +end diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/rubyscript2exe.rb rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/rubyscript2exe.rb --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/rubyscript2exe.rb 2007-05-30 10:18:06.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/rubyscript2exe.rb 2006-07-29 20:28:11.000000000 +0200 @@ -0,0 +1,47 @@ +module RUBYSCRIPT2EXE + @@dlls = [] + @@bin = [] + @@lib = [] + @@tempdir = nil + @@tk = false + + def self.dlls ; @@dlls ; end + def self.dlls=(a) ; @@dlls = a ; end + + def self.bin ; @@bin ; end + def self.bin=(a) ; @@bin = a ; end + + def self.lib ; @@lib ; end + def self.lib=(a) ; @@lib = a ; end + + def self.tempdir ; @@tempdir ; end + def self.tempdir=(s) ; @@tempdir = s ; end + + def self.tk ; @@tk ; end + def self.tk=(b) ; @@tk = b ; end + + def self.appdir(file=nil, &block) + dir = File.dirname(File.expand_path($0)) + dir = File.expand_path(File.join(TEMPDIR, "app")) if not defined?(TAR2RUBYSCRIPT) and is_compiled? and defined?(TEMPDIR) + + if block + pdir = Dir.pwd + + Dir.chdir(dir) + res = block[] + Dir.chdir(pdir) + else + res = File.join(*([dir, file].compact)) + end + + res + end + + def self.is_compiling? + defined?(REQUIRE2LIB) + end + + def self.is_compiled? + defined?(COMPILED) + end +end diff -ur rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/VERSION 2006-06-28 17:18:44.000000000 +0200 +++ rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/VERSION 2006-07-29 20:28:11.000000000 +0200 @@ -1 +1 @@ -0.4.4 +0.5.0 Binary files rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.4.4.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/CHANGELOG 2006-07-29 20:27:05.000000000 +0200 +++ rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/CHANGELOG 2006-08-06 19:32:36.000000000 +0200 @@ -1,5 +1,25 @@ ---------------------------------------------------------------- +0.5.1 - 06.08.2006 + +* Fixed a bug when using the big rubyscript2exe.rb (the RBA) as + library. + +* Fixed a bug in RUBYSCRIPT2EXE.appdir. Added + RUBYSCRIPT2EXE.userdir. + +* Added RUBYSCRIPT2EXE.rubyw=. + +* Added RUBYSCRIPT2EXE.strip=. + +* Added RUBYSCRIPT2EXE.appdir and RUBYSCRIPT2EXE.appdir("bin") + to ENV["PATH"]. + +* Added RUBYSCRIPT2EXE.appdir and RUBYSCRIPT2EXE.appdir("lib") + to $:. + +---------------------------------------------------------------- + 0.5.0 - 29.07.2006 * Added support for directories. diff -ur rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/init.rb 2006-07-29 18:39:59.000000000 +0200 +++ rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/init.rb 2006-08-06 18:40:35.000000000 +0200 @@ -1,9 +1,16 @@ +$: << File.dirname(File.expand_path(__FILE__)) + $".delete "rubyscript2exe.rb" -require "rubyscript2exe" -if __FILE__ == $0 +if defined?(oldlocation) + oldlocation do + require "rubyscript2exe" + end +else + require "rubyscript2exe" +end -$: << File.dirname(File.expand_path(__FILE__)) +if __FILE__ == $0 required = $" required = required.reject{|a| File.dirname(a) == ALLINONERUBY::TEMPDIR} if defined?(ALLINONERUBY::TEMPDIR) @@ -53,7 +60,8 @@ RUBY = ARGV.include?("--rubyscript2exe-ruby") RUBYW = ARGV.include?("--rubyscript2exe-rubyw") -STRIP = (not ARGV.include?("--rubyscript2exe-nostrip")) +NOSTRIP = ARGV.include?("--rubyscript2exe-nostrip") +STRACE = ARGV.include?("--rubyscript2exe-strace") TK = ARGV.include?("--rubyscript2exe-tk") VERBOSE = ARGV.include?("--rubyscript2exe-verbose") QUIET = (ARGV.include?("--rubyscript2exe-quiet") and not VERBOSE) @@ -80,11 +88,6 @@ exit 1 end -rubyw = false -rubyw = true if script =~ /\.rbw$/ -rubyw = false if RUBY -rubyw = true if RUBYW - bindir1 = Config::CONFIG["bindir"] libdir1 = Config::CONFIG["libdir"] bindir2 = tmplocation("bin/") @@ -138,6 +141,12 @@ Dir.mkdir(libdir2) unless File.directory?(libdir2) Dir.mkdir(appdir2) unless File.directory?(appdir2) +rubyw = false +rubyw = true if script =~ /\.rbw$/ +rubyw = true if RUBYSCRIPT2EXE::RUBYW +rubyw = false if RUBY +rubyw = true if RUBYW + if linux? or darwin? rubyexe = "#{bindir1}/ruby" else @@ -178,7 +187,7 @@ end end -if STRIP and (linux? or darwin?) +if not NOSTRIP and RUBYSCRIPT2EXE::STRIP and (linux? or darwin?) $stderr.puts "Stripping..." unless QUIET system("cd #{bindir2} ; strip --strip-all * 2> /dev/null") @@ -198,21 +207,26 @@ appexe = "#{app}_linux" if linux? appexe = "#{app}_darwin" if darwin? appico = "#{app}.ico" +strace = "" +strace = "strace" if STRACE $stderr.puts "Creating #{appexe} ..." unless QUIET File.open(tmplocation("bootstrap.rb"), "w") do |f| f.puts "# Set up the environment" + f.puts "# Define some RUBYSCRIPT2EXE constants" + f.puts "module RUBYSCRIPT2EXE" + f.puts " RUBYEXE = '#{rubyexe}'" + f.puts " COMPILED = true" + f.puts " USERDIR = Dir.pwd" f.puts "end" f.puts "dir = File.expand_path(File.dirname(__FILE__))" f.puts "dir.sub!(/^.:/, '/cygdrive/%s' % $&[0..0].downcase) if dir =~ /^.:/" if cygwin? f.puts "bin = dir + '/bin'" f.puts "lib = dir + '/lib'" - f.puts "appbin = dir + '/app/bin'" - f.puts "applib = dir + '/app/lib'" f.puts "verbose = $VERBOSE" f.puts "$VERBOSE = nil" @@ -227,7 +241,6 @@ f.puts "$:.clear" f.puts "$: << lib" - f.puts "$: << applib" f.puts "# Load eee.info" @@ -251,7 +264,7 @@ f.puts " ARGV.concat(RUBYSCRIPT2EXE::PARMSLIST.split(/\000/))" f.puts "end" - f.puts "# Set the RubyGems environment." + f.puts "# Set the RubyGems environment" if RUBYSCRIPT2EXE::RUBYGEMS f.puts "ENV.keys.each do |key|" @@ -261,11 +274,6 @@ f.puts "require 'rubygems'" end - f.puts "module RUBYSCRIPT2EXE" - f.puts " RUBYEXE = '#{rubyexe}'" - f.puts " COMPILED = true" - f.puts "end" - f.puts "# Start the application" f.puts "load($0 = ARGV.shift)" @@ -287,7 +295,7 @@ # ??? nog iets met app/bin? if linux? - f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" + f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; #{strace} %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif darwin? f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif cygwin? diff -ur rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/rubyscript2exe.rb rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/rubyscript2exe.rb --- rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/rubyscript2exe.rb 2006-07-29 20:28:11.000000000 +0200 +++ rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/rubyscript2exe.rb 2006-08-06 19:33:04.000000000 +0200 @@ -4,6 +4,10 @@ @@lib = [] @@tempdir = nil @@tk = false + @@rubyw = false + @@strip = true + + USERDIR = (defined?(oldlocation) ? oldlocation : Dir.pwd) unless defined?(self.const_defined?(USERDIR)) def self.dlls ; @@dlls ; end def self.dlls=(a) ; @@dlls = a ; end @@ -20,10 +24,26 @@ def self.tk ; @@tk ; end def self.tk=(b) ; @@tk = b ; end + def self.rubyw ; @@rubyw ; end + def self.rubyw=(b) ; @@rubyw = b ; end + + def self.strip ; @@strip ; end + def self.strip=(b) ; @@strip = b ; end + def self.appdir(file=nil, &block) - dir = File.dirname(File.expand_path($0)) - dir = File.expand_path(File.join(TEMPDIR, "app")) if not defined?(TAR2RUBYSCRIPT) and is_compiled? and defined?(TEMPDIR) + dir = File.dirname(File.expand_path($0, USERDIR)) + dir = File.expand_path(File.join(TEMPDIR, "app")) if is_compiled? and defined?(TEMPDIR) + + _use_given_dir(dir, file, &block) + end + + def self.userdir(file=nil, &block) + dir = USERDIR + _use_given_dir(USERDIR, file, &block) + end + + def self._use_given_dir(dir, file, &block) if block pdir = Dir.pwd @@ -36,6 +56,9 @@ res end + class << self + private :_use_given_dir + end def self.is_compiling? defined?(REQUIRE2LIB) @@ -44,4 +67,20 @@ def self.is_compiled? defined?(COMPILED) end + + verbose = $VERBOSE + $VERBOSE = nil + s = ENV["PATH"].dup + $VERBOSE = verbose + if Dir.pwd[1..2] == ":/" + s << (";"+appdir.gsub(/\//, "\\")) + s << (";"+appdir("bin").gsub(/\//, "\\")) + else + s << (":"+appdir) + s << (":"+appdir("bin")) + end + ENV["PATH"] = s + + $: << appdir + $: << appdir("lib") end diff -ur rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.5.0.tar.gz/rubyscript2exe/VERSION 2006-07-29 20:28:11.000000000 +0200 +++ rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/VERSION 2006-08-06 19:33:04.000000000 +0200 @@ -1 +1 @@ -0.5.0 +0.5.1 diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/CHANGELOG 2006-08-06 19:32:36.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/CHANGELOG 2007-04-15 21:04:06.000000000 +0200 @@ -1,12 +1,30 @@ ---------------------------------------------------------------- +0.5.2 - 15.04.2007 + +* Fixed a bug when using the gem as library. + +* Fixed a bug concerning RUBYSCRIPT2EXE.userdir(file) (as well + as RUBYSCRIPT2EXE.appdir(file)) and full pathnames. + +* Replaced %TEMP% by %HOME%/eee, or %USERPROFILE%/eee, or + %TEMP%/eee, or c:/eee (on Windows). Replaced /tmp by + $HOME/.eee, or /tmp/.eee (on Linux/Darwin). This is to avoid + "Insecure world writable dir". + +* Introduced RUBYSCRIPT2EXE.exedir and + RUBYSCRIPT2EXE.executable. + +---------------------------------------------------------------- + 0.5.1 - 06.08.2006 * Fixed a bug when using the big rubyscript2exe.rb (the RBA) as library. -* Fixed a bug in RUBYSCRIPT2EXE.appdir. Added - RUBYSCRIPT2EXE.userdir. +* Fixed a bug in RUBYSCRIPT2EXE.appdir. + +* Added RUBYSCRIPT2EXE.userdir. * Added RUBYSCRIPT2EXE.rubyw=. diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/eee.pas rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/eee.pas --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/eee.pas 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/eee.pas 2007-04-15 21:31:50.000000000 +0200 @@ -1079,11 +1079,31 @@ appname := t.appname; end; - temp := getshortpathname(getenv('TEMP')); + temp := getshortpathname(getenv('HOME')); if (temp = '') then begin - temp := '/tmp' + temp := getshortpathname(getenv('USERPROFILE')); + if (temp = '') then begin + temp := getshortpathname(getenv('TEMP')); + if (temp = '') then begin + {$IFDEF WIN32} + temp := 'c:'; + {$ELSE} + temp := '/tmp'; + {$ENDIF} + end; + end; end; + {$IFDEF WIN32} + temp := temp + slash + 'eee'; + {$ELSE} + temp := temp + slash + '.eee'; + {$ENDIF} + + {$I-} + mkdir(temp); if (ioresult <> 0) then; + {$I+} + getdir2(0, orgdir); chdir2(temp, false); {$I-} diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/dependencies.rb 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/dependencies.rb 2007-04-15 21:31:49.000000000 +0200 @@ -12,7 +12,7 @@ paden << File.dirname(file) - windir1 = (ENV["WINDIR"] || "").gsub(/\\/, "/").downcase + windir1 = (ENV["SYSTEMROOT"] || ENV["WINDIR"] || "").gsub(/\\/, "/").downcase drive = windir1.scan(/^(.):/).shift.shift windir2 = windir1.sub(/^#{drive}:/, "/cygdrive/#{drive.downcase}") @@ -72,6 +72,8 @@ libs = `ldd #{tempfile}`.split(/\r*\n/).collect{|line| line.split(/\s+/)[3]} if linux? libs = `otool -L #{tempfile}`.split(/\r*\n/)[1..-1].collect{|line| line.split(/\s+/)[1]} if darwin? + libs ||= [] + libs.compact.each do |lib| if File.file?(lib) and not res.include?(lib) todo << lib diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/ftools.rb 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/ftools.rb 2007-04-15 21:31:50.000000000 +0200 @@ -62,6 +62,7 @@ def self.find(entry=nil, mask=nil) entry = "." if entry.nil? + entry = entry.to_s entry = entry.gsub(/[\/\\]*$/, "") unless entry.nil? @@ -95,58 +96,57 @@ res.sort end -end -class File - def self.rollbackup(file, mode=nil) - backupfile = file + ".RB.BACKUP" - controlfile = file + ".RB.CONTROL" - res = nil + def self.home(*args, &block) + dir = nil - File.touch(file) unless File.file?(file) + dir ||= ENV["HOME"] + dir ||= ENV["USERPROFILE"] + dir ||= "c:/" - # Rollback + handle_home_and_temp(dir, *args, &block) + end - if File.file?(backupfile) and File.file?(controlfile) - $stderr.puts "Restoring #{file}..." + def self.temp(*args, &block) + dir = nil - File.copy(backupfile, file) # Rollback from phase 3 - end + dir ||= ENV["TMPDIR"] + dir ||= ENV["TMP"] + dir ||= ENV["TEMP"] + dir ||= "/tmp" - # Reset + handle_home_and_temp(dir, *args, &block) + end - File.delete(backupfile) if File.file?(backupfile) # Reset from phase 2 or 3 - File.delete(controlfile) if File.file?(controlfile) # Reset from phase 3 or 4 + private - # Backup + def self.handle_home_and_temp(dir, *args, &block) + file = File.join(*args) + file = file.gsub(/\\/, "/") + file = file.gsub(/\/+/, "/") + file = file.gsub(/^\/+/, "") + file = file.gsub(/\/+$/, "") + + dir = dir.gsub(/\\/, "/") + dir = dir.gsub(/\/+/, "/") + dir = dir.gsub(/\/+$/, "") + dir = File.expand_path(file, dir) - File.copy(file, backupfile) # Enter phase 2 - File.touch(controlfile) # Enter phase 3 + res = dir - # The real thing + if block + pdir = Dir.pwd - if block_given? - if mode.nil? - res = yield - else - File.open(file, mode) do |f| - res = yield(f) - end - end + Dir.chdir(dir) # Ruby 1.6 doesn't handle Dir.chdir(&block). + res = block.call(res) + Dir.chdir(pdir) end - # Cleanup - - File.delete(backupfile) # Enter phase 4 - File.delete(controlfile) # Enter phase 5 - - # Return, like File.open - - res = File.open(file, (mode or "r")) unless block_given? - res end +end +class File def self.touch(file) if File.exists?(file) File.utime(Time.now, File.mtime(file), file) diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/oldandnewlocation.rb 2007-04-15 21:31:49.000000000 +0200 @@ -1,3 +1,5 @@ +require "rubyscript2exe" + temp = File.expand_path((ENV["TMPDIR"] or ENV["TMP"] or ENV["TEMP"] or "/tmp").gsub(/\\/, "/")) dir = "#{temp}/oldandnewlocation.#{Process.pid}" @@ -40,7 +42,7 @@ oldlocation rescue NameError def oldlocation(file="") - dir = ENV["OLDDIR"] + dir = (ENV["OLDDIR"] || RUBYSCRIPT2EXE.userdir) rescue "." res = nil if block_given? @@ -61,7 +63,7 @@ newlocation rescue NameError def newlocation(file="") - dir = ENV["NEWDIR"] + dir = (ENV["NEWDIR"] || RUBYSCRIPT2EXE.appdir) rescue "." res = nil if block_given? @@ -82,7 +84,7 @@ applocation rescue NameError def applocation(file="") - dir = ENV["APPDIR"] + dir = (ENV["APPDIR"] || RUBYSCRIPT2EXE.appdir) rescue "." res = nil if block_given? diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/init.rb 2006-08-06 18:40:35.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/init.rb 2007-04-10 20:06:14.000000000 +0200 @@ -1,12 +1,6 @@ -$: << File.dirname(File.expand_path(__FILE__)) - -$".delete "rubyscript2exe.rb" - -if defined?(oldlocation) - oldlocation do - require "rubyscript2exe" - end -else +begin + load File.join(File.dirname(__FILE__), "rubyscript2exe.rb") +rescue LoadError require "rubyscript2exe" end @@ -75,9 +69,27 @@ usagescript = "rubyscript2exe.rb" if defined?(TAR2RUBYSCRIPT) $stderr.puts <<-EOF - Usage: ruby #{usagescript} application.rb[w] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + Usage: ruby #{usagescript} application.rb[w] [parameters] or - ruby #{usagescript} application[/] [--rubyscript2exe-rubyw|--rubyscript2exe-ruby] [--rubyscript2exe-nostrip] + ruby #{usagescript} application[/] [parameters] + + Where parameter is on of the following: + + --rubyscript2exe-rubyw Avoid the popping up of a DOS box. (It's + annoying in the test period... No puts and + p anymore... Only use it for distributing + your application. See Logging.) + --rubyscript2exe-ruby Force the popping up of a DOS box (default). + --rubyscript2exe-nostrip Avoid stripping. The binaries (ruby and + *.so) on Linux and Darwin are stripped by + default to reduce the size of the resulting + executable. + --rubyscript2exe-strace Start the embedded application with strace + (Linux only, for debugging only). + --rubyscript2exe-tk (experimental) Embed not only the Ruby + bindings for TK, but TK itself as well. + --rubyscript2exe-verbose Verbose mode. + --rubyscript2exe-quiet Quiet mode. On Linux and Darwin, there's no difference between ruby and rubyw. @@ -143,7 +155,7 @@ rubyw = false rubyw = true if script =~ /\.rbw$/ -rubyw = true if RUBYSCRIPT2EXE::RUBYW +rubyw = true if RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:rubyw] rubyw = false if RUBY rubyw = true if RUBYW @@ -156,9 +168,9 @@ $stderr.puts "Copying files..." unless QUIET -copyto([RUBYSCRIPT2EXE::DLLS].flatten.collect{|s| oldlocation(s)}, bindir2) -copyto([RUBYSCRIPT2EXE::BIN].flatten.collect{|s| oldlocation(s)}, bindir2) -copyto([RUBYSCRIPT2EXE::LIB].flatten.collect{|s| oldlocation(s)}, libdir2) +copyto([RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:dlls]].flatten.collect{|s| oldlocation(s)}, bindir2) +copyto([RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:bin]].flatten.collect{|s| oldlocation(s)}, bindir2) +copyto([RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:lib]].flatten.collect{|s| oldlocation(s)}, libdir2) copyto(rubyexe, bindir2) if (linux? or darwin?) and File.file?(rubyexe) copyto(ldds(rubyexe), bindir2) if (linux? or darwin?) @@ -173,7 +185,7 @@ copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file)}, bindir2) if windows? or cygwin? -if TK or RUBYSCRIPT2EXE::TK +if TK or RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:tk] if File.file?("#{libdir2}/tk.rb") $stderr.puts "Copying TCL/TK..." unless QUIET @@ -187,7 +199,7 @@ end end -if not NOSTRIP and RUBYSCRIPT2EXE::STRIP and (linux? or darwin?) +if not NOSTRIP and RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:strip] and (linux? or darwin?) $stderr.puts "Stripping..." unless QUIET system("cd #{bindir2} ; strip --strip-all * 2> /dev/null") @@ -264,9 +276,9 @@ f.puts " ARGV.concat(RUBYSCRIPT2EXE::PARMSLIST.split(/\000/))" f.puts "end" - f.puts "# Set the RubyGems environment" + if RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:rubygems] + f.puts "# Set the RubyGems environment" - if RUBYSCRIPT2EXE::RUBYGEMS f.puts "ENV.keys.each do |key|" f.puts " ENV.delete(key) if key =~ /^gem_/i" f.puts "end" @@ -295,9 +307,11 @@ # ??? nog iets met app/bin? if linux? - f.puts "c PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; #{strace} %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" + f.puts "t chmod +x %tempdir%/bin/*" + f.puts "c export PATH=%tempdir%/bin:$PATH ; export LD_LIBRARY_PATH=%tempdir%/bin:$LD_LIBRARY_PATH ; #{strace} %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif darwin? - f.puts "c PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; chmod +x %tempdir%/bin/* ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" + f.puts "t chmod +x %tempdir%/bin/*" + f.puts "c export PATH=%tempdir%/bin:$PATH ; export DYLD_LIBRARY_PATH=%tempdir%/bin:$DYLD_LIBRARY_PATH ; %tempdir%/bin/#{rubyexe} -r %tempdir%/bootstrap.rb -T1 %tempdir%/empty.rb %tempdir%/app/#{apprb}" elsif cygwin? f.puts "c %tempdir%\\bin\\#{rubyexe} -r %tempdir1%/bootstrap.rb -T1 %tempdir1%/empty.rb %tempdir1%/app/#{apprb}" else @@ -328,7 +342,7 @@ tmplocation do ENV["EEE_EXE"] = eeeexe ENV["EEE_DIR"] = Dir.pwd - ENV["EEE_TEMPDIR"] = RUBYSCRIPT2EXE::TEMPDIR if RUBYSCRIPT2EXE::TEMPDIR + ENV["EEE_TEMPDIR"] = RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:tempdir] if RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:tempdir] eeebin1 = newlocation("eee.exe") eeebin1 = newlocation("eee_linux") if linux? diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/require2lib.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/require2lib.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/require2lib.rb 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/require2lib.rb 2007-04-15 21:31:50.000000000 +0200 @@ -1,5 +1,6 @@ require "ev/ftools" require "rbconfig" +require "rubyscript2exe" exit if __FILE__ == $0 @@ -127,11 +128,15 @@ unless LOADSCRIPT == ORGDIR File.open(LOADSCRIPT, "w") do |f| f.puts "module RUBYSCRIPT2EXE" + f.puts " REQUIRE2LIB_FROM_APP={}" + RUBYSCRIPT2EXE.class_variables.each do |const| const = const[2..-1] - f.puts " #{const.upcase}=#{RUBYSCRIPT2EXE.send(const).inspect}" + + f.puts " REQUIRE2LIB_FROM_APP[:#{const}]=#{RUBYSCRIPT2EXE.send(const).inspect}" end - f.puts " RUBYGEMS=#{rubygems.inspect}" + + f.puts " REQUIRE2LIB_FROM_APP[:rubygems]=#{rubygems.inspect}" f.puts "end" end end @@ -139,10 +144,10 @@ end module Kernel - alias :old_load :load + alias :require2lib_load :load def load(filename, wrap=false) REQUIRE2LIB::LOADED << filename unless REQUIRE2LIB::LOADED.include?(filename) - old_load(filename, wrap) + require2lib_load(filename, wrap) end end diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/rubyscript2exe.rb rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/rubyscript2exe.rb --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/rubyscript2exe.rb 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/rubyscript2exe.rb 2007-04-15 21:31:50.000000000 +0200 @@ -31,19 +31,26 @@ def self.strip=(b) ; @@strip = b ; end def self.appdir(file=nil, &block) - dir = File.dirname(File.expand_path($0, USERDIR)) - dir = File.expand_path(File.join(TEMPDIR, "app")) if is_compiled? and defined?(TEMPDIR) - - _use_given_dir(dir, file, &block) + if is_compiled? and defined?(TEMPDIR) + use_given_dir(File.expand_path(File.join(TEMPDIR, "app")), file, &block) + else + use_given_dir(File.dirname(File.expand_path($0, USERDIR)), file, &block) + end end def self.userdir(file=nil, &block) - dir = USERDIR + use_given_dir(USERDIR, file, &block) + end - _use_given_dir(USERDIR, file, &block) + def self.exedir(file=nil, &block) + if is_compiled? and defined?(APPEXE) + use_given_dir(File.dirname(APPEXE), file, &block) + else + use_given_dir(File.dirname(File.expand_path($0)), file, &block) + end end - def self._use_given_dir(dir, file, &block) + def self.use_given_dir(dir, *file, &block) if block pdir = Dir.pwd @@ -51,13 +58,15 @@ res = block[] Dir.chdir(pdir) else - res = File.join(*([dir, file].compact)) + file = file.compact + res = File.expand_path(File.join(*file), dir) end res end + class << self - private :_use_given_dir + private :use_given_dir end def self.is_compiling? @@ -68,6 +77,14 @@ defined?(COMPILED) end + def self.executable + if is_compiled? and defined?(APPEXE) + APPEXE + else + File.expand_path($0) + end + end + verbose = $VERBOSE $VERBOSE = nil s = ENV["PATH"].dup diff -ur rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/VERSION 2006-08-06 19:33:04.000000000 +0200 +++ rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/VERSION 2007-04-15 21:31:49.000000000 +0200 @@ -1 +1 @@ -0.5.1 +0.5.2 Binary files rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/eee_linux and rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/eee_linux differ Binary files rubyscript2exe-0.5.1.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/eeew.exe differ diff -ur rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/CHANGELOG rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/CHANGELOG --- rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/CHANGELOG 2007-04-15 21:04:06.000000000 +0200 +++ rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/CHANGELOG 2007-05-29 22:12:10.000000000 +0200 @@ -1,5 +1,14 @@ ---------------------------------------------------------------- +0.5.3 - 29.05.2007 + +* Added a bit of Config::CONFIG magic to make RubyScript2Exe + work with RubyGems >= 0.9.3. + +* Moved the embedded bin directory to the front of $PATH. + +---------------------------------------------------------------- + 0.5.2 - 15.04.2007 * Fixed a bug when using the gem as library. diff -ur rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/ftools.rb rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/ev/ftools.rb --- rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/ev/ftools.rb 2007-04-15 21:31:50.000000000 +0200 +++ rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/ev/ftools.rb 2007-05-30 10:17:12.000000000 +0200 @@ -60,17 +60,22 @@ end end - def self.find(entry=nil, mask=nil) + def self.find(entry=nil, args={}) + mask = args[:mask] || nil + follow_link = args[:follow_link] || true + entry = "." if entry.nil? entry = entry.to_s entry = entry.gsub(/[\/\\]*$/, "") unless entry.nil? mask = /^#{mask}$/i if mask.kind_of?(String) + stat = File.lstat(entry) + stat = File.stat(entry) if follow_link res = [] - if File.directory?(entry) + if stat.directory? pdir = Dir.pwd res += ["%s/" % entry] if mask.nil? or entry =~ mask @@ -81,7 +86,7 @@ begin Dir.open(".") do |dir| dir.each do |e| - res += Dir.find(e, mask).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) + res += Dir.find(e, :mask=>mask, :follow_link=>follow_link).collect{|e| entry+"/"+e} unless [".", ".."].include?(e) end end ensure diff -ur rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/init.rb 2007-04-10 20:06:14.000000000 +0200 +++ rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/init.rb 2007-05-30 10:15:21.000000000 +0200 @@ -13,7 +13,7 @@ require "ev/oldandnewlocation" require "ev/dependencies" require "ev/ftools" -require "rbconfig" +require "rbconfig" # Do not remove! It's required in bootstrap.rb. exit if RUBYSCRIPT2EXE.is_compiling? @@ -182,8 +182,8 @@ copyto(oldlocation(script), appdir2) if File.file?(oldlocation(script)) Dir.copy(oldlocation(script), appdir2) if File.directory?(oldlocation(script)) -copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? -copyto(Dir.find(libdir2, /\.(so|o|dll)$/i).collect{|file| dlls(file)}, bindir2) if windows? or cygwin? +copyto(Dir.find(libdir2, :mask=>/\.(so|o|dll)$/i).collect{|file| ldds(file)}, bindir2) if linux? or darwin? +copyto(Dir.find(libdir2, :mask=>/\.(so|o|dll)$/i).collect{|file| dlls(file)}, bindir2) if windows? or cygwin? if TK or RUBYSCRIPT2EXE::REQUIRE2LIB_FROM_APP[:tk] if File.file?("#{libdir2}/tk.rb") @@ -245,15 +245,49 @@ f.puts "s = ENV['PATH'].dup" f.puts "$VERBOSE = verbose" f.puts "if Dir.pwd[1..2] == ':/'" - f.puts " s << (';'+bin.gsub(/\\//, '\\\\'))" + f.puts " s.replace(bin.gsub(/\\//, '\\\\')+';'+s)" f.puts "else" - f.puts " s << (':'+bin)" + f.puts " s.replace(bin+':'+s)" f.puts "end" f.puts "ENV['PATH'] = s" f.puts "$:.clear" f.puts "$: << lib" + # I'm not happy with the following code. + # It's just a stupid hack to get rid of /usr/local/**/* + # Should and will be changed in the future. + # For now it's necessary to make it work again with RubyGems >= 0.9.3. + + f.puts "require 'rbconfig'" + + f.puts "Config::CONFIG['archdir'] = dir + '/lib'" # /usr/local/lib/ruby/1.8/i686-linux + f.puts "Config::CONFIG['bindir'] = dir + '/bin'" # /usr/local/bin + f.puts "Config::CONFIG['datadir'] = dir + '/share'" # /usr/local/share + f.puts "Config::CONFIG['datarootdir'] = dir + '/share'" # /usr/local/share + f.puts "Config::CONFIG['docdir'] = dir + '/share/doc/$(PACKAGE)'" # /usr/local/share/doc/$(PACKAGE) + f.puts "Config::CONFIG['dvidir'] = dir + '/share/doc/$(PACKAGE)'" # /usr/local/share/doc/$(PACKAGE) + f.puts "Config::CONFIG['exec_prefix'] = dir + ''" # /usr/local + f.puts "Config::CONFIG['htmldir'] = dir + '/share/doc/$(PACKAGE)'" # /usr/local/share/doc/$(PACKAGE) + f.puts "Config::CONFIG['includedir'] = dir + '/include'" # /usr/local/include + f.puts "Config::CONFIG['infodir'] = dir + '/share/info'" # /usr/local/share/info + f.puts "Config::CONFIG['libdir'] = dir + '/lib'" # /usr/local/lib + f.puts "Config::CONFIG['libexecdir'] = dir + '/libexec'" # /usr/local/libexec + f.puts "Config::CONFIG['localedir'] = dir + '/share/locale'" # /usr/local/share/locale + f.puts "Config::CONFIG['localstatedir'] = dir + '/var'" # /usr/local/var + f.puts "Config::CONFIG['mandir'] = dir + '/share/man'" # /usr/local/share/man + f.puts "Config::CONFIG['pdfdir'] = dir + '/share/doc/$(PACKAGE)'" # /usr/local/share/doc/$(PACKAGE) + f.puts "Config::CONFIG['prefix'] = dir + ''" # /usr/local + f.puts "Config::CONFIG['psdir'] = dir + '/share/doc/$(PACKAGE)'" # /usr/local/share/doc/$(PACKAGE) + f.puts "Config::CONFIG['rubylibdir'] = dir + '/lib'" # /usr/local/lib/ruby/1.8 + f.puts "Config::CONFIG['sbindir'] = dir + '/sbin'" # /usr/local/sbin + f.puts "Config::CONFIG['sharedstatedir'] = dir + '/com'" # /usr/local/com + f.puts "Config::CONFIG['sitearchdir'] = dir + '/lib'" # /usr/local/lib/ruby/site_ruby/1.8/i686-linux + f.puts "Config::CONFIG['sitedir'] = dir + '/lib'" # /usr/local/lib/ruby/site_ruby + f.puts "Config::CONFIG['sitelibdir'] = dir + '/lib'" # /usr/local/lib/ruby/site_ruby/1.8 + f.puts "Config::CONFIG['sysconfdir'] = dir + '/etc'" # /usr/local/etc + f.puts "Config::CONFIG['topdir'] = dir + '/lib'" # /usr/local/lib/ruby/1.8/i686-linux + f.puts "# Load eee.info" f.puts "eeedir = File.dirname(__FILE__)" diff -ur rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/rubyscript2exe.rb rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/rubyscript2exe.rb --- rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/rubyscript2exe.rb 2007-04-15 21:31:50.000000000 +0200 +++ rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/rubyscript2exe.rb 2007-05-30 10:17:12.000000000 +0200 @@ -90,11 +90,11 @@ s = ENV["PATH"].dup $VERBOSE = verbose if Dir.pwd[1..2] == ":/" - s << (";"+appdir.gsub(/\//, "\\")) - s << (";"+appdir("bin").gsub(/\//, "\\")) + s.replace(appdir.gsub(/\//, "\\")+";"+s) + s.replace(appdir("bin").gsub(/\//, "\\")+";"+s) else - s << (":"+appdir) - s << (":"+appdir("bin")) + s.replace(appdir+":"+s) + s.replace(appdir("bin")+":"+s) end ENV["PATH"] = s diff -ur rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/VERSION rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/VERSION --- rubyscript2exe-0.5.2.tar.gz/rubyscript2exe/VERSION 2007-04-15 21:31:49.000000000 +0200 +++ rubyscript2exe-0.5.3.tar.gz/rubyscript2exe/VERSION 2007-05-30 10:17:11.000000000 +0200 @@ -1 +1 @@ -0.5.2 +0.5.3