delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2012/12/19/17:10:32

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=0MID+SzVgfe3eNsI0w7qMz9s8wAkJzogNdsG+Cc5YY0=;
b=l01XNY2WK1UymS8xZEKSv8d7HdHDbXVh/HzIyYOiGzQxQxHNhYIx7PgBxhblxduKuv
THU0KAA1XHiRjkhsYkHndVvh6rq+sZ3foZSilSKM4405bG7/CnONBwhoZxv1IanFGeeW
TPReDYUJoJk1rwshRNPnTFsl4h7Cl2unSkYl1Yj9hT+BkGrsfBFlUH0NAQcVTIj730yi
GNToRg+rmUQmGbWIcTAgwlIq8zHGVAL+hBkEwjR0tp0bX7+qxgjInp+Jl5PwY0PNBU6H
4vHg8SMdyCuZ9jK0y3DOPVa4/cHt3EVRcwfbcdMWLoiMMeQWPw7lnX6F8VqQWB4BAK5J
M/4Q==
MIME-Version: 1.0
In-Reply-To: <50D1FAF7.50100@gmx.de>
References: <50D1FAF7 DOT 50100 AT gmx DOT de>
Date: Wed, 19 Dec 2012 15:42:41 -0600
Message-ID: <CAA-ihx_O0yHC5Nk1YY4vS1UwbtxN1Swf8uKXDk9H=iwm6PbXzA@mail.gmail.com>
Subject: Re: A fix for /djgpp/distrib/mkdist
From: Rugxulo <rugxulo AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
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

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??).

>  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.

- Raw text -


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