Change 29243

tom_tyler (C. Thomas Tyler)
C. Thomas Tyler committed this change into /
Request Review
Download .zip
Fixed issue with sdp_upgrade.sh where extraction of values with a '=' in the
value were not extracted correctly.  For example, the p4_N.vars file could
contain a value like so:

export PROXY_V_FLAGS="-v net.autotune=1"

This was parsed with:  cut -d '=' -f 2, returning incomplete text:

-v net.autotune    (sans the "=1" on the right side).

The fix was done by changing, in some places:

    cut -d '=' -f 2

with a more robust expression:

    perl -pe 's|^.*?=||g'

In some cases where the value to the right of the '=' was reliably simple, e.g.
for something like SDP_INSTANCE_VARS_FORMAT=1.5, the simpler 'cut' expression
was left in place.  The perl expression is used in places where the right-side
of the assignment could possibly be a more complex value, possibly including
an '=' sign.

Note: sed was explored, but Perl was ultimately selected as the 'sed' regular
expressions, even extended ones with '-E', do not support lazy regex macthing,
as needed for this expression.
  • Files 1
  • Comments 0
1 edited 0 added 0 deleted
guest/perforce_software/sdp/dev/Server/Unix/p4/common/sdp_upgrade/sdp_upgrade.sh#29
Loading...
Tip: Use n and p to cycle through the changes.