Open Object Rexx in NetBSD - MakeFtpPage.rexx


Created - May 16, 2007  |  Modified - Sep 20, 2007

P2O2 WWW Homepage -> Open Object Rexx in NetBSD -> MakeFtpPage.rexx


ooRexx Sources and Links

Open Object Rexx must be compiled from sources provided by Open Object Rexx (ooRexx) website [1].

[1] Open Object Rexx Downloads

 

All Files to Make P2O2 Guide to xBSD FTP

ATTENTION
1.) This article describes how P2O2 Guide to NetBSD FTP pages are created with help of Rexx scripting language.
2.) x.old and x.html files are generated by two scripts: make_xbsd_ftp.sh and make_xbsd_ftp.rexx (see picture of them in Midnight Commander window: left panel shows ls-l files, right one {f|n|o}bsd_ftp_{1|2|3|4}.html "factory").
3.) Numbers in file names at their beginnings place them at the top of a list of the directory they are in. It is highly convenient to have them at hand and easy to find when there are many page templates within the same directory.

[{f|n|o}bsd-]ls-lR[A]
Main "ls -l" index file downloaded from xBSD FTP or HTTP website

{f|n|o}bsd_ftp.list
Index files made by "grep xxx ls-lR[A] > {f|n|o}bsd_ftp.list" command. The files have to be processed to have pub/ directory at the beginning of each line.

make_xbsd_ftp.rexx
Main REXX script which can be run separately but should be better invoked by BASH script - make_xbsd_ftp.sh. Further explanation can be found within the code of the files.

make_xbsd_ftp.sh
This script should be run instead of rexx script (elbeit possible, see docs inside rexx script). It will keep directory tidy. It detects files and makes backup copies (x.old files).

{f|n|o}bsd_ftp_{1|2|3|4}.html
HTML files (e.g. nbsd_ftp_3.html) generated by rexx script make_xbsd_ftp.rexx using data contained in {f|n|o}bsd_ftp.list.

{f|n|o}bsd_ftp_{1|2|3|4}.html
Previous copies of HTML pages.

 

FreeBSD Files

FreeBSD - grep command
    $ grep "^./" fbsd-ls-lRA > fbsd_ftp.list
    
FreeBSD - grep result
    ./CERT:
    ./CERT/advisories:
    ./CERT/advisories/old:
    ./CERT/packages:
    ./CERT/packages/SA-01:40:
    ./CERT/packages/SA-01:42:
    ./CERT/packages/SA-01:48:
    ./CERT/packages/SA-01:49:
    ./CERT/packages/SA-01:51:
    ./CERT/packages/SA-01:52:
    
FreeBSD - fbsd_ftp.list - 10 first lines
    pub/CERT:
    pub/CERT/advisories:
    pub/CERT/advisories/old:
    pub/CERT/packages:
    pub/CERT/packages/SA-01:40:
    pub/CERT/packages/SA-01:42:
    pub/CERT/packages/SA-01:48:
    pub/CERT/packages/SA-01:49:
    pub/CERT/packages/SA-01:51:
    pub/CERT/packages/SA-01:52:
    

 

NetBSD Files

NetBSD - grep command
    $ grep "pub/" nbsd-ls-lRA > nbsd_ftp.list
    
NetBSD - grep result
    pub/NetBSD:
    pub/NetBSD/.snapshot:
    pub/NetBSD/NetBSD-2.0.2:
    pub/NetBSD/NetBSD-2.0.2/acorn26:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary/kernel:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary/sets:
    pub/NetBSD/NetBSD-2.0.2/acorn26/installation:
    pub/NetBSD/NetBSD-2.0.2/acorn26/installation/misc:
    pub/NetBSD/NetBSD-2.0.2/acorn32:
    
NetBSD - nbsd_ftp.list - 10 first lines
    pub/NetBSD:
    pub/NetBSD/.snapshot:
    pub/NetBSD/NetBSD-2.0.2:
    pub/NetBSD/NetBSD-2.0.2/acorn26:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary/kernel:
    pub/NetBSD/NetBSD-2.0.2/acorn26/binary/sets:
    pub/NetBSD/NetBSD-2.0.2/acorn26/installation:
    pub/NetBSD/NetBSD-2.0.2/acorn26/installation/misc:
    pub/NetBSD/NetBSD-2.0.2/acorn32:
    

 

OpenBSD Files

OpenBSD - grep command
    $ grep "^./" obsd-ls-lRA > obsd_ftp.list
    
OpenBSD - grep result
    ./Collections_Tools:
    ./Collections_Tools/ROADS:
    ./Collections_Tools/SGML_Tools:
    ./Digital_Collections:
    ./Digital_Collections/Local:
    ./Digital_Collections/Mirror:
    ./Graphics_Tools:
    ./Local:
    ./Local/Gnu-extras:
    ./Local/Gnu-extras/edb-1.21:
    
OpenBSD - obsd_ftp.list - 10 first lines
    pub/Collections_Tools:
    pub/Collections_Tools/ROADS:
    pub/Collections_Tools/SGML_Tools:
    pub/Digital_Collections:
    pub/Digital_Collections/Local:
    pub/Digital_Collections/Mirror:
    pub/Graphics_Tools:
    pub/Local:
    pub/Local/Gnu-extras:
    pub/Local/Gnu-extras/edb-1.21:
    

 

Setting BSD System

make_xbsd_ftp.rexx - Rexx script
    prog_ver = "0.6"

       bsd_sys   = "FreeBSD"  
    /*   bsd_sys   = "NetBSD"   */
    /*   bsd_sys   = "OpenBSD"  */
    

Uncomment system selected for processing. Do the same in the file below (make_xbsd_ftp.sh).

make_xbsd_ftp.sh - Bash script
    #!/bin/sh

    bsd_sys="FreeBSD"
    #bsd_sys="NetBSD"
    #bsd_sys="OpenBSD"
    

Unhash system selected for processing. Do the same in the file above (make_xbsd_ftp.rexx).

 

Settings Colors and Names Excluded from Display

make_xbsd_ftp.rexx - Rexx script

FreeBSD Example.
1.) Last number in Stem variable assignments e.g. exclStem.1.1 = "development" must be assigned to the same Stem with "0" (zero) index - exclStem.1.0 = 1
2.) Names excluded from display will be folded on HTML page - only their names will be shown without subdirectories.
3.) If one doesn't want exclude any directory the following settings should look like this:
exclStem.1.1 = ""
exclStem.1.0 = 1

/*-----------------------------------------------------------------------------+
|                                                                              |
| FreeBSD                                                                      |
|                                                                              |
+-----------------------------------------------------------------------------*/
if bsd_sys   = "FreeBSD" then do

  /*---------------------------------------------------------------------------+
  | Exclusion list: Level 1                                                    |
  +---------------------------------------------------------------------------*/
  exclStem. = ""
  exclStem.1.1 = "development"
  exclStem.1.0 = 1

  /*---------------------------------------------------------------------------+
  | Exclusion list: Level 2                                                    |
  +---------------------------------------------------------------------------*/
  exclStem.2.1  = "distfiles"
  exclStem.2.2  = "local-distfiles"
  exclStem.2.3  = "patches"
  exclStem.2.4  = "advisories"
  exclStem.2.5  = "packages"
  exclStem.2.6  = "tools"
  exclStem.2.7  = "notices"
  exclStem.2.8  = "2.2-stable"
  exclStem.2.9  = "current"
  exclStem.2.10 = "sparc64"
  exclStem.2.11 = "powerpc"
  exclStem.2.12 = "pc98"
  exclStem.2.13 = "alpha"
  exclStem.2.0  = 13

  /*---------------------------------------------------------------------------+
  | Exclusion list: Level 3                                                    |
  +---------------------------------------------------------------------------*/
  exclStem.3.1  = "5.5-RELEASE"
  exclStem.3.2  = "2.2.9-RELEASE"
  exclStem.3.3  = "tmp"
  exclStem.3.4  = "ports"
  exclStem.3.5  = "src"
  exclStem.3.6  = "articles"
  exclStem.3.7  = "books"
  exclStem.3.8  = "packages-5-stable"
  exclStem.3.9  = "packages-5.5-release"
  exclStem.3.10 = "packages-4-stable"
  exclStem.3.11 = "packages-6-stable"
  exclStem.3.12 = "packages-6.1-release"
  exclStem.3.0  = 12

  /*---------------------------------------------------------------------------+
  | Exclusion list: Level 4                                                    |
  +---------------------------------------------------------------------------*/
  exclStem.4.1  = ""
  exclStem.4.0  = 1

  /*---------------------------------------------------------------------------+
  | Exclusion list: Level 5                                                    |
  +---------------------------------------------------------------------------*/
  exclStem.5.1  = ""
  exclStem.5.0  = 1

  /*---------------------------------------------------------------------------+
  | Color some items                                                           |
  +---------------------------------------------------------------------------*/
  colStem.  = ""
  colStem.1 = "ISO-IMAGES"
  colStem.2 = "books"
  colStem.3 = "articles"
  colStem.4 = "i386"
  colStem.0 = 4

  colVar.  = ""
  colVar.1 = "#ff0000"
  colVar.2 = "#009900"
  colVar.3 = "#009900"
  colVar.4 = "#ff00ff"
  colVar.0 = 4

end
/*-----------------------------------------------------------------------------+
|                                                                              |
| FreeBSD Setting - End                                                        |
|                                                                              |
+-----------------------------------------------------------------------------*/
    

 

Download Files

1.) ls-lR.gz - rename it to fbsd-ls-lR.gz
2.) ls-lRA.gz - rename it to nbsd-ls-lRA.gz
3.) ls-lR.gz - rename it to obsd-ls-lR.gz
4.) fbsd_ftp.list - processed by P2O2
5.) nbsd_ftp.list - processed by P2O2
6.) obsd_ftp.list - processed by P2O2
7.) make_xbsd_ftp.rexx - rexx script
8.) make_xbsd_ftp.sh - Bash script

 

[Logo P2O2]

 

[Logo NetBSD]

 

[Logo Open Object Rexx]

 

[Powered by Rexx Logo]

 


Przemysław Pawełczyk - Cracow, Poland    [Static website generated with Rexx scripts in NetBSD]