Open Object Rexx in NetBSD - MakeBSDIndexes.rexx


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

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


ooRexx Sources and Links

Open Object Rexx must be compiled from sources provided by Open Object Rexx (ooRexx) website [1]. How to do it in NetBSD is explained on ooRexx Compilation page [2].

[1] Open Object Rexx Downloads
[2] Open Object Rexx in NetBSD: ooRexx Compilation

 

All Files Enabling Searching Localy *BSD FTP Indexes

ATTENTION
1.) This article describes how to search xBSD FTP index files with help of Rexx scripting language.
2.) {f|n|o}bsd_index.txt files are generated by one script: make_bsd_index_files.rexx (see picture of them in Midnight Commander window: left panel shows infobase files in ~/lnbsd/locate/lb directory , in right one is displayed a "factory" with "output" and "input" files, scripts are placed in ~/lnbsd/scripts directory).
3.) ~/lnbsd is our base directory for LearN@BSD Project. Introduction to the directory tree can be found on this page: Polish in NetBSD: Handy Dictionaries from Infobases
4.) Our "search engine" np_lb script is flexible. You can search one file or all three at once. You can look throu all text, or word placed at the beginning of line (see below chapter Usage Information).
5.) Results printed to terminal window contains ftp hyperlinks to *BSD repositories. You can copy it to the same window after wget command and next copy application name.:
$ wget ftp://..... application
and press Enter, to have the appy downloaded in current directory. Forget openning html/ftp pages in web browsers or typing ftp links!
Digression: I know about dependencies but most users after some time of using *BSD have the dependencies installed together with other applications.

{f|n|o}bsd_index.txt
Index files made by make_bsd_index_files.rexx.

make_bsd_index_files.rexx
Main REXX script which downloads "raw" index files from xBSD web/ftp sites (in html form), renamed them, and processes them to {f|n|o}bsd_index.txt.

bsd_wget_index_files.sh
This script download the "raw" index files only. It is placed for those who want to get them by yourselves.

np_lb
Main search engine wrote as a bash/sh script. See some pictures further below on this page.

{f|n|o}_index.html
HTML files (e.g. nbsd_index.html) for processing. The genuine "raw" html files were renamed to process them more easily (coding script was more convenient, I could use arrays).

x.html.old or x.txt.old
Previous copies of HTML or TXT files.

 

Setting make_bsd_index_files.rexx

    /*---------------------------------------------------------+
    | Setting variables                                        |
    +---------------------------------------------------------*/
    /*---------------------------------------------------------+
    | Setting index file directory                             |
    +---------------------------------------------------------*/
    homPath = "/home/lnbsd"
    bsdPath = homPath"/lnbsd/dict.db/dict.bsd/"

    PkgLen = 40               /* Application name span length */
                              /* displayed on screen          */
    

That's all. Nothing else has to be changed in the rexx script. PkgLen defines a gap between package (application) name and its description. Some file names e.g. within p5-* scope have widths of nearly 60 characters.

[MC edit window with obsd_index.txt]

Picture 1: MC edit window with obsd_index.txt file (click to enlarge)

 

Setting bsd_wget_index_files.sh

    echo
    echo "=========================================================="
    echo "=                                                        ="
    echo "=        ...running bsd_wget_index_files.sh...           ="
    echo "=                                                        ="
    echo "=========================================================="
    echo

    # change directory
    #
    cd ~/data/rexx/wget-bsd
    

 

Setting np_lb Search Engine

Setting Infobase Directory
    # Please set your target directory!!!
    # ===================================
    #
    lb_dir=~/lnbsd/locate/lb
    
Usage Information
    echo
    echo ">>> grep on FreeBSD, NetBSD, OpenBSD pkgs <<<"
    echo "============================================="
    echo "np_lb, np_lb h, np_lb -h  = this help message"
    echo
    echo "  np_lb a x,  np_lb -a x    = search AllBSD"
    echo "  np_lb f x,  np_lb -f x    = search FreeBSD"
    echo "  np_lb n x,  np_lb -f x    = search NetBSD"
    echo "  np_lb o x,  np_lb -o x    = search OpenBSD"
    echo
    echo "Example (The GMT package):  np_lb a gmt"
    echo
    echo "You can use ^ character at the beginning"
    echo "of the x word:              np_lb a ^gmt"
    echo "============================================="
    echo
    

 

P2O2 Screenshots

[]

Picture 2: Searching "rexx" results (click to enlarge)

[]

Picture 3: Searching "^sca" results (click to enlarge)

 

Download Files

1.) lnbsd.bsd.tar.gz - all files described above are included

 

[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]