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

Proposed by Jon Tai
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jontai/openvista-gtm-integration/bug440743
Merge into: lp:openvista-gtm-integration
Diff against target: 198 lines (+58/-25)
3 files modified
docs/man1/ovimport.1 (+17/-8)
scripts/etc/bash_completion.d/openvista (+3/-3)
scripts/usr/bin/ovimport (+38/-14)
To merge this branch: bzr merge lp:~jontai/openvista-gtm-integration/bug440743
Reviewer Review Type Date Requested Status
jeff.apple Approve
Review via email: mp+15463@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
=== modified file 'docs/man1/ovimport.1'
--- docs/man1/ovimport.1 2009-07-09 23:48:40 +0000
+++ docs/man1/ovimport.1 2009-12-01 00:20:24 +0000
@@ -2,7 +2,9 @@
2.SH NAME2.SH NAME
3ovimport \- imports routines and globals into a new OpenVista instance3ovimport \- imports routines and globals into a new OpenVista instance
4.SH SYNOPSIS4.SH SYNOPSIS
5.B ovimport [-h] [-V] [-q] [-f] [-r 5.B ovimport [-h] [-V] [-q] [-f] [-c
6.I imported|all|none
7.B ] [-r
6.I routines8.I routines
7.B ] [-g 9.B ] [-g
8.I globals10.I globals
@@ -34,8 +36,13 @@
34flag is given, although imported routines and globals will overwrite any36flag is given, although imported routines and globals will overwrite any
35routines or globals with the same name.37routines or globals with the same name.
36.PP38.PP
37Routines are compiled after the routines are imported. Journaling is39Routines are compiled after the routines are imported. By default, only
38temporarily disabled during the global import to improve performance, unless the 40imported routines are compiled. You should use
41.B -c all
42if you want to recompile all routines or
43.B -c none
44if you do not want to compile any routines. Journaling is temporarily disabled
45during the global import to improve performance, unless the
39.B -f46.B -f
40flag was given. This is safe to do because the database is guaranteed to be47flag was given. This is safe to do because the database is guaranteed to be
41empty before the import, so even if the system crashes and the database is48empty before the import, so even if the system crashes and the database is
@@ -59,14 +66,16 @@
59display help text and exit66display help text and exit
60.IP -V67.IP -V
61display version information and exit68display version information and exit
62.IP -y
63do not ask for confirmation
64.IP -q69.IP -q
65quiet; suppress status messages70quiet; suppress status messages
66.IP -j
67after restoring the backup, apply journal entries
68.IP -f71.IP -f
69force; kill any processes accessing the database before restore72force; import routines and globals even if target instance is not empty
73.IP -c
74compile imported routines only (the default), all routines, or no routines
75.IP -r
76path to routine export file, archive, or directory
77.IP -g
78path to global export file or archive
70.SH "REPORTING BUGS"79.SH "REPORTING BUGS"
71Please report any bugs you encounter at80Please report any bugs you encounter at
72.PP81.PP
7382
=== modified file 'scripts/etc/bash_completion.d/openvista'
--- scripts/etc/bash_completion.d/openvista 2009-04-23 23:17:19 +0000
+++ scripts/etc/bash_completion.d/openvista 2009-12-01 00:20:24 +0000
@@ -134,10 +134,10 @@
134134
135complete -F _ovinstanceadd ovinstanceadd135complete -F _ovinstanceadd ovinstanceadd
136136
137# ovimport [-h] [-V] [-q] [-f] [-r] ROUTINES [-g] GLOBALS INSTANCE_NAME137# ovimport [-h] [-V] [-q] [-f] [-c imported|all|none] [-r] ROUTINES [-g] GLOBALS INSTANCE_NAME
138_ovimport()138_ovimport()
139{139{
140 opts='-h -V -q -f -r -g'140 opts='-h -V -q -f -c -r -g'
141 allowed_nonopt_words=1141 allowed_nonopt_words=1
142142
143 COMPREPLY=()143 COMPREPLY=()
@@ -157,7 +157,7 @@
157 # afterward; use a hack to exit on the next iteration of157 # afterward; use a hack to exit on the next iteration of
158 # the loop158 # the loop
159 allowed_nonopt_words=0159 allowed_nonopt_words=0
160 elif [ x"${COMP_WORDS[i]}" = x"-r" ] || [ x"${COMP_WORDS[i]}" = x"-g" ]; then160 elif [ x"${COMP_WORDS[i]}" = x"-c" ] || [ x"${COMP_WORDS[i]}" = x"-r" ] || [ x"${COMP_WORDS[i]}" = x"-g" ]; then
161 allowed_nonopt_words=`expr $allowed_nonopt_words + 1`161 allowed_nonopt_words=`expr $allowed_nonopt_words + 1`
162 fi162 fi
163 ;;163 ;;
164164
=== modified file 'scripts/usr/bin/ovimport'
--- scripts/usr/bin/ovimport 2009-10-31 06:23:59 +0000
+++ scripts/usr/bin/ovimport 2009-12-01 00:20:24 +0000
@@ -25,16 +25,17 @@
25. /usr/lib/openvista/functions25. /usr/lib/openvista/functions
2626
27# parse arguments27# parse arguments
28while getopts hVqfr:g: option; do28while getopts hVqfc:r:g: option; do
29 case $option in29 case $option in
30 h)30 h)
31 cat <<EOF31 cat <<EOF
32Usage: ovimport [-q] [-f] [-r ROUTINES] [-g GLOBALS] INSTANCE_NAME32Usage: ovimport [-q] [-f] [-c imported|all|none] [-r ROUTINES] [-g GLOBALS] INSTANCE_NAME
33 or ovimport -h33 or ovimport -h
34 or ovimport -V34 or ovimport -V
3535
36 -q quiet; suppress status messages36 -q quiet; suppress status messages
37 -f force; import routines and globals even if target instance is not empty37 -f force; import routines and globals even if target instance is not empty
38 -c compile imported routines only (the default), all routines, or no routines
38 -r path to routine export file, archive, or directory39 -r path to routine export file, archive, or directory
39 -g path to global export file or archive40 -g path to global export file or archive
40 -h display this help text and exit41 -h display this help text and exit
@@ -58,6 +59,9 @@
58 f)59 f)
59 force=true60 force=true
60 ;;61 ;;
62 c)
63 compile=$OPTARG
64 ;;
61 r)65 r)
62 routines=$OPTARG66 routines=$OPTARG
63 ;;67 ;;
@@ -82,7 +86,7 @@
8286
83# check permissions87# check permissions
84in_groups || {88in_groups || {
85 echo "ovimport: permission denied" >&2 89 echo "ovimport: permission denied" >&2
86 exit 190 exit 1
87}91}
8892
@@ -111,9 +115,9 @@
111 }115 }
112fi116fi
113117
114tempdir=`mktemp -d -p "$root/$instance/tmp" .ovimport.XXXXXXXXXX` || 118tempdir=`mktemp -d -p "$root/$instance/tmp" .ovimport.XXXXXXXXXX` ||
115exit_with_error "ovimport" "Unable to create temporary directory"119exit_with_error "ovimport" "Unable to create temporary directory"
116 120
117# the EXIT handler may or may not run if we're interrupted or killed depending121# the EXIT handler may or may not run if we're interrupted or killed depending
118# on the shell used (from what I've read, it does run on bash, but not on122# on the shell used (from what I've read, it does run on bash, but not on
119# dash); use $exit to exit with the correct status in both cases123# dash); use $exit to exit with the correct status in both cases
@@ -190,7 +194,7 @@
190 real_routines=`cd "$dirname"; pwd`/"$basename"194 real_routines=`cd "$dirname"; pwd`/"$basename"
191195
192 # redirect output to a temporary file because we need to both log196 # redirect output to a temporary file because we need to both log
193 # the output and inspect it to determine success 197 # the output and inspect it to determine success
194 (198 (
195 umask 007199 umask 007
196 mumps -run ^%RI > "$tempdir/ovimport.ri" 2>&1 <<EOF200 mumps -run ^%RI > "$tempdir/ovimport.ri" 2>&1 <<EOF
@@ -206,13 +210,15 @@
206210
207 grep '^Restored [0-9]\{1,\} lines in [0-9]\{1,\} routines' "$tempdir/ovimport.ri" > /dev/null ||211 grep '^Restored [0-9]\{1,\} lines in [0-9]\{1,\} routines' "$tempdir/ovimport.ri" > /dev/null ||
208 exit_with_error "ovimport" "Unable to import routines"212 exit_with_error "ovimport" "Unable to import routines"
213
214 awk '{ if ($0 ~ /^Restored [0-9]+ lines in [0-9]+ routines/) { capture = 0 } if (capture == 1 && NF != 0) { print $0 } if ($0 ~ /^Output directory/) { capture = 1 } }' "$tempdir/ovimport.ri" > "$tempdir/ovimport.compile"
209 ;;215 ;;
210 M)216 M)
211 print_status "ovimport" "Copying routines" "$skip_status"217 print_status "ovimport" "Copying routines" "$skip_status"
212218
213 (219 (
214 umask 007220 umask 007
215 rsync -rl --exclude '.*/' --include '*/' --include '*.m' --exclude '*' "$real_routines/" "$root/$instance/routines/"221 rsync -rl --exclude '.*/' --include '*/' --include '*.m' --exclude '*' --out-format='%n' "$real_routines/" "$root/$instance/routines/" > "$tempdir/ovimport.compile"
216 ) || exit_with_error "ovimport" "Unable to import routines"222 ) || exit_with_error "ovimport" "Unable to import routines"
217223
218 # the umask is not enough to guarantee that the routines are user224 # the umask is not enough to guarantee that the routines are user
@@ -225,13 +231,31 @@
225 ;;231 ;;
226 esac232 esac
227233
228 print_status "ovimport" "Compiling routines" "$skip_status"234 case $compile in
229235 all)
230 (236 print_status "ovimport" "Compiling all routines" "$skip_status"
231 umask 007237
232 cd "$root/$instance/objects" &&238 (
233 find "$root/$instance/routines/" -type f -name '*.m' -exec mumps {} \; 2> /dev/null239 umask 007
234 ) || exit_with_error "ovimport" "Unable to compile routines"240 cd "$root/$instance/objects" &&
241 find "$root/$instance/routines/" -type f -name '*.m' -exec mumps {} \; 2> /dev/null
242 ) || exit_with_error "ovimport" "Unable to compile routines"
243 ;;
244 none)
245 print_status "ovimport" "Skipping routine compilation" "$skip_status"
246 ;;
247 *)
248 print_status "ovimport" "Compiling imported routines" "$skip_status"
249
250 (
251 umask 007
252 cd "$root/$instance/objects" &&
253 for routine in `cat "$tempdir/ovimport.compile" | sed 's/\.m//g'`; do
254 mumps "../routines/$routine.m" 2> /dev/null
255 done
256 )
257 ;;
258 esac
235259
236 print_status "ovimport" "Finished loading $routines into $instance" "$skip_status"260 print_status "ovimport" "Finished loading $routines into $instance" "$skip_status"
237fi261fi

Subscribers

People subscribed via source and target branches