From: LEVITTE@e.kth.se (Richard Levitte)
Newsgroups: comp.os.vms
Subject: Re: Bug in VMS_SHARE 8.1, with patch.
Date: 27 Dec 92 09:53:41 GMT
Organization: Department of TeleTransmission Theory

Of course, I goofed. My previous patch added .DIR files to the archive,
which restored them as bogus.

Here is the original bug I claim to fix:

While trying to package my Emacs patches, I noticed VMS_SHARE wouldn't
take files with an empty file type (like FOO.;1). I tracked down the bug
and made a small change. The patch is included below.

I wanted to send this to the author, Andy Harper, but I couldn't find
his address among the files, soo.... Andy, are you listening? Please add
your address somewhere in the docs!

And here are the working patches:

*** public:[vms_share]vms_share.com
--- vms_share.com
**************
*** 123,132
  $ PackageIdx= f$edit(f$trnlnm("SHARE_PACKAGE_INDEX"), "TRIM,COMPRESS")
  $ Part_Size = f$edit(f$trnlnm("SHARE_PART_SIZE"),     "TRIM,COMPRESS")
  $ Real_Name = f$edit(f$trnlnm("SHARE_REAL_NAME"),     "TRIM,COMPRESS")
! $ X_Files   = f$edit(f$trnlnm("SHARE_EXCLUDE_FILES"), "TRIM,UPCASE")+","
! $ X_Dirs    = f$edit(f$trnlnm("SHARE_EXCLUDE_DIRS"),  "TRIM,UPCASE")+","
! $ X_Names   = f$edit(f$trnlnm("SHARE_EXCLUDE_NAMES"), "TRIM,UPCASE")+","
! $ X_Types   = f$edit(f$trnlnm("SHARE_EXCLUDE_TYPES"), "TRIM,UPCASE")+",.DIR,"
  $ TempFile  = f$parse("SHARE_TEMP","SYS$SCRATCH:SHARE_TEMP."+f$getjpi("","PID"))
  $ TempFile  = TempFile - f$parse(TempFile,,,"VERSION")
  $
--- 123,136 -----
  $ PackageIdx= f$edit(f$trnlnm("SHARE_PACKAGE_INDEX"), "TRIM,COMPRESS")
  $ Part_Size = f$edit(f$trnlnm("SHARE_PART_SIZE"),     "TRIM,COMPRESS")
  $ Real_Name = f$edit(f$trnlnm("SHARE_REAL_NAME"),     "TRIM,COMPRESS")
! $ X_Files   = ","+f$edit(f$trnlnm("SHARE_EXCLUDE_FILES"), "TRIM,UPCASE")+","
! $ X_Dirs    = ","+f$edit(f$trnlnm("SHARE_EXCLUDE_DIRS"),  "TRIM,UPCASE")+","
! $ X_Names   = ","+f$edit(f$trnlnm("SHARE_EXCLUDE_NAMES"), "TRIM,UPCASE")+","
! $ X_Types   = ","+f$edit(f$trnlnm("SHARE_EXCLUDE_TYPES"), "TRIM,UPCASE")+",.DIR,"
! $ if X_Files .eqs. ",," then X_Files = ","
! $ if X_Dirs .eqs. ",," then X_Dirs = ","
! $ if X_Names .eqs. ",," then X_Names = ","
! $ if X_Types .eqs. ",,.DIR," then X_Types = ",.DIR,"
  $ TempFile  = f$parse("SHARE_TEMP","SYS$SCRATCH:SHARE_TEMP."+f$getjpi("","PID"))
  $ TempFile  = TempFile - f$parse(TempFile,,,"VERSION")
  $
**************
*** 555,561
  $
  $! Check the exclusion clauses to see if we should consider this file
  $ File_Dir  = f$parse(File,,,"DIRECTORY")
! $ if f$locate(File_Dir,X_Dirs)       .ne. f$length(X_Dirs)  then $ return
  $ File_Name = f$parse(File,,,"NAME")
  $ if f$locate(File_Name,X_Names)     .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
--- 559,565 -----
  $
  $! Check the exclusion clauses to see if we should consider this file
  $ File_Dir  = f$parse(File,,,"DIRECTORY")
! $ if f$locate(","+File_Dir+",",X_Dirs)   .ne. f$length(X_Dirs)  then $ return
  $ File_Name = f$parse(File,,,"NAME")
  $ if f$locate(","+File_Name+",",X_Names) .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
**************
*** 557,563
  $ File_Dir  = f$parse(File,,,"DIRECTORY")
  $ if f$locate(File_Dir,X_Dirs)       .ne. f$length(X_Dirs)  then $ return
  $ File_Name = f$parse(File,,,"NAME")
! $ if f$locate(File_Name,X_Names)     .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
  $ if f$locate(File_Type,X_Types)     .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
--- 561,567 -----
  $ File_Dir  = f$parse(File,,,"DIRECTORY")
  $ if f$locate(","+File_Dir+",",X_Dirs)   .ne. f$length(X_Dirs)  then $ return
  $ File_Name = f$parse(File,,,"NAME")
! $ if f$locate(","+File_Name+",",X_Names) .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
  $ if f$locate(","+File_Type+",",X_Types) .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
**************
*** 559,565
  $ File_Name = f$parse(File,,,"NAME")
  $ if f$locate(File_Name,X_Names)     .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
! $ if f$locate(File_Type,X_Types)     .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
  $ if f$locate(File_FileName,X_Files) .ne. f$length(X_Files) then $ return
  $ File_Device   = f$parse(File,,,"DEVICE")
--- 563,569 -----
  $ File_Name = f$parse(File,,,"NAME")
  $ if f$locate(","+File_Name+",",X_Names) .ne. f$length(X_Names) then $ return
  $ File_Type = f$parse(File,,,"TYPE") 
! $ if f$locate(","+File_Type+",",X_Types) .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
  $ if f$locate(","+File_FileName+",",X_Files) .ne. f$length(X_Files) then $ return
  $ File_Device   = f$parse(File,,,"DEVICE")
**************
*** 561,567
  $ File_Type = f$parse(File,,,"TYPE") 
  $ if f$locate(File_Type,X_Types)     .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
! $ if f$locate(File_FileName,X_Files) .ne. f$length(X_Files) then $ return
  $ File_Device   = f$parse(File,,,"DEVICE")
  $ Dir_Device    = f$parse(Current_Directory,,,"DEVICE")
  $ Dir_Directory = f$parse(Current_Directory,,,"DIRECTORY")
--- 565,571 -----
  $ File_Type = f$parse(File,,,"TYPE") 
  $ if f$locate(","+File_Type+",",X_Types) .ne. f$length(X_Types) then $ return
  $ File_Filename = File_Name + File_Type
! $ if f$locate(","+File_FileName+",",X_Files) .ne. f$length(X_Files) then $ return
  $ File_Device   = f$parse(File,,,"DEVICE")
  $ Dir_Device    = f$parse(Current_Directory,,,"DEVICE")
  $ Dir_Directory = f$parse(Current_Directory,,,"DIRECTORY")
--
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
! Richard Levitte, VMS GNU Emacs hacker   ! tel: int+46-8-18 30 99            !
! Sulv"agen 57, II                        ! fax: none for the moment          !
! S-126 40 H"agersten                     ! Internet: levitte@e.kth.se        !
! SWEDEN                                  !                                   !
!-----------------------------------------------------------------------------!