Merge lp:~jontai/openvista-gtm-integration/bug409102 into lp:openvista-gtm-integration

Proposed by Jon Tai
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jontai/openvista-gtm-integration/bug409102
Merge into: lp:openvista-gtm-integration
Diff against target: 41 lines
1 file modified
scripts/usr/sbin/ovinstanceadd (+21/-3)
To merge this branch: bzr merge lp:~jontai/openvista-gtm-integration/bug409102
Reviewer Review Type Date Requested Status
jeff.apple Approve
Review via email: mp+13749@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jeff.apple (jeff-apple) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/usr/sbin/ovinstanceadd'
2--- scripts/usr/sbin/ovinstanceadd 2009-08-11 20:47:56 +0000
3+++ scripts/usr/sbin/ovinstanceadd 2009-10-22 01:00:24 +0000
4@@ -111,8 +111,26 @@
5 exit 1
6 fi
7
8-# find the latest version of GT.M installed on this system
9-gtm=`ls -B -1 /opt/lsb-gtm 2> /dev/null | tail -n1`
10+# find the latest version of GT.M installed on this system. to qualify as a
11+# valid GT.M version, the GT.M directory must contain a mumps executable and an
12+# openvista.xc file (the latter is installed by the corresponding
13+# openvista-libs-* package)
14+#
15+# sort using only the GT.M version (not including the _ and the arch) because _
16+# sorts after A, so if we were to use the entire directory name, V5.3-004A_i686
17+# would come before V5.3-004_i686 (so V5.3-004_i686 would be considered the
18+# "later" version), which is wrong.
19+for version in `ls -1 -d /opt/lsb-gtm/V*_i686 /opt/lsb-gtm/V*_x86_64 2> /dev/null | cut -d _ -f 1 | sort -r`; do
20+ # prefer 64-bit GT.M over 32-bit GT.M
21+ if [ -x "${version}_x86_64/mumps" ] && [ -f "${version}_x86_64/openvista.xc" ]; then
22+ gtm="${version}_x86_64"
23+ break
24+ fi
25+ if [ -x "${version}_i686/mumps" ] && [ -f "${version}_i686/openvista.xc" ]; then
26+ gtm="${version}_i686"
27+ break
28+ fi
29+done
30
31 if [ -z "$gtm" ]; then
32 echo "ovinstanceadd: No versions of GT.M found in /opt/lsb-gtm" >&2
33@@ -159,7 +177,7 @@
34 install -o root -g $user -m 2770 -d "$root/$instance/backups" &&
35 install -o root -g $user -m 2750 -d "$root/$instance/etc" &&
36 install -o root -g $user -m 2770 -d "$root/$instance/tmp" &&
37- ln -s "/opt/lsb-gtm/$gtm" "$root/$instance/gtm"
38+ ln -s "$gtm" "$root/$instance/gtm"
39 } || {
40 echo "ovinstanceadd: Unable to create instance directories" >&2
41 exit 1

Subscribers

People subscribed via source and target branches