Merge lp:~elachuni/ubuntu-webcatalog/verify-dependencies-script into lp:ubuntu-webcatalog

Proposed by Anthony Lenton
Status: Merged
Approved by: Anthony Lenton
Approved revision: 40
Merged at revision: 40
Proposed branch: lp:~elachuni/ubuntu-webcatalog/verify-dependencies-script
Merge into: lp:ubuntu-webcatalog
Diff against target: 24 lines (+19/-0)
1 file modified
scripts/verify-dependencies.sh (+19/-0)
To merge this branch: bzr merge lp:~elachuni/ubuntu-webcatalog/verify-dependencies-script
Reviewer Review Type Date Requested Status
Ricardo Kirkner (community) Approve
Review via email: mp+67237@code.launchpad.net

Commit message

Add a script to verify installed dependencies automatically

Description of the change

Details
=======
This branch adds a script that verifies the installed dependencies automatically. As part of our deploy-from-a-branch effort, the provided script should be run before restarting Apache as part of a preflight checklist.

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'scripts'
2=== added file 'scripts/verify-dependencies.sh'
3--- scripts/verify-dependencies.sh 1970-01-01 00:00:00 +0000
4+++ scripts/verify-dependencies.sh 2011-07-07 18:25:29 +0000
5@@ -0,0 +1,19 @@
6+#!/bin/bash
7+
8+DEPS_PACKAGE=ubuntu-webcatalog-dependencies
9+REQUIRED_VERSION=11.07.2~0.IS.10.04
10+
11+if test `dpkg -l $DEPS_PACKAGE 2> /dev/null |grep ^ii|wc -l` -eq 1; then
12+ INSTALLED_VERSION=`dpkg-query -W -f '${Version}\n' $DEPS_PACKAGE`
13+ if test $REQUIRED_VERSION = $INSTALLED_VERSION; then
14+ echo "Version of $DEPS_PACKAGE is OK"
15+ else
16+ echo "Incorrect version of $DEPS_PACKAGE is installed."
17+ echo "Required version is $REQUIRED_VERSION"
18+ echo "Installed version is $INSTALLED_VERSION"
19+ exit 1
20+ fi
21+else
22+ echo "$DEPS_PACKAGE not installed."
23+ exit 1
24+fi

Subscribers

People subscribed via source and target branches