delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2012/12/19/12:35:54

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: V01U2FsdGVkX19wyzU0RJBwB0v6lfLRI3FNF4+054Utr8a6SEF1Y/
rvBeykE+vmAxW5
Message-ID: <50D1FAF7.50100@gmx.de>
Date: Wed, 19 Dec 2012 18:35:51 +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
Subject: A fix for /djgpp/distrib/mkdist
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

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



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 (<DIST>) {
      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 (<DIST>) {
  }

  sub dtou {
      local($s) = @_;
      open(S, $s);
-    open(D, ">/tmp/d.$$");
+    open(D, ">$tmpdir/d.$$");
      while (<S>) {
          s/\r//g;
          print D;
      }
      close(S);
      close(D);
  }
-unlink "/tmp/d.$$";
-
+unlink "$tmpdir/d.$$";

- Raw text -


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