freebsd / poudriere

Port/Package build and test system
https://github.com/freebsd/poudriere/wiki
BSD 2-Clause "Simplified" License
392 stars 162 forks source link

'bad variable name' errors #376

Closed infracaninophile closed 8 years ago

infracaninophile commented 8 years ago

since upgrading to poudriere-3.1.11_1 I'm getting a lot of errors like so:

poudriere.sh[50769]: [00:00:17] ====>> Starting/Cloning builders
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_01: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_03: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_04: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_02: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_05: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_06: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_08: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_ref: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_09: bad variable name
poudriere.sh[50769]: setvar: _HASH_zfs_getfs__usr_local_poudriere_data__m_FreeBSD:10:amd64_default_desktop_07: bad variable name

Possibly because my Jail names are the same as the arch strings pkg(8) uses -- colons and all:

:# poudriere jail -l 
JAILNAME         VERSION          ARCH  METHOD TIMESTAMP           PATH
FreeBSD:10:amd64 10.1-RELEASE-p29 amd64 ftp    2016-02-10 12:29:34 /usr/local/poudriere/jails/FreeBSD:10:amd64
FreeBSD:9:amd64  9.2-RELEASE-p17  amd64 ftp    2016-02-10 12:29:53 /usr/local/poudriere/jails/FreeBSD:9:amd64
[stingray]:...local/etc/poudriere.d:# 
bdrewery commented 8 years ago

Proposed patch: http://dpaste.com/2CXSDGW.txt

infracaninophile commented 8 years ago

Dang that was fast. Let me test that.

bdrewery commented 8 years ago

Someone reported it to me in mail a few hours ago too ;)

infracaninophile commented 8 years ago

Works like a charm.

bdrewery commented 8 years ago

Thanks. I'm going to verify with Jilles before releasing that it is proper.

infracaninophile commented 8 years ago

AFAIR sh identifiers match '^[a-zA-Z][a-zA-Z0-9]*$' ie. any sequence of alphanum characters or underscores except that they can't start with a digit. Your code looks fine in that regard.

bdrewery commented 8 years ago

Yes, this won't have issues with starting with a digit since it is prefixing the result with _HASH_