Changeset 8825e69


Ignore:
Timestamp:
03/30/2022 03:45:35 PM (2 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
3e82b0b
Parents:
2bd2fb8
Message:

Get completely rid of PROGNAME

There is only one PROGNAME: lfs, so no need for a variable.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Config.in

    r2bd2fb8 r8825e69  
    4545        default "sysv"         if BOOK_LFS || BLFS_SYSV
    4646        default "systemd"      if BOOK_LFS_SYSD || BLFS_SYSD
    47 
    48     config    PROGNAME
    49         string
    50         default "lfs"          if BOOK_LFS || BOOK_LFS_SYSD
    5147
    5248    config    RUN_ME
     
    937933        config    XSL
    938934            string "XSL stylesheet"
    939             default "$PROGNAME.xsl"
     935            default "lfs.xsl"
    940936
    941937        config    PKG_LST
  • common/libs/func_book_parser

    r2bd2fb8 r8825e69  
    1111    exit 1"
    1212
    13     echo -n "Downloading the lfs document, $COMMIT commit... "
     13    echo -n "Downloading the lfs document, $COMMIT branch/tag/commit... "
    1414
    1515    # Grab a fresh book if it's missing, otherwise, update it from the
     
    5151  # Extract the commands
    5252  echo -n "Extracting commands for"
    53   case ${PROGNAME} in
     53  echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... "
     54  # The scripts pages are xincluded by the book, so must
     55  # be generated for running xsltproc
     56  pushd $BOOK > /dev/null
     57  if [ -f process-scripts.sh ]; then
     58    bash process-scripts.sh >> $LOGDIR/$LOG 2>&1
     59  fi
     60  # Recent git versions need version.ent to be generated
     61  if [ -f git-version.sh ]; then
     62    bash git-version.sh "$INITSYS" >> $LOGDIR/$LOG 2>&1
     63  fi
     64  popd > /dev/null
    5465
    55     lfs)
    56         echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... "
    57         # The scripts pages are xincluded by the book, so must
    58         # be generated for running xsltproc
    59         pushd $BOOK > /dev/null
    60         if [ -f process-scripts.sh ]; then
    61           bash process-scripts.sh >> $LOGDIR/$LOG 2>&1
    62         fi
    63         # Recent git versions need version.ent to be generated
    64         if [ -f git-version.sh ]; then
    65           bash git-version.sh "$INITSYS" >> $LOGDIR/$LOG 2>&1
    66         fi
    67         popd > /dev/null
     66  # First profile the book, for revision and arch. Note that
     67  # MULTIBLIB is set to "default" if pure 64 bit book. In this case,
     68  # profiling on arch is useless, but does not hurt either.
     69  xsltproc --nonet                                      \
     70           --xinclude                                   \
     71           --stringparam profile.revision "$INITSYS"    \
     72           --stringparam profile.arch     "$MULTILIB"   \
     73           --output prbook.xml                          \
     74           $BOOK/stylesheets/lfs-xsl/profile.xsl        \
     75           $BOOK/index.xml >> $LOGDIR/$LOG 2>&1
    6876
    69         # First profile the book, for revision and arch. Note that
    70         # MULTIBLIB is set to "default" if pure 64 bit book. In this
    71         # profiling on arch is useless, but does not hurt either.
    72         xsltproc --nonet                                      \
    73                  --xinclude                                   \
    74                  --stringparam profile.revision "$INITSYS"    \
    75                  --stringparam profile.arch     "$MULTILIB"   \
    76                  --output prbook.xml                          \
    77                  $BOOK/stylesheets/lfs-xsl/profile.xsl        \
    78                  $BOOK/index.xml >> $LOGDIR/$LOG 2>&1
    79 
    80         # Use the profiled book for generating the scriptlets
    81         xsltproc --nonet                                      \
    82                  --stringparam testsuite      "$TEST"         \
    83                  --stringparam bomb-testsuite "$BOMB_TEST"    \
    84                  --stringparam ncurses5       "$NCURSES5"     \
    85                  --stringparam strip          "$STRIP"        \
    86                  --stringparam del-la-files   "$DEL_LA_FILES" \
    87                  --stringparam full-locale    "$FULL_LOCALE"  \
    88                  --stringparam timezone       "$TIMEZONE"     \
    89                  --stringparam page           "$PAGE"         \
    90                  --stringparam lang           "$LANG"         \
    91                  --stringparam pkgmngt        "$PKGMNGT"      \
    92                  --stringparam wrap-install   "$WRAP_INSTALL" \
    93                  --stringparam hostname       "$HOSTNAME"     \
    94                  --stringparam interface      "$INTERFACE"    \
    95                  --stringparam ip             "$IP_ADDR"      \
    96                  --stringparam gateway        "$GATEWAY"      \
    97                  --stringparam prefix         "$PREFIX"       \
    98                  --stringparam broadcast      "$BROADCAST"    \
    99                  --stringparam domain         "$DOMAIN"       \
    100                  --stringparam nameserver1    "$DNS1"         \
    101                  --stringparam nameserver2    "$DNS2"         \
    102                  --stringparam font           "$FONT"         \
    103                  --stringparam fontmap        "$FONTMAP"      \
    104                  --stringparam unicode        "$UNICODE"      \
    105                  --stringparam keymap         "$KEYMAP"       \
    106                  --stringparam local          "$LOCAL"        \
    107                  --stringparam log-level      "$LOG_LEVEL"    \
    108                  --stringparam script-root    "$SCRIPT_ROOT"  \
    109                  --output "./${COMMANDS}/"                    \
    110                  $XSL                                         \
    111                  prbook.xml >> $LOGDIR/$LOG 2>&1
    112 # Remove flags requesting user action in some cases. Much easier here than
    113 # in the stylesheet...
    114         sed -i 's/-iv /-v /' "./${COMMANDS}/"chapter??/*kernel*
    115       ;;
    116     *)  echo -n " ${L_arrow}${PROGNAME}${R_arrow} book invalid, terminate build... "
    117         exit 1 ;;
    118   esac
     77  # Use the profiled book for generating the scriptlets
     78  xsltproc --nonet                                      \
     79           --stringparam testsuite      "$TEST"         \
     80           --stringparam bomb-testsuite "$BOMB_TEST"    \
     81           --stringparam ncurses5       "$NCURSES5"     \
     82           --stringparam strip          "$STRIP"        \
     83           --stringparam del-la-files   "$DEL_LA_FILES" \
     84           --stringparam full-locale    "$FULL_LOCALE"  \
     85           --stringparam timezone       "$TIMEZONE"     \
     86           --stringparam page           "$PAGE"         \
     87           --stringparam lang           "$LANG"         \
     88           --stringparam pkgmngt        "$PKGMNGT"      \
     89           --stringparam wrap-install   "$WRAP_INSTALL" \
     90           --stringparam hostname       "$HOSTNAME"     \
     91           --stringparam interface      "$INTERFACE"    \
     92           --stringparam ip             "$IP_ADDR"      \
     93           --stringparam gateway        "$GATEWAY"      \
     94           --stringparam prefix         "$PREFIX"       \
     95           --stringparam broadcast      "$BROADCAST"    \
     96           --stringparam domain         "$DOMAIN"       \
     97           --stringparam nameserver1    "$DNS1"         \
     98           --stringparam nameserver2    "$DNS2"         \
     99           --stringparam font           "$FONT"         \
     100           --stringparam fontmap        "$FONTMAP"      \
     101           --stringparam unicode        "$UNICODE"      \
     102           --stringparam keymap         "$KEYMAP"       \
     103           --stringparam local          "$LOCAL"        \
     104           --stringparam log-level      "$LOG_LEVEL"    \
     105           --stringparam script-root    "$SCRIPT_ROOT"  \
     106           --output "./${COMMANDS}/"                    \
     107           $XSL                                         \
     108           prbook.xml >> $LOGDIR/$LOG 2>&1
     109  # Remove flags requesting user action in some cases. Much easier here than
     110  # in the stylesheet...
     111  sed -i 's/-iv /-v /' "./${COMMANDS}/"chapter??/*kernel*
    119112
    120113  echo "done"
     
    122115  # Make the scripts executable.
    123116  chmod -R +x "$JHALFSDIR/${COMMANDS}"
    124 
    125   # Create the packages file. We need it for proper Makefile creation
    126   # lfs does not use this anymore, but this is taken care in the
    127   # function body
    128   create_package_list
    129   # On the other hand, lfs needs two auxiliary files
    130   if [ "${PROGNAME}" = lfs ]; then
    131     create_chroot_scripts
    132     create_kernfs_scripts
    133   fi
     117  create_chroot_scripts
     118  create_kernfs_scripts
    134119
    135120  # we create the VERSION variable here. Should maybe go into its own
    136121  # function. But at this point we can use the profiled xml to get
    137122  # version from lfs-release in the lfs case.
    138   case $PROGNAME in
    139     lfs)
    140       VERSION=$(grep 'echo.*lfs-release' prbook.xml | sed 's/.*echo[ ]*\([^ ]*\).*/\1/')
    141       ;;
    142     *)
    143       VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //'  -e 's/<\/.*//')  ;;
    144   esac
     123  VERSION=$(grep 'echo.*lfs-release' prbook.xml | sed 's/.*echo[ ]*\([^ ]*\).*/\1/')
    145124
    146125  # Done. Moving on...
    147126  get_sources
    148 }
    149 
    150 #----------------------------#
    151 create_package_list() {      #
    152 #----------------------------#
    153 
    154   # Create the packages file. We need it for proper Makefile creation
    155   rm -f pkg_tarball_list
    156   echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK"
    157   if [ ! -z "$ARCH" ] ; then echo -n " $ARCH" ; fi
    158   echo -n "... "
    159   case ${PROGNAME} in
    160     lfs)
    161         # lfs does not use the package list anymore
    162       ;;
    163     *)
    164   esac
    165 
    166   echo "done"
    167 
    168127}
    169128
     
    176135  if [ ! -z $ARCH ] ; then echo -n " $ARCH" ; fi
    177136  echo -n "... "
    178   case ${PROGNAME} in
    179     lfs)
    180       xsltproc --nonet --xinclude \
    181                -o chroot-scripts/ chroot.xsl \
    182                $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1
    183       ;;
    184     *)
    185   esac
     137  xsltproc --nonet --xinclude \
     138           -o chroot-scripts/ chroot.xsl \
     139           $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1
    186140  echo "done"
    187141
     
    197151  if [ ! -z $ARCH ] ; then echo -n " $ARCH" ; fi
    198152  echo -n "... "
    199   case ${PROGNAME} in
    200     lfs)
    201       xsltproc --nonet \
    202                -o kernfs-scripts/devices.sh kernfs.xsl \
    203                $BOOK/*/kernfs.xml >> $LOGDIR/$LOG 2>&1
    204       xsltproc --nonet \
    205                -o kernfs-scripts/teardown.sh kernfs.xsl \
    206                $BOOK/chapter??/reboot.xml >> $LOGDIR/$LOG 2>&1
    207       ;;
    208     *)
    209   esac
     153  xsltproc --nonet \
     154           -o kernfs-scripts/devices.sh kernfs.xsl \
     155           $BOOK/*/kernfs.xml >> $LOGDIR/$LOG 2>&1
     156  xsltproc --nonet \
     157           -o kernfs-scripts/teardown.sh kernfs.xsl \
     158           $BOOK/chapter??/reboot.xml >> $LOGDIR/$LOG 2>&1
     159
    210160  echo "done"
    211161
  • common/libs/func_download_pkgs

    r2bd2fb8 r8825e69  
    131131  cd $JHALFSDIR
    132132
    133   case ${PROGNAME} in
    134     lfs)
    135         echo -n "Creating LFS specific URLs file"
    136         xsltproc --nonet --xinclude                \
    137                  --stringparam server "$SERVER"    \
    138                  --stringparam family lfs          \
    139                  --stringparam pkgmngt "$PKGMNGT"  \
    140                  --stringparam revision "$INITSYS" \
    141                  --output ../sources/urls.lst      \
    142                  urls.xsl                          \
    143                  $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
    144         echo " ...OK"
    145       ;;
    146   esac
     133  echo -n "Creating URLs file... "
     134  xsltproc --nonet --xinclude                \
     135           --stringparam server "$SERVER"    \
     136           --stringparam family lfs          \
     137           --stringparam pkgmngt "$PKGMNGT"  \
     138           --stringparam revision "$INITSYS" \
     139           --output ../sources/urls.lst      \
     140           urls.xsl                          \
     141           $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
     142  echo "OK"
    147143
    148144  cd $BUILDDIR/sources
  • common/libs/func_validate_configs.sh

    r2bd2fb8 r8825e69  
    66#----------------------------#
    77: <<inline_doc
    8       Validates the configuration parameters. The global var PROGNAME selects the
    9     parameter list.
     8      Validates the configuration parameters.
    109
    1110    input vars: none
    1211    externals:  color constants
    13                 PROGNAME (lfs only as of February 28th, 2022)
    1412    modifies:   none
    1513    returns:    nothing
     
    1917
    2018  # Common settings by Config.in sections and books family
    21   local -r     BOOK_common="BOOK CUSTOM_TOOLS"
     19  local -r     BOOK_common="COMMIT BOOK CUSTOM_TOOLS"
    2220  local -r  GENERAL_common="LUSER LGROUP LHOME BUILDDIR CLEAN GETPKG SRC_ARCHIVE \
    2321                            SERVER RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \
     
    124122
    125123  set +e
    126   PARAM_GROUP=${PROGNAME}_PARAM_LIST
    127   for config_param in ${!PARAM_GROUP}; do
     124  for config_param in $lfs_PARAM_LIST; do
    128125    case $config_param in
    129126      # Envvars that depend on other settings to be displayed
     
    209206               fi
    210207               ;;
    211       # Display non-validated envars found in ${PROGNAME}_PARAM_LIST
     208      # Display non-validated envars found in lfs_PARAM_LIST
    212209      * ) echo -e "`eval echo $PARAM_VALS`" ;;
    213210
  • common/libs/func_wrt_Makefile

    r2bd2fb8 r8825e69  
    234234        @source ~/.bashrc && \\
    235235        \$(CMDSDIR)/`dirname $file`/\$@ >> \$(LOGDIR)/\$@$version 2>&1 && \\
    236         if [ "${PROGNAME}" != lfs ]; then \$(PRT_DU) >>logs/\$@$version; fi
    237236EOF
    238237) >> $MKFILE.tmp
     
    251250        @source envars && \\
    252251        \$(crCMDSDIR)/`dirname $file`/\$@ >>\$(crLOGDIR)/\$@$version 2>&1 && \\
    253         if [ "${PROGNAME}" != lfs ]; then \$(PRT_DU_CR) >>logs/\$@$version; fi
    254252EOF
    255253) >> $MKFILE.tmp
  • jhalfs

    r2bd2fb8 r8825e69  
    205205# Set true internal variables
    206206COMMON_DIR="common"
    207 PACKAGE_DIR=$(echo "$PROGNAME" | tr '[:lower:]' '[:upper:]')
     207PACKAGE_DIR=LFS
    208208MODULE=$PACKAGE_DIR/master.sh
    209209PKGMNGTDIR="pkgmngt"
     
    343343
    344344# Copy packageManager.xml, if needed
    345   [[ "$PKGMNGT" = "y" ]] && [[ "$PROGNAME" = "lfs" ]] && {
     345  [[ "$PKGMNGT" = "y" ]] && {
    346346    sed s@BOOK@"$BOOK"@ "$PKGMNGTDIR/packageManager.xml" > \
    347347                        "$JHALFSDIR/"packageManager.xml
Note: See TracChangeset for help on using the changeset viewer.