[plan-build] Escape upper and lower tr classes
[plan-build] Escape upper and lower tr classes

Before this commit, the arguments to the changed tr commands were being
interpreted by the shell as file globs and only passed onto `tr` if the
glob failed.  If a file in the current working directory matched the
glob, a user's build would either fail with the following confusing
error message:

    [53][default:/src:1]# build /src/R
    tr: misaligned [:upper:] and/or [:lower:] construct

in the case of the first [:upper:] glob matching or, in the case of the
[:lower:] glob matching, silently save the pkg_arch and pkg_sys with any
upper case characters translated to the single character that the shell
glob matched to.

The debug output shows the command that bash is ultimately running
post-glob:

    ++ tr R '[[:lower:]]'
    tr: misaligned [:upper:] and/or [:lower:] construct
    + pkg_arch=

In this example the R folder has matched the first glob and thus the tr
command is invalid and fails with an error.

This likely hasn't been hit in the common case since it requires that
you have a file or directory with single character name in your current
directory.

In addition to escaping the tr argument with single quotes to avoid
shell globbing, I've also removed the double brackets per the usage in
the tr manual page.

Signed-off-by: Steven Danna <steve@chef.io>

Pull request: #938
Approved by: stevendanna

habitat-sh/habitat,rsertelon/habitat,nathenharvey/habitat,georgemarshall/habitat,habitat-sh/habitat,nathenharvey/habitat,nathenharvey/habitat,georgemarshall/habitat,georgemarshall/habitat,rsertelon/habitat,georgemarshall/habitat,nathenharvey/habitat,rsertelon/habitat,nathenharvey/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,georgemarshall/habitat,rsertelon/habitat,georgemarshall/habitat,habitat-sh/habitat,nathenharvey/habitat,georgemarshall/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,georgemarshall/habitat