Alon Bar-Lev has posted comments on this change.

Change subject: core:  exportDbSchema scripts generates output...
......................................................................


Patch Set 1:

(11 comments)

....................................................
File packaging/dbscripts/exportDbSchema.sh
Line 1
Line 2
Line 3
no need pushd, just cd


Line 16
Line 17
Line 18
Line 19
Line 20
no need for popd


Line 17
Line 18
Line 19
Line 20
Line 21
do not exit here


Line 21
Line 22
Line 23
Line 24
Line 25
should be:

 [ -n "${VERBOSE}" ] && echo "DEBUG: $*"

or in current state:

 [ "${VERBOSE}" = "false" ] && echo ...


Line 34
Line 35
Line 36
Line 37
Line 38
usage; exit 1


Line 40
Line 41
Line 42
Line 43
Line 44
I agree with sandro, we must never put files in working directory.


Line 44
Line 45
Line 46
Line 47
Line 48
please just use echo


Line 45
Line 46
Line 47
Line 48
Line 49
no need popd


Line 5: source ./dbcustomfunctions.sh
Line 6: 
Line 7: #setting defaults
Line 8: set_defaults
Line 9: VERBOSE=false
VERBOSE=

and check for [ -n "${VERBOSE}" ] not that important
Line 10: 
Line 11: usage() {
Line 12:     printf "Usage: ${ME} [-h] [-s SERVERNAME] [-p PORT] [-d DATABASE] 
[-u USERNAME] [-v]\n"
Line 13:     printf "\n"


Line 8: set_defaults
Line 9: VERBOSE=false
Line 10: 
Line 11: usage() {
Line 12:     printf "Usage: ${ME} [-h] [-s SERVERNAME] [-p PORT] [-d DATABASE] 
[-u USERNAME] [-v]\n"
not sure what ME is... $0 should be used, please also fix this as we 
discussed...

 cat << __EOF__
adsad
sadad
sadasd
__EOF__
Line 13:     printf "\n"
Line 14:     printf "\t-s SERVERNAME - The database servername for the database 
(def. ${SERVERNAME})\n"
Line 15:     printf "\t-p PORT       - The database servername port for the 
database (def. ${PORT})\n"
Line 16:     printf "\t-d DATABASE   - The database name                        
(def. ${DATABASE})\n"


Line 45: CMD="select version from schema_version where current;"
Line 46: VERSION=$(psql -w -U ${USERNAME} --pset=tuples_only=on ${DATABASE} -h 
${SERVERNAME} -p ${PORT} -c "${CMD}" | sed 's/^ *//g')
Line 47: FILE=".${DATABASE}.${VERSION}.schema"
Line 48: if [[ "${VERBOSE}" = "true" ]]; then
Line 49:     pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} 
-h ${SERVERNAME} -p ${PORT}  -v
correct.
Line 50: else
Line 51:     pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} 
-h ${SERVERNAME} -p ${PORT}
Line 52: fi
Line 53: 


-- 
To view, visit http://gerrit.ovirt.org/19679
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d05e96f4abc66e293db23af89285b0653025537
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin PeÅ™ina <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to