Martin Peřina has posted comments on this change.
Change subject: core: exportDbSchema scripts generates output...
......................................................................
Patch Set 1:
(1 comment)
....................................................
File packaging/dbscripts/exportDbSchema.sh
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
Well, this one is much more readable and maintainable for me:
[[ $VERBOSE == "true" ]] && VERB_ARG="-v"
pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} -h
${SERVERNAME} -p ${PORT} ${VERB_ARG}
than this one:
if [[ "${VERBOSE}" = "true" ]]; then
pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} -h
${SERVERNAME} -p ${PORT} -v
else
pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} -h
${SERVERNAME} -p ${PORT}
fi
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