delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/05/13:44:43

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3B6D85D6.C162AAE4@phekda.freeserve.co.uk>
Date: Sun, 05 Aug 2001 18:43:50 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Running dsmcheck on packages, before upload to Simtel.NET?
References: <3B6B2541 DOT BC41EDA9 AT phekda DOT freeserve DOT co DOT uk> <200108032230 DOT SAA31124 AT envy DOT delorie DOT com>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

DJ Delorie wrote:
> 
> > I think it would be a good idea to run 'dsmcheck' on packages that
> > have a DSM, before uploading them to Simtel.NET. That way we can catch
> > errors in DSMs. Would you mind adding this to your pre-upload checks,
> > DJ? 'dsmcheck' builds and runs on Linux - perhaps it will on other
> > Unices too.
> 
> Here is my current checkzip script.  If you would send me a patch and
> point me at the sources for dsmcheck, I would run it on all zips going
> to simtel.

OK, there's a patch below. I fixed a bug in the regular expression for
stripping .zip off the ZIP filename (try v2/gzip13b.zip for instance).
dsmcheck returns 0 if the DSM is OK, else 1. There may be other return
codes in the future, but 0 will always indicate that the DSM is OK.

dsmcheck can be found in the zippo sources. I guess you know where those
are. 8) There are also instructions on the zippo home page:

    http://www.phekda.freeserve.co.uk/richdawe/zippo/

To build dsmcheck, check out a copy of the sources from CVS, then:

    ./scripts/mkconfig.sh
    ./config
    make dep all check

You should then find bin/dsmcheck.

Alternatively you could use the sources from v2/zipo014s.zip - the DSM
parser in CVS is the same as the 0.1.4 release.

Thanks, bye, Rich =]

*** packchk.pl.orig     Sun Aug  5 18:06:30 2001
--- packchk.pl  Sun Aug  5 18:37:15 2001
*************** unless ($#ARGV >= 0) {
*** 9,20 ****
  }
  
  for $zip (@ARGV) {
  
      print "\n\033[33mChecking $zip...\033[0m\n\n";
  
      $zb = $zip;
!     $zb =~ s@.*/@@;
!     $zb =~ s/.zip//;
  
      open(Z, "unzip -l $zip |");
      open(DC, "| doschk | sed -e '/SysV/,/^\$/d'");
--- 9,21 ----
  }
  
  for $zip (@ARGV) {
+     $dsm = $version = $manifest = 0;
  
      print "\n\033[33mChecking $zip...\033[0m\n\n";
  
      $zb = $zip;
!     $zb =~ s@^.*/@@;
!     $zb =~ s/\.zip$//;
  
      open(Z, "unzip -l $zip |");
      open(DC, "| doschk | sed -e '/SysV/,/^\$/d'");
*************** for $zip (@ARGV) {
*** 28,33 ****
--- 29,42 ----
          $manifest = 1 if $f =~ m AT manifest/$zb.mft@;
          $version = 1 if $f =~ m AT manifest/$zb.ver@;
  
+         if ($f =~ m@^manifest/$zb.dsm$@) {
+           $dsm = 1;
+           $exit_value = system("dsmcheck $zip 1>/dev/null 2>&1") >> 8;
+           if ($exit_value != 0) {
+               $out .= "$f - DSM has syntax errors\n";
+           }
+       }
+ 
          print DC "$f\n" or 1;
  
          if ($f =~ /\.(exe|a|o|com|zip)$/i) {
*************** for $zip (@ARGV) {
*** 41,46 ****
--- 50,56 ----
  
      print "No Manifest (manifest/$zb.mft)\n" unless $manifest;
      print "No Version (manifest/$zb.ver)\n" unless $version;
+     print "No DSM (manifest/$zb.dsm)\n" unless $dsm;
  
      system "unzip -tqq $zip";
  }

- Raw text -


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