Changeset 3cb4ef5b for common


Ignore:
Timestamp:
10/05/2013 05:45:52 PM (11 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, new_features, trunk
Children:
433a5d4
Parents:
ad4ff97
Message:

Add versions to file names in logs and test-logs: use it for the SBY report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_wrt_Makefile

    rad4ff97 r3cb4ef5b  
    5959
    6060
    61 #==== PACKAGES NAMES ===
     61#==== PACKAGES NAMES AND VERSIONS ====
    6262
    6363#----------------------------------#
     
    117117}
    118118
     119#----------------------------------#
     120get_package_version() {            #
     121#----------------------------------#
     122# Those hacks may change depending on the invention of devs for tarball names.
     123# Normally, we expect -digit to signal the beginning of the version field
     124# but it may happen that there is no '-' (tcl, expect), that the version
     125# field is ddd-d (pkg-config-lite-028-1, since sed is greedy, it finds only
     126# the second dash) or that the first character of the version is not a digit
     127# (iputils-s20121221)...
     128  case ${1} in
     129     tcl*|expect*|tzdata*|xmlts*|unzip*|lynx*)
     130                           echo ${1} | sed -e 's@^[^[:digit:]]*@@' \
     131                                           -e 's@\(-src\)*\.tar.*@@'
     132        ;;
     133     iputils*)             echo ${1} | sed -e 's@^.*-@@' \
     134                                           -e 's@\.tar.*@@'
     135        ;;
     136     LVM*)                 echo ${1} | sed -e 's@^[^.]*\.@@' \
     137                                           -e 's@\.tgz.*@@'
     138        ;;
     139     iproute*)             echo ${1} | sed -e 's@^[^-]*-@@' \
     140                                           -e 's@\.tar.*@@'
     141        ;;
     142     pkg*|udev*|Singular*)
     143                           echo ${1} | sed -e 's@^.*[a-z]-\([[:digit:]]\)@\1@' \
     144                                           -e 's@\.tar.*@@' \
     145                                           -e 's@\.zip.*@@'
     146        ;;
     147     *)                    echo ${1} | sed -e 's@^.*[-_]\([[:digit:]]\)@\1@' \
     148                                           -e 's@\.tar.*@@' \
     149                                           -e 's@\.zip.*@@'
     150        ;;
     151  esac
     152
     153}
    119154#=======================
    120155
     
    127162  local i=$1
    128163  local PREV=$2
     164  local version
     165  if [ "$3" != "" ]; then
     166    version=-$3
     167  fi
    129168(
    130169cat << EOF
     
    133172        @\$(call echo_message, Building)
    134173${NO_PROGRESS}  @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID &
    135         @echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@
    136         @\$(PRT_DU) >>logs/\$@
     174        @echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@$version
     175        @\$(PRT_DU) >>logs/\$@$version
    137176EOF
    138177) >> $MKFILE.tmp
     
    144183  local i=$1
    145184  local PREV=$2
     185  local version
     186  if [ "$3" != "" ]; then
     187    version=-$3
     188  fi
    146189(
    147190cat << EOF
     
    150193        @\$(call echo_message, Building)
    151194${NO_PROGRESS}  @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID &
    152         @echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@
    153         @\$(PRT_DU_CR) >>logs/\$@
     195        @echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@$version
     196        @\$(PRT_DU_CR) >>logs/\$@$version
    154197EOF
    155198) >> $MKFILE.tmp
     
    212255LUSER_wrt_test_log() {             # Initialize testsuite log file
    213256#----------------------------------#
    214   local TESTLOGFILE=$1
     257  local version
     258  if [ "$2" != "" ]; then
     259    version=-$2
     260  fi
     261  local TESTLOGFILE=$1$version
    215262(
    216263cat  << EOF
    217264        @echo "export  TEST_LOG=\$(TESTLOGDIR)/$TESTLOGFILE" >> envars && \\
    218         echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/\$@
     265        echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/$TESTLOGFILE
    219266EOF
    220267) >> $MKFILE.tmp
     
    224271CHROOT_wrt_test_log() {            #
    225272#----------------------------------#
    226   local TESTLOGFILE=$1
     273  local version
     274  if [ "$2" != "" ]; then
     275    version=-$2
     276  fi
     277  local TESTLOGFILE=$1$version
    227278(
    228279cat  << EOF
    229280        @echo "export TEST_LOG=\$(crTESTLOGDIR)/$TESTLOGFILE" >> envars && \\
    230         echo "\$(nl_)\`date\`\$(nl_)" >test-logs/\$@
     281        echo "\$(nl_)\`date\`\$(nl_)" >\$(crTESTLOGDIR)/$TESTLOGFILE
    231282EOF
    232283) >> $MKFILE.tmp
     
    242293#----------------------------------#
    243294  local MOUNT_ENV
     295  local version
     296  if [ "$2" != "" ]; then
     297    version=-$2
     298  fi
    244299  local file=$1
    245300
     
    256311cat << EOF
    257312        @export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
    258         ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
    259         \$(PRT_DU) >>logs/\$@
     313        ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@$version 2>&1 && \\
     314        \$(PRT_DU) >>logs/\$@$version
    260315EOF
    261316) >> $MKFILE.tmp
     
    266321#----------------------------------#
    267322  local file=$1
     323  local version
     324  if [ "$2" != "" ]; then
     325    version=-$2
     326  fi
    268327
    269328(
    270329cat << EOF
    271330        @source ~/.bashrc && \\
    272         \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1 && \\
    273         \$(PRT_DU) >>logs/\$@
     331        \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@$version 2>&1 && \\
     332        \$(PRT_DU) >>logs/\$@$version
    274333EOF
    275334) >> $MKFILE.tmp
     
    280339#----------------------------------#
    281340  local file=$1
     341  local version
     342  if [ "$2" != "" ]; then
     343    version=-$2
     344  fi
    282345(
    283346cat << EOF
    284347        @source envars && \\
    285         \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
    286         \$(PRT_DU_CR) >>logs/\$@
     348        \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@$version 2>&1 && \\
     349        \$(PRT_DU_CR) >>logs/\$@$version
    287350EOF
    288351) >> $MKFILE.tmp
Note: See TracChangeset for help on using the changeset viewer.