Mail Archives: djgpp-workers/2012/12/20/15:55:09
Am 19.12.2012 22:42, schrieb Rugxulo:
> Hi,
> I'm not at all familiar with Perl, but ...
>
> On Wed, Dec 19, 2012 at 11:35 AM, Juan Manuel Guerrero
> <juan DOT guerrero AT gmx DOT de> 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.
> >
> > 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.
> >
> > + if ( !defined($tmpdir) ) {
> > + mkdir("./tmp");
> > + $tmpdir = "./tmp";
>
> Wouldn't it be slightly better to define $tmpdir first? Then you
> wouldn't have two duplicates of the literal "./tmp" (which, BTW, did
> you literally mean subdir "tmp" within current dir "./" or "/tmp"
> located in root instead? I guess "/" may not always be writable??).
I have completely removed the TMPDIR stuff for DOS. The perl script does not
work well with perl588b. The script is intended for Linux and there is no
reason to port it to DOS.
> > system "cp readme.1st zips";
> > system "cp copying* zips";
>
> Minor nit: "cp -p" preserves times, though not sure if that's important or not.
>
> > - 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");
>
> Not sure how you'd do this and not abort if not found (though that's
> rare), but IMHO, it's better to also use "unzip -T $tmpdir/$file.zip"
> afterwards so the timestamp matches the newest file in the archive.
> But again, that may not be very important.
I do not know if all this is the hassle worth. The only reason why I have
inspected and slightly modified the script was because it did not work for
me. In the current way it used to work and I think it should not be changed
if there is no bug.
Regards,
Juan M. Guerrero
diff -aprNU5 djgpp.orig/distrib/mkdist djgpp/distrib/mkdist
--- djgpp.orig/distrib/mkdist 2012-12-09 06:17:54 +0000
+++ djgpp/distrib/mkdist 2012-12-20 20:45:56 +0000
@@ -6,24 +6,10 @@ 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 "..";
- Raw text -