Changeset 0722dde


Ignore:
Timestamp:
06/04/2021 07:13:04 PM (3 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, legacy, trunk
Children:
106157fd
Parents:
cfdb089
Message:

Do not use global $version when writing Makefile

In func_wrt_makefile, the two functions LUSER_wrt_unpack and
CHROOT_Unpack use the version variable without setting it.
This leads to the global version variable being used, which
writes garbage into the Makefile. Fix: just define version locally.

This bug does not occur often because those functions are only
used when using custom scripts for versioned packages (if building LFS).
It has been found by William Harrington.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_wrt_Makefile

    rcfdb089 r0722dde  
    215215LUSER_wrt_unpack() {               # Unpack and set 'ROOT' var
    216216#----------------------------------#
    217   local FILE=$1
    218   local optSAVE_PREVIOUS=$2
     217  local FILE="$1"
     218  local optSAVE_PREVIOUS="$2"
     219  local version
     220  if [ "$3" != "" ]; then
     221    version=-"$3"
     222  fi
    219223
    220224  if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
     
    240244  local FILE=$1
    241245  local optSAVE_PREVIOUS=$2
     246  local version
     247  if [ "$3" != "" ]; then
     248    version=-"$3"
     249  fi
    242250
    243251  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
Note: See TracChangeset for help on using the changeset viewer.