Ignore:
Timestamp:
12/18/2021 02:28:47 PM (3 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, legacy, trunk
Children:
ff5c301
Parents:
7ae9774
Message:

BLFS dependencies: better document the functions

First the function used in pass1. Also some nit in the function itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/libs/func_dependencies

    r7ae9774 rdd9ca56  
    3737# topological sort.                                                           #
    3838#                                                                             #
    39 # TODO: document each pass
    40 # Data layout:                                                                #
    41 # TODO: needs also to document the .tree files, and the "f" qualifier
    42 #                                                                             #
     39# Pass 1: graph generation                                                    #
     40# ========================                                                    #
     41# Data layout for pass 1                                                      #
     42# ----------------------                                                      #
    4343# A node of the tree is represented by a text file <nodeName>.dep. Each edge  #
    4444# starting from this node is represented by a line in this file. We keep      #
     
    4747# contains three fields:                                                      #
    4848#  - the weight of the edge                                                   #
    49 #  - the "before" (b) or "after" (a) qualifier                                #
    50 #  - the name of the destination of the edge                                  #
    51 #                                                                           #
    52 # TODO: The following is obsolete
     49#  - the qualifier: "before" (b), "after" (a), or "first" (f)                 #
     50#  - the name of the destination of the edge (without the ".dep" extension)   #
     51#                                                                             #
     52# Recursive function "generate_subgraph"                                      #
     53# --------------------------------------                                      #
     54# This function treats a node of the graph that is not a leaf and that is     #
     55# seen for the first time in the DFS. The dependencies of this node are       #
     56# known, and stored in a .dep file. For each dependency in that file, there   #
     57# are three cases:                                                            #
     58# - the weight of the edge leading to that dependency is higher than          #
     59#   requested. This dependency is discarded (some information printed)        #
     60# - the weight of the edge is lower or equal to requested, but the node       #
     61#   has already been visited (the .dep file exists). Discard too (some        #
     62#   information printed)                                                      #
     63# - the weight of the edge is lower or equal to requested, and the node       #
     64#   has not been seen: then the dependencies of that node are generated,      #
     65#   and there are two cases:                                                  #
     66#   - the node has no dependencies: just create an empty .dep file, so        #
     67#     that we know the node has been visited                                  #
     68#   - the node has dependencies: call generate_subgraph for that node         #
     69#                                                                             #
     70# This function takes four parameters:                                        #
     71# - The node filename: this is the only one useful for the algorithm          #
     72# - The depth: number of steps starting from root (for pretty print only)     #
     73# - The weight of the edge leading to that node (for printing)                #
     74# - The qualifier (for printing)                                              #
     75#                                                                             #
     76# TODO: document other passes                                                 #
     77# TODO: needs also to document the .tree files                                #
     78# TODO: The following is obsolete                                           #
    5379# Circular dependencies:                                                    #
    5480#                                                                           #
     
    84110                $2 : weight of the edge leading to this node
    85111                $3 : depth (root is 1)
    86                 $4 : qualifier (a for after, b for before)
     112                $4 : qualifier (a for after, b for before, f for first)
    87113    externals:  vars:  DEP_LEVEL   contains 1 if we want to build the
    88114                                   tree only for required dependencies,
     
    91117                                   for the requested packages,
    92118                                   4 if we want all the dependencies
     119                                     (excluding external of course)
    93120                       MAIL_SERVER contains the name of the MTA we want to use.
    94121                files: ../xsl/dependencies.xsl: stylesheet for creating the
     
    121148esac
    122149case $qualifier in
    123     a) buildstring=runtime ;;
    124     b) buildstring=        ;;
     150    a)   buildstring=runtime ;;
     151    b|f) buildstring=        ;;
    125152esac
    126153dep_level=$DEP_LEVEL
     
    141168  esac
    142169  case $build_of_dep in
    143     a) buildstring=runtime ;;
    144     b) buildstring=        ;;
     170    a  ) buildstring=runtime ;;
     171    b|f) buildstring=        ;;
    145172  esac
    146173# Has this entry already been seen?
     174# TODO: no there is no special case!
    147175# We have a special case here: if the entry has been seen at depth > 2
    148176# and now depth=2 and DEP_LEVEL=3, optional deps have not been processed.
Note: See TracChangeset for help on using the changeset viewer.