delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2012/12/20/15:55:09

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX19fbEQWf5ZfwCuUaLxlFQvGev7ionvscyNGDUDZ8h
y9NEkrGOcAYVi5
Message-ID: <50D37826.1050802@gmx.de>
Date: Thu, 20 Dec 2012 21:42:14 +0100
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
CC: Rugxulo <rugxulo AT gmail DOT com>
Subject: Re: A fix for /djgpp/distrib/mkdist
References: <50D1FAF7 DOT 50100 AT gmx DOT de> <CAA-ihx_O0yHC5Nk1YY4vS1UwbtxN1Swf8uKXDk9H=iwm6PbXzA AT mail DOT gmail DOT com>
In-Reply-To: <CAA-ihx_O0yHC5Nk1YY4vS1UwbtxN1Swf8uKXDk9H=iwm6PbXzA@mail.gmail.com>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019