On Mon, Nov 1, 2010 at 3:30 PM, Idwer Vollering
<vidwer@gmail.com> wrote:
2010/11/1 David Hendricks
<dhendrix@google.com>
>
> Index: flashrom-torturescript_portability/util/flashrom_partial_write_test.sh
> ===================================================================
> --- flashrom-torturescript_portability/util/flashrom_partial_write_test.sh (Revision 1219)
> +++ flashrom-torturescript_portability/util/flashrom_partial_write_test.sh (Arbeitskopie)
> @@ -34,8 +34,12 @@
> echo "testing flashrom binary: ${FLASHROM}"
>
> OLDDIR=$(pwd)
> -if [ -z "$TMPDIR" ]; then
> - TMPDIR=$(mktemp -d) # test data location
> +
> +# test data location
> +TMPDIR=$(mktemp -d -t flashrom_test.XXXXXXXXXX)
> +if [ "$?" != "0" ] ; then
> + echo "Could not create temporary directory"
Full stop at the end.
Is `mktemp` always installed? If not will there be an error message –
passed down from Bash – indicating that it needs to be installed?
It is safe to assume it is.
To elaborate, "mktemp" is part of the GNU coreutils package, which is pretty much mandatory on GNU/Linux distros:
Ubuntu example:
dhendrix@amd870:~$ dpkg -S `which mktemp`
coreutils: /bin/mktemp
Gentoo example:
(cros-chroot) dhendrix@thegates ~ $ equery belongs `which mktemp`
* Searching for /usr/bin/mktemp ...
sys-apps/coreutils-7.5-r1 (/bin/mktemp)
sys-apps/coreutils-7.5-r1 (/usr/bin/mktemp -> /bin/mktemp)
--