X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DsNl6NUQqsL9MfVxiK68cvSX6vjkEp7lf51vjYu0fLM=; b=G0Ht0MMklZ5iWW6NRG62xp9Q619DUo2gnBBtJ79QtAG4aXw/2CEXylF6JY3EolWgY7 tysP5LMru3h10lJ8Sp39bLl3E45//pg0IZky8VpjLGML6F6d3VJwl49J8QQiTcgTz75V 5Zmaq2WmuPCAi5rOPPlrtX5xlI0bKVr4OAUyrGq9TexaHUWEV2UguG5BL3Vowwcz1vfL QbexPZjWaljls6FhatR5l0IhZPVOEh2IVLmbwFKQGwp+kSDeQWnT14EaknkAUbRpQ2jL OmtAdCpJaV1DFWavYJ1Jlmw7tDkV0FQ04y86vfeuRd295fYeMvAdgCKjBsIBpt2Xytho 6WZA== MIME-Version: 1.0 In-Reply-To: <50D1FAF7.50100@gmx.de> References: <50D1FAF7 DOT 50100 AT gmx DOT de> Date: Thu, 20 Dec 2012 14:59:07 +0200 Message-ID: Subject: Re: A fix for /djgpp/distrib/mkdist From: Ozkan Sezer To: djgpp-workers AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 12/19/12, Juan Manuel Guerrero wrote: > A couple of weeks ago I observed that /distrib/mkdist used to created the > zip files when cross-compiling fails to create all zip files except for > djdev204.zip. > I have assumed that this is a bug and not a feature. The main issue was it didn't automatically generate "nobins" if you do a "make" in the directory before running mkdist, it used to work for me all the time under linux. > There were various > issues > that needed to be fixed like: > - copying the $file.dsm into the /manifest directory > - adding the $file.dsm to the manifest file. > - to compile the nobins program if still not compiled > As told before all zip files except for djdev204.zip are 0 byte length > files > thus they are useles. I do not know if someone has ever used this perl > script > to create zip files but now it works. > > OFYI, I applied this patch a couple of weeks ago. > > Regards, > Juan M. Guerrero > -- O.S. > > > diff -aprNU5 djgpp.orig/distrib/mkdist djgpp/distrib/mkdist > --- djgpp.orig/distrib/mkdist 2012-12-19 18:10:06 +0000 > +++ djgpp/distrib/mkdist 2012-12-09 06:17:54 +0000 > @@ -5,10 +5,28 @@ print "\nDon't forget to run rmtemps and > > $| = 1; > > $one = shift; > > +$tmpdir = $ENV{'TMPDIR'}; > +if ( !defined($tmpdir) ) { > + if ( $^O eq 'dos' ) { > + $tmpdir = $ENV{'TMP'}; > + if ( !defined($tmpdir) ) { > + $tmpdir = $ENV{'TEMP'}; > + if ( !defined($tmpdir) ) { > + mkdir("./tmp"); > + $tmpdir = "./tmp"; > + } > + } > + } else { > + $tmpdir = "/tmp" > + } > +} > + > +$cc = gcc; > + > open(DIST, "mkdist.bat"); > chdir ".."; > > system "cp readme.1st zips"; > system "cp copying* zips"; > @@ -20,52 +38,59 @@ while () { > next if $one && ! /$one/; > ($call, $mkdist, $file, $desc) = split(' ', $_, 4); > > unlink "zips/$file.zip"; > > - print "$file... "; > + print "$file...\n"; > $p = "distrib/p/$file"; > > + system "cp $p/$file.dsm manifest/$file.dsm"; > + > open(M, "> manifest/$file.ver"); > print M "$file $desc\r\n"; > close(M); > > - print "find... "; > + print "find...\n"; > &dtou("$p/files"); > - system "find `cat /tmp/d.$$` -type f -print > manifest/$file.mft" > + system "find `cat $tmpdir/d.$$` -type f -print > manifest/$file.mft" > || die("find"); > > if ( -f "$p/skips" ) { > - print "skips... "; > + print "skips...\n"; > &dtou("$p/skips"); > - system "sed -f /tmp/d.$$ manifest/$file.mft > manifest/$file.tmp" > + system "sed -f $tmpdir/d.$$ manifest/$file.mft > > manifest/$file.tmp" > || die("sed"); > rename("manifest/$file.tmp", "manifest/$file.mft"); > } > > open(M, ">> manifest/$file.mft"); > + print M "manifest/$file.dsm\n"; > print M "manifest/$file.mft\n"; > print M "manifest/$file.ver\n"; > close(M); > > if ( -f "$p/nobins" ) { > - print "nobins... "; > + print "nobins...\n"; > + if ( !-f "distrib/nobins" ) { > + system "$cc -s -O2 distrib/nobins.c -o distrib/nobins" > + || die("$cc"); > + } > system "distrib/nobins `cat $p/nobins` < manifest/$file.mft > > manifest/$file.tmp" > || die("nobins"); > rename("manifest/$file.tmp", "manifest/$file.mft"); > } > > - print "sort... "; > + print "sort...\n"; > system "sort manifest/$file.mft > manifest/$file.tmp" > || die("sort"); > rename("manifest/$file.tmp", "manifest/$file.mft"); > > - print "zip... "; > - system "zip -qq -9 -@ /tmp/$file.zip < manifest/$file.mft" > + print "zip...\n"; > + system "zip -qq -9 -@ $tmpdir/$file.zip < manifest/$file.mft" > || die("zip"); > - system "cp /tmp/$file.zip zips/$file.zip"; > - unlink "/tmp/$file.zip"; > + system "cp $tmpdir/$file.zip zips/$file.zip"; > + unlink "$tmpdir/$file.zip"; > > print "done.\n"; > last unless -f "zips/$file.zip"; > > $sz = (stat("zips/$file.zip"))[7]; > @@ -74,15 +99,14 @@ while () { > } > > sub dtou { > local($s) = @_; > open(S, $s); > - open(D, ">/tmp/d.$$"); > + open(D, ">$tmpdir/d.$$"); > while () { > s/\r//g; > print D; > } > close(S); > close(D); > } > -unlink "/tmp/d.$$"; > - > +unlink "$tmpdir/d.$$"; > >