* [LTP] [PATCH]mktemp command in runltp version issue
@ 2010-09-09 6:22 lina.zhao
2010-09-09 6:52 ` Garrett Cooper
0 siblings, 1 reply; 5+ messages in thread
From: lina.zhao @ 2010-09-09 6:22 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 274 bytes --]
Hi,
In runltp:
if [ -n "$DEVICE" ]; then
mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
--tmpdir is a invalid option for mktemp version 1.5, which is used
widely. The valid option to specify a directory for version 1.5 is
-p directory.
Regards,
Lina Zhao
[-- Attachment #2: 0001-mktemp-version-issue-in-runltp.patch --]
[-- Type: text/x-diff, Size: 867 bytes --]
From 5e5ff93aa2a9d7ae7325b2813092efdb7d19a043 Mon Sep 17 00:00:00 2001
From: Lina Zhao <lina.zhao@windriver.com>
Date: Thu, 9 Sep 2010 14:12:14 +0800
Subject: [PATCH] mktemp version issue in runltp
--tmpdir is a invalid option for mktemp version 1.5, which is used
widely. The valid option to specify a directory for version 1.5 is
-p directory.
Signed-off-by: Lina Zhao < lina.zhao@windriver.com >
---
runltp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/runltp b/runltp
index b385984..ddfd666 100755
--- a/runltp
+++ b/runltp
@@ -716,7 +716,7 @@ main()
fi
if [ -n "$DEVICE" ]; then
- mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
+ mnt_pnt=`mktemp -d -p ${TMP} mnt_pnt.XXXXXX`
if [ -n "$DEVICE_FS_TYPE" ]; then
mount -t $DEVICE_FS_TYPE $DEVICE $mnt_pnt
else
--
1.6.3.1
[-- Attachment #3: Type: text/plain, Size: 247 bytes --]
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH]mktemp command in runltp version issue
2010-09-09 6:22 [LTP] [PATCH]mktemp command in runltp version issue lina.zhao
@ 2010-09-09 6:52 ` Garrett Cooper
2010-09-09 8:08 ` lina.zhao
0 siblings, 1 reply; 5+ messages in thread
From: Garrett Cooper @ 2010-09-09 6:52 UTC (permalink / raw)
To: lina.zhao; +Cc: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 677 bytes --]
On Sep 8, 2010, at 11:22 PM, lina.zhao wrote:
> Hi,
>
> In runltp:
>
> if [ -n "$DEVICE" ]; then
> mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
>
> --tmpdir is a invalid option for mktemp version 1.5, which is used
> widely. The valid option to specify a directory for version 1.5 is
> -p directory.
Or just remove --tmpdir=<blah> altogether? If $TMPDIR is defined in the environment, then it is the fallback if --tmpdir / -p isn't specified (please see the manpage for more details)... OR... just do:
mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX`
The same change will probably need to be applied to the runltp lite script.
Cheers,
-Garrett
[-- Attachment #1.2: Type: text/html, Size: 1134 bytes --]
[-- Attachment #2: Type: text/plain, Size: 247 bytes --]
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH]mktemp command in runltp version issue
2010-09-09 6:52 ` Garrett Cooper
@ 2010-09-09 8:08 ` lina.zhao
2010-09-09 16:18 ` Garrett Cooper
0 siblings, 1 reply; 5+ messages in thread
From: lina.zhao @ 2010-09-09 8:08 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
but $TMPDIR may not be defined in the environment, so we need --tmpdir /
-p to specify the directory
-p is support on most of versions.
mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX` doesn't work well
lina@lina-desktop:~$ export TMP=/home/lina/tmp/
lina@lina-desktop:~$ mktemp -d $TMP/mnt_pnt.XXXXXX
/home/lina/tmp//mnt_pnt.i12144
lina@lina-desktop:~$ mktemp -d -p $TMP mnt_pnt.XXXXXX
/home/lina/tmp/mnt_pnt.Q12146
if $TMP include / in end, then there will be 2 // for the temp file
> On Sep 8, 2010, at 11:22 PM, lina.zhao wrote:
>
>> Hi,
>>
>> In runltp:
>>
>> if [ -n "$DEVICE" ]; then
>> mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
>>
>> --tmpdir is a invalid option for mktemp version 1.5, which is used
>> widely. The valid option to specify a directory for version 1.5 is
>> -p directory.
>
> Or just remove --tmpdir=<blah> altogether? If $TMPDIR is defined in
> the environment, then it is the fallback if --tmpdir / -p isn't
> specified (please see the manpage for more details)... OR... just do:
>
> mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX`
>
> The same change will probably need to be applied to the runltp lite
> script.
>
> Cheers,
> -Garrett
>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH]mktemp command in runltp version issue
2010-09-09 8:08 ` lina.zhao
@ 2010-09-09 16:18 ` Garrett Cooper
2010-09-13 8:04 ` lina.zhao
0 siblings, 1 reply; 5+ messages in thread
From: Garrett Cooper @ 2010-09-09 16:18 UTC (permalink / raw)
To: lina.zhao; +Cc: ltp-list
On Thu, Sep 9, 2010 at 1:08 AM, lina.zhao <lina.zhao@windriver.com> wrote:
> but $TMPDIR may not be defined in the environment, so we need --tmpdir / -p
> to specify the directory
export TMPDIR=$TMP
Done.
> -p is support on most of versions.
The key word you used there is `most'. We need to support all logical
versions of mktemp, which means that it needs to work for about all of
them (I don't care about package versions from back in the kernel
2.4.x days too terribly much, and the other earlier versions, i.e.
2.2, etc, are a non-issue).
> mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX` doesn't work well
>
> lina@lina-desktop:~$ export TMP=/home/lina/tmp/
> lina@lina-desktop:~$ mktemp -d $TMP/mnt_pnt.XXXXXX
> /home/lina/tmp//mnt_pnt.i12144
> lina@lina-desktop:~$ mktemp -d -p $TMP mnt_pnt.XXXXXX
> /home/lina/tmp/mnt_pnt.Q12146
>
> if $TMP include / in end, then there will be 2 // for the temp file
So... what's the issue if there are 2 or more slashes? FWIW that issue
is extremely easy to work around anyhow...
TMP=`dirname $TMP/GARBAGE`
(GARBAGE is required so that it maintains the desired contents in $TMP)
>> On Sep 8, 2010, at 11:22 PM, lina.zhao wrote:
>>
>>> Hi,
>>>
>>> In runltp:
>>>
>>> if [ -n "$DEVICE" ]; then
>>> mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
>>>
>>> --tmpdir is a invalid option for mktemp version 1.5, which is used
>>> widely. The valid option to specify a directory for version 1.5 is
>>> -p directory.
>>
>> Or just remove --tmpdir=<blah> altogether? If $TMPDIR is defined in the
>> environment, then it is the fallback if --tmpdir / -p isn't specified
>> (please see the manpage for more details)... OR... just do:
>>
>> mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX`
>>
>> The same change will probably need to be applied to the runltp lite
>> script.
Simple universal solutions are what I seek :). See if either of the
two suggestions I provided above meets your approval (and FWIW if we
change TMP to TMPDIR, stuff might start working a lot better in LTP
because TMPDIR is the standard variable used for mktemp, not $TMP, etc
that we define in the environment).
Cheers,
-Garrett
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH]mktemp command in runltp version issue
2010-09-09 16:18 ` Garrett Cooper
@ 2010-09-13 8:04 ` lina.zhao
0 siblings, 0 replies; 5+ messages in thread
From: lina.zhao @ 2010-09-13 8:04 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]
mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX` works well.
please check the patch.
> On Thu, Sep 9, 2010 at 1:08 AM, lina.zhao <lina.zhao@windriver.com> wrote:
>
>> but $TMPDIR may not be defined in the environment, so we need --tmpdir / -p
>> to specify the directory
>>
>
> export TMPDIR=$TMP
>
> Done.
>
>
>> -p is support on most of versions.
>>
>
> The key word you used there is `most'. We need to support all logical
> versions of mktemp, which means that it needs to work for about all of
> them (I don't care about package versions from back in the kernel
> 2.4.x days too terribly much, and the other earlier versions, i.e.
> 2.2, etc, are a non-issue).
>
>
>> mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX` doesn't work well
>>
>> lina@lina-desktop:~$ export TMP=/home/lina/tmp/
>> lina@lina-desktop:~$ mktemp -d $TMP/mnt_pnt.XXXXXX
>> /home/lina/tmp//mnt_pnt.i12144
>> lina@lina-desktop:~$ mktemp -d -p $TMP mnt_pnt.XXXXXX
>> /home/lina/tmp/mnt_pnt.Q12146
>>
>> if $TMP include / in end, then there will be 2 // for the temp file
>>
>
> So... what's the issue if there are 2 or more slashes? FWIW that issue
> is extremely easy to work around anyhow...
>
> TMP=`dirname $TMP/GARBAGE`
>
> (GARBAGE is required so that it maintains the desired contents in $TMP)
>
>
>>> On Sep 8, 2010, at 11:22 PM, lina.zhao wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> In runltp:
>>>>
>>>> if [ -n "$DEVICE" ]; then
>>>> mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
>>>>
>>>> --tmpdir is a invalid option for mktemp version 1.5, which is used
>>>> widely. The valid option to specify a directory for version 1.5 is
>>>> -p directory.
>>>>
>>> Or just remove --tmpdir=<blah> altogether? If $TMPDIR is defined in the
>>> environment, then it is the fallback if --tmpdir / -p isn't specified
>>> (please see the manpage for more details)... OR... just do:
>>>
>>> mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX`
>>>
>>> The same change will probably need to be applied to the runltp lite
>>> script.
>>>
>
> Simple universal solutions are what I seek :). See if either of the
> two suggestions I provided above meets your approval (and FWIW if we
> change TMP to TMPDIR, stuff might start working a lot better in LTP
> because TMPDIR is the standard variable used for mktemp, not $TMP, etc
> that we define in the environment).
>
> Cheers,
> -Garrett
>
>
[-- Attachment #2: 0001-mktemp-version-issue-in-runltp.patch --]
[-- Type: text/x-diff, Size: 843 bytes --]
From 08de712ef1ada48353c2c0b782e2089a3fdb7263 Mon Sep 17 00:00:00 2001
From: Lina Zhao <lina.zhao@windriver.com>
Date: Mon, 13 Sep 2010 15:59:55 +0800
Subject: [PATCH] mktemp version issue in runltp
--tmpdir is a invalid option for mktemp version 1.5, which is used
widely. mktemp with no special directory argument works well.
Signed-off-by: Lina Zhao < lina.zhao@windriver.com >
---
runltp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/runltp b/runltp
index b385984..04c16af 100755
--- a/runltp
+++ b/runltp
@@ -716,7 +716,7 @@ main()
fi
if [ -n "$DEVICE" ]; then
- mnt_pnt=`mktemp -d --tmpdir=${TMP} mnt_pnt.XXXXXX`
+ mnt_pnt=`mktemp -d $TMP/mnt_pnt.XXXXXX`
if [ -n "$DEVICE_FS_TYPE" ]; then
mount -t $DEVICE_FS_TYPE $DEVICE $mnt_pnt
else
--
1.6.3.1
[-- Attachment #3: Type: text/plain, Size: 276 bytes --]
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-13 8:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-09 6:22 [LTP] [PATCH]mktemp command in runltp version issue lina.zhao
2010-09-09 6:52 ` Garrett Cooper
2010-09-09 8:08 ` lina.zhao
2010-09-09 16:18 ` Garrett Cooper
2010-09-13 8:04 ` lina.zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox