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

Proposed by Jon Tai
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jontai/openvista-gtm-integration/bug404177
Merge into: lp:openvista-gtm-integration
Diff against target: None lines
To merge this branch: bzr merge lp:~jontai/openvista-gtm-integration/bug404177
Reviewer Review Type Date Requested Status
jeff.apple Approve
Review via email: mp+9719@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/bin/ovbackup'
2--- scripts/usr/bin/ovbackup 2009-08-04 21:05:22 +0000
3+++ scripts/usr/bin/ovbackup 2009-08-05 20:25:42 +0000
4@@ -106,6 +106,9 @@
5 # this signal is used to indicate failure of mupip backup, which is run in the background below
6 trap 'logger -p user.info -t "ovbackup[$$]" -- Backup of $instance failed: Unable to copy default.dat database file; echo "ovbackup: Unable to copy default.dat database file" >&2; rm -rf "$tempdir"; exit ${exit:=1}' USR1
7
8+# store the version of GT.M the current instance is using in the backup file per bug404177
9+echo -e 'W $ZVERSION\nH\n' | mumps -dir 2>&1 | grep -v '^$' | grep -v '>$' > "$tempdir/gtm_version"
10+
11 print_status "ovbackup" "Copying routines" "$skip_status"
12
13 cp -a "$root/$instance/routines" "$tempdir" ||
14@@ -182,7 +185,7 @@
15
16 (
17 umask 007
18- tar -c --remove-files `choose_bzip2` -f "$tempdir/${instance}-$timestamp.tar.bz2" -C "$tempdir" routines globals
19+ tar -c --remove-files `choose_bzip2` -f "$tempdir/${instance}-$timestamp.tar.bz2" -C "$tempdir" gtm_version routines globals
20 ) || exit_with_error "ovbackup" "Unable to compress temporary backup directory"
21
22 # since redirection is not safe (it follows symlinks), create the file in the
23
24=== modified file 'scripts/usr/sbin/ovrestore'
25--- scripts/usr/sbin/ovrestore 2009-08-04 21:05:22 +0000
26+++ scripts/usr/sbin/ovrestore 2009-08-05 20:25:42 +0000
27@@ -161,6 +161,15 @@
28 [ -f "$tempdir/globals/mumps.gld" ] || exit_with_error "ovrestore" "Backup file does not contain mumps.gld global directory file"
29 [ -f "$tempdir/globals/default.dat" ] || exit_with_error "ovrestore" "Backup file does not contain default.dat database file"
30
31+if [ -f "$tempdir/gtm_version" ]; then
32+ backup_gtm_version=`cat "$tempdir/gtm_version"`
33+ target_gtm_version=`echo -e 'W $ZVERSION\nH\n' | mumps -dir 2>&1 | grep -v '^$' | grep -v '>$'`
34+ [ "$backup_gtm_version" = "$target_gtm_version" ] ||
35+ exit_with_error "ovrestore" "Backup file was created with $backup_gtm_version; target OpenVista instance is running $target_gtm_version"
36+else
37+ logger -p user.info -t "ovrestore[$$]" Backup file does not contain GT.M version information
38+fi
39+
40 # at this point, we're committed... we're about to kill processes, lock the
41 # instance, overwrite files, etc.
42

Subscribers

People subscribed via source and target branches