Merge lp:~mgunes/whatchanged/package-name-validation into lp:whatchanged

Proposed by Murat Gunes
Status: Merged
Merged at revision: 6
Proposed branch: lp:~mgunes/whatchanged/package-name-validation
Merge into: lp:whatchanged
Diff against target: 43 lines (+11/-1)
1 file modified
whatchanged (+11/-1)
To merge this branch: bzr merge lp:~mgunes/whatchanged/package-name-validation
Reviewer Review Type Date Requested Status
Murat Gunes Approve
Review via email: mp+39678@code.launchpad.net

Description of the change

Merge after some testing - looks good

To post a comment you must log in.
Revision history for this message
Murat Gunes (mgunes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'whatchanged'
--- whatchanged 2010-10-30 01:34:56 +0000
+++ whatchanged 2010-10-30 03:02:39 +0000
@@ -37,7 +37,7 @@
37 SOURCE_PACKAGE_NAME=$(apt-cache madison ${PACKAGE_NAME} | grep Sources | tail -n 1 | awk '{print $1}')37 SOURCE_PACKAGE_NAME=$(apt-cache madison ${PACKAGE_NAME} | grep Sources | tail -n 1 | awk '{print $1}')
38 INSTALLED_VERSION=$(apt-cache policy $PACKAGE_NAME | grep Installed: | cut -c 14-)38 INSTALLED_VERSION=$(apt-cache policy $PACKAGE_NAME | grep Installed: | cut -c 14-)
39 CANDIDATE_VERSION=$(apt-cache policy $PACKAGE_NAME | grep Candidate: | cut -c 14-)39 CANDIDATE_VERSION=$(apt-cache policy $PACKAGE_NAME | grep Candidate: | cut -c 14-)
4040 VALIDATION_BOOL=$(dpkg -l $PACKAGE_NAME &> /dev/null)$?
4141
42# ----------------------------------------------------------------42# ----------------------------------------------------------------
43# ----------------------------------------------------------------43# ----------------------------------------------------------------
@@ -166,6 +166,13 @@
166# ----------------------------------------------------------------166# ----------------------------------------------------------------
167# ----------------------------------------------------------------167# ----------------------------------------------------------------
168168
169function validate_name
170# Check whether this is a valid package name
171{
172 if [ "$VALIDATION_BOOL" = "1" ]; then
173 error_exit "${PACKAGE_NAME} is not a valid Ubuntu package. Exiting."
174 fi
175}
169176
170function check_candidate177function check_candidate
171{178{
@@ -214,6 +221,8 @@
214221
215check_root222check_root
216223
224validate_name
225
217# Trap TERM, HUP, and INT signals and properly exit226# Trap TERM, HUP, and INT signals and properly exit
218227
219trap "signal_exit TERM" TERM HUP228trap "signal_exit TERM" TERM HUP
@@ -256,6 +265,7 @@
256# echo $PACKAGE_NAME265# echo $PACKAGE_NAME
257# sleep 2000266# sleep 2000
258267
268
259# Exit269# Exit
260270
261proper_exit271proper_exit

Subscribers

People subscribed via source and target branches

to all changes: