* [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME
@ 2013-05-20 1:29 Jonathan Liu
2013-05-20 9:19 ` Phil Blundell
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Liu @ 2013-05-20 1:29 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index ab09231..bbc1f35 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -150,7 +150,7 @@ apply_cfgfile() {
cat ${CFGFILE} | grep -v "^#" | \
while read LINE; do
eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
- TNAME=${ROOT_DIR}/${TNAME}
+ TNAME=`echo ${ROOT_DIR}/${TNAME} | sed -e 's@^//*@/@'`
[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
[ "${TTYPE}" = "l" ] && {
--
1.8.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME
2013-05-20 1:29 [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME Jonathan Liu
@ 2013-05-20 9:19 ` Phil Blundell
2013-05-20 9:23 ` Jonathan Liu
0 siblings, 1 reply; 5+ messages in thread
From: Phil Blundell @ 2013-05-20 9:19 UTC (permalink / raw)
To: Jonathan Liu; +Cc: openembedded-core
On Mon, 2013-05-20 at 11:29 +1000, Jonathan Liu wrote:
> - TNAME=${ROOT_DIR}/${TNAME}
> + TNAME=`echo ${ROOT_DIR}/${TNAME} | sed -e 's@^//*@/@'`
Why is this a good thing? Your commit message is rather terse.
p.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME
2013-05-20 9:19 ` Phil Blundell
@ 2013-05-20 9:23 ` Jonathan Liu
2013-05-20 9:38 ` Phil Blundell
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Liu @ 2013-05-20 9:23 UTC (permalink / raw)
To: Phil Blundell; +Cc: openembedded-core
On 20/05/2013 7:19 PM, Phil Blundell wrote:
> On Mon, 2013-05-20 at 11:29 +1000, Jonathan Liu wrote:
>> - TNAME=${ROOT_DIR}/${TNAME}
>> + TNAME=`echo ${ROOT_DIR}/${TNAME} | sed -e 's@^//*@/@'`
> Why is this a good thing? Your commit message is rather terse.
>
> p.
It reduces the size of /etc/volatile.cache.
Otherwise for example if you have ROOT_DIR=/, TNAME=/var/log, TNAME
becomes ///var/log.
Also if you have verbose mode enabled it actually prints out the extra
unnecessary leading slashes.
Regards,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME
2013-05-20 9:23 ` Jonathan Liu
@ 2013-05-20 9:38 ` Phil Blundell
2013-05-20 10:00 ` Jonathan Liu
0 siblings, 1 reply; 5+ messages in thread
From: Phil Blundell @ 2013-05-20 9:38 UTC (permalink / raw)
To: Jonathan Liu; +Cc: openembedded-core
On Mon, 2013-05-20 at 19:23 +1000, Jonathan Liu wrote:
> On 20/05/2013 7:19 PM, Phil Blundell wrote:
> > On Mon, 2013-05-20 at 11:29 +1000, Jonathan Liu wrote:
> >> - TNAME=${ROOT_DIR}/${TNAME}
> >> + TNAME=`echo ${ROOT_DIR}/${TNAME} | sed -e 's@^//*@/@'`
> > Why is this a good thing? Your commit message is rather terse.
> >
> > p.
> It reduces the size of /etc/volatile.cache.
> Otherwise for example if you have ROOT_DIR=/, TNAME=/var/log, TNAME
> becomes ///var/log.
>
> Also if you have verbose mode enabled it actually prints out the extra
> unnecessary leading slashes.
How many bytes does it actually save on a typical system? Is this worth
the overhead of forking an extra 2 processes for every line in the
file?
Would it not be better fixed by requiring TNAME to start with a slash
(which it probably does already), ROOT_DIR to not end with a slash, and
just dropping the intermediate separator?
p.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME
2013-05-20 9:38 ` Phil Blundell
@ 2013-05-20 10:00 ` Jonathan Liu
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Liu @ 2013-05-20 10:00 UTC (permalink / raw)
To: Phil Blundell; +Cc: openembedded-core
On 20/05/2013 7:38 PM, Phil Blundell wrote:
> On Mon, 2013-05-20 at 19:23 +1000, Jonathan Liu wrote:
>> On 20/05/2013 7:19 PM, Phil Blundell wrote:
>>> On Mon, 2013-05-20 at 11:29 +1000, Jonathan Liu wrote:
>>>> - TNAME=${ROOT_DIR}/${TNAME}
>>>> + TNAME=`echo ${ROOT_DIR}/${TNAME} | sed -e 's@^//*@/@'`
>>> Why is this a good thing? Your commit message is rather terse.
>>>
>>> p.
>> It reduces the size of /etc/volatile.cache.
>> Otherwise for example if you have ROOT_DIR=/, TNAME=/var/log, TNAME
>> becomes ///var/log.
>>
>> Also if you have verbose mode enabled it actually prints out the extra
>> unnecessary leading slashes.
> How many bytes does it actually save on a typical system? Is this worth
> the overhead of forking an extra 2 processes for every line in the
> file?
>
> Would it not be better fixed by requiring TNAME to start with a slash
> (which it probably does already), ROOT_DIR to not end with a slash, and
> just dropping the intermediate separator?
>
> p.
That does sound like a better solution, let's go with that.
Regards,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-20 10:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 1:29 [PATCH] populate-volatile.sh: normalize repeated leading slashes in TNAME Jonathan Liu
2013-05-20 9:19 ` Phil Blundell
2013-05-20 9:23 ` Jonathan Liu
2013-05-20 9:38 ` Phil Blundell
2013-05-20 10:00 ` Jonathan Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox