Changeset f6d5ca1 in wspkg for freebsd/freebsd.nopkg-setup.sh


Ignore:
Timestamp:
Feb 28, 2019, 8:42:37 PM (3 years ago)
Author:
Ting-Wei Lan <lantw44@…>
Branches:
master
Children:
a2c0986
Parents:
2e6149f
git-author:
Ting-Wei Lan <lantw44@…> (02/28/19 20:27:39)
git-committer:
Ting-Wei Lan <lantw44@…> (02/28/19 20:42:37)
Message:

Use 'printf' to print non-constant strings in shell scripts

It is unsafe to use 'echo' with strings with variable substitutions.
Different 'echo' implementations may accept different options, and they
can interpret strings with escape characters in different ways. The
behavior of 'printf' is much more consistent so it should be preferred.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd/freebsd.nopkg-setup.sh

    r2e6149f rf6d5ca1  
    1212                        pkg_ports="${pkg_ports} FLAVOR=${pkg_flavor}"
    1313                fi
    14                 printf 'WSPKG_PACKAGE_NAME_%-40s != printf "\\\\r===> Generating package names (%5d/%5d)" 1>\\&2; $(MAKE) -C ${PORTSDIR}/%-48s -V PKGNAMEPREFIX -V PORTNAME -V PKGNAMESUFFIX \\| tr -d "\\\\n"%%' \
     14                printf 'WSPKG_PACKAGE_NAME_%-40s != printf '\''\\\\r===> Generating package names (%5d/%5d)'\'' 1>\\&2; $(MAKE) -C ${PORTSDIR}/%-48s -V PKGNAMEPREFIX -V PORTNAME -V PKGNAMESUFFIX \\| tr -d '\''\\\\n'\''%%' \
    1515                        "${pkg_ports_var}" "${index}" "${count}" "${pkg_ports}"
    1616                index=$(( ${index} + 1 ))
    1717        done )
    18 printf 'WSPKG_PACKAGE_NAME_%-25s != echo 1>\\&2; echo %%' "NULL"
     18printf 'WSPKG_PACKAGE_NAME_%-40s != echo 1>\\&2; echo %%' "NULL"
Note: See TracChangeset for help on using the changeset viewer.