[alsa-devel] PATCH for alsa-info.sh - using mktemp for instead of hardcoded temp dir.

Takashi Iwai tiwai at suse.de
Wed Feb 27 18:04:06 CET 2008


At Thu, 28 Feb 2008 02:42:20 +1000,
Travis Place wrote:
> 
> On Thu, 28 Feb 2008 2:39:16 am you wrote:
> > At Thu, 28 Feb 2008 00:36:52 +1000,
> >
> > Travis Place wrote:
> > > Email subject should explain well enough.
> >
> > I see some problems with this change:
> > - it doesn't work if /tmp/alsainfo doesn't exist
> > - temp directory isn't removed if --no-upload is given
> >
> > I think you should avoid --tempdir=xxx with mktemp.
> >
> > The output file name is another question.
> > IMO, it'd be better to pass the output file name via a command line
> > option, and put it on the home directory (e.g. ~/alsa-info.out) as
> > default rather than /tmp.
> 
> well, /tmp/alsainfo/ will exist, as we create it in the script.. its 
> $ALSAINFODIR .. the temp dir is then created inside that.

It's created too late.  And, if we create /tmp/alsainfo, there is
little merit of mktemp as /tmp/alsainfo could be a symlink.  Simply
TEMPDIR should be what mktemp creates, and clean it up after
quitting.

> As for not being cleaned up, if --no-upload is specified, ill check that now..
> 
> Also, is outputting the resulting file to ~/ wise ?

It's at least safer than the fixed filename on /tmp.  I don't insist
on this option, though.

Anyway, --output-file=xxx would be a nice addition.

> should this occur even if the result is uploaded, or only on
> --no-upload ?

I don't think it's needed when uploaded (except for any debugging
reason).


Just my $0.02.

thanks,

Takashi


More information about the Alsa-devel mailing list