Changeset 3cb4ef5b
- Timestamp:
- 10/05/2013 05:45:52 PM (11 years ago)
- Branches:
- 2.4, ablfs-more, legacy, new_features, trunk
- Children:
- 433a5d4
- Parents:
- ad4ff97
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/master.sh
rad4ff97 r3cb4ef5b 114 114 #--------------------------------------------------------------------# 115 115 # 116 # Find the name of the tarball and the version of the package 117 pkg_tarball=$(get_package_tarball_name $name) 118 pkg_version=$(get_package_version $pkg_tarball) 119 116 120 # Drop in the name of the target on a new line, and the previous target 117 121 # as a dependency. Also call the echo_message function. 118 LUSER_wrt_target "${this_script}" "$PREV" 119 120 # Find the version of the command files, if it corresponds with the building of 121 # a specific package 122 pkg_tarball=$(get_package_tarball_name $name) 122 LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" 123 123 124 124 # If $pkg_tarball isn't empty, we've got a package... … … 127 127 LUSER_wrt_unpack "$pkg_tarball" 128 128 # If the testsuites must be run, initialize the log file 129 [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}" 129 [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}" "$pkg_version" 130 130 # If using optimizations, write the instructions 131 131 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" … … 136 136 # The changingowner script must be run as root. 137 137 case "${this_script}" in 138 *changingowner) wrt_RunAsRoot "$file" ;;139 *) LUSER_wrt_RunAsUser "$file" ;;138 *changingowner) wrt_RunAsRoot "$file" "$pkg_version" ;; 139 *) LUSER_wrt_RunAsUser "$file" "$pkg_version" ;; 140 140 esac 141 141 … … 214 214 # iterations rebuilds 215 215 pkg_tarball=$(get_package_tarball_name $name) 216 pkg_version=$(get_package_version $pkg_tarball) 216 217 217 218 if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then … … 239 240 # and not to use chroot. 240 241 case "${this_script}" in 241 *kernfs) LUSER_wrt_target "${this_script}" "$PREV" ;;242 *) CHROOT_wrt_target "${this_script}" "$PREV" ;;242 *kernfs) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 243 *) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 243 244 esac 244 245 … … 255 256 case $name in 256 257 binutils | gcc | glibc | gmp | mpfr ) 257 [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" 258 [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version" 258 259 ;; 259 260 * ) 260 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" 261 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version" 261 262 ;; 262 263 esac … … 268 269 # and not to use chroot. 269 270 case "${this_script}" in 270 *kernfs) wrt_RunAsRoot "$file" ;;271 *) CHROOT_wrt_RunAsRoot "$file" ;;271 *kernfs) wrt_RunAsRoot "$file" "$pkg_version" ;; 272 *) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;; 272 273 esac 273 274 -
common/libs/func_wrt_Makefile
rad4ff97 r3cb4ef5b 59 59 60 60 61 #==== PACKAGES NAMES ===61 #==== PACKAGES NAMES AND VERSIONS ==== 62 62 63 63 #----------------------------------# … … 117 117 } 118 118 119 #----------------------------------# 120 get_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 } 119 154 #======================= 120 155 … … 127 162 local i=$1 128 163 local PREV=$2 164 local version 165 if [ "$3" != "" ]; then 166 version=-$3 167 fi 129 168 ( 130 169 cat << EOF … … 133 172 @\$(call echo_message, Building) 134 173 ${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 137 176 EOF 138 177 ) >> $MKFILE.tmp … … 144 183 local i=$1 145 184 local PREV=$2 185 local version 186 if [ "$3" != "" ]; then 187 version=-$3 188 fi 146 189 ( 147 190 cat << EOF … … 150 193 @\$(call echo_message, Building) 151 194 ${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 154 197 EOF 155 198 ) >> $MKFILE.tmp … … 212 255 LUSER_wrt_test_log() { # Initialize testsuite log file 213 256 #----------------------------------# 214 local TESTLOGFILE=$1 257 local version 258 if [ "$2" != "" ]; then 259 version=-$2 260 fi 261 local TESTLOGFILE=$1$version 215 262 ( 216 263 cat << EOF 217 264 @echo "export TEST_LOG=\$(TESTLOGDIR)/$TESTLOGFILE" >> envars && \\ 218 echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/ \$@265 echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/$TESTLOGFILE 219 266 EOF 220 267 ) >> $MKFILE.tmp … … 224 271 CHROOT_wrt_test_log() { # 225 272 #----------------------------------# 226 local TESTLOGFILE=$1 273 local version 274 if [ "$2" != "" ]; then 275 version=-$2 276 fi 277 local TESTLOGFILE=$1$version 227 278 ( 228 279 cat << EOF 229 280 @echo "export TEST_LOG=\$(crTESTLOGDIR)/$TESTLOGFILE" >> envars && \\ 230 echo "\$(nl_)\`date\`\$(nl_)" > test-logs/\$@281 echo "\$(nl_)\`date\`\$(nl_)" >\$(crTESTLOGDIR)/$TESTLOGFILE 231 282 EOF 232 283 ) >> $MKFILE.tmp … … 242 293 #----------------------------------# 243 294 local MOUNT_ENV 295 local version 296 if [ "$2" != "" ]; then 297 version=-$2 298 fi 244 299 local file=$1 245 300 … … 256 311 cat << EOF 257 312 @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 260 315 EOF 261 316 ) >> $MKFILE.tmp … … 266 321 #----------------------------------# 267 322 local file=$1 323 local version 324 if [ "$2" != "" ]; then 325 version=-$2 326 fi 268 327 269 328 ( 270 329 cat << EOF 271 330 @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 274 333 EOF 275 334 ) >> $MKFILE.tmp … … 280 339 #----------------------------------# 281 340 local file=$1 341 local version 342 if [ "$2" != "" ]; then 343 version=-$2 344 fi 282 345 ( 283 346 cat << EOF 284 347 @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 287 350 EOF 288 351 ) >> $MKFILE.tmp
Note:
See TracChangeset
for help on using the changeset viewer.