Merge lp:~jml/launchpad/schema-makefile-cleanup into lp:launchpad/db-devel

Proposed by Jonathan Lange
Status: Merged
Approved by: Deryck Hodge
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/schema-makefile-cleanup
Merge into: lp:launchpad/db-devel
Diff against target: None lines
To merge this branch: bzr merge lp:~jml/launchpad/schema-makefile-cleanup
Reviewer Review Type Date Requested Status
Deryck Hodge (community) Approve
Review via email: mp+9630@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This fixes up the newsampledata target so that the generated files include copyright messages.

It also adds all of the targets in the file to .PHONY, since none of them actually generate files that match the target name, and if files that *do* match the target name exist, we still want to rerun the target.

Revision history for this message
Jonathan Lange (jml) wrote :

> This fixes up the newsampledata target so that the generated files include
> copyright messages.
>
> It also adds all of the targets in the file to .PHONY, since none of them
> actually generate files that match the target name, and if files that *do*
> match the target name exist, we still want to rerun the target.

Verified that this is indeed a fix, and removed superfluous dashes from the template in the Makefile.

Revision history for this message
Deryck Hodge (deryck) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/Makefile'
2--- database/schema/Makefile 2009-07-13 03:05:37 +0000
3+++ database/schema/Makefile 2009-08-04 10:13:01 +0000
4@@ -42,14 +42,20 @@
5 # The command we use to drop (if exists) and recreate a database.
6 CREATEDB=${PYTHON} ../../utilities/pgmassacre.py -t
7
8+HEADER="--- Copyright 2009 Canonical Ltd. This software is licensed under \
9+ the\n--- GNU Affero General Public License version 3 (see the file \
10+ LICENSE)."
11+
12 # The command used (in conjunction with $(call)) to dump the contents of the
13 # given database ($1) into an SQL file ($2).
14 build_new_sampledata=$(PYTHON) fti.py --null -d ${1} -q; \
15+ echo $(HEADER) > $(2); \
16 pg_dump --schema=public --disable-triggers -a -D -O -d ${1} \
17 | grep -v "\( TOC \|INSERT INTO launchpaddatabaserevision \|sessiondata\|sessionpkgdata\|SELECT pg_catalog\.setval\|^--\| fticache \|'fticache'\|ALTER TABLE secret\|INSERT INTO secret\)" \
18- | $(PYTHON) sort_sql.py > $(2); \
19+ | $(PYTHON) sort_sql.py >> $(2); \
20 $(PYTHON) fti.py --force -d ${1} -q
21
22+
23 # The latest schema dump from production. Database patches are relative
24 # to this baseline. This dump should be updated every production rollout
25 # to ensure that the development database remains in sync with reality
26@@ -186,5 +192,5 @@
27 $(call build_new_sampledata,${TEMPLATE_WITH_TEST_SAMPLEDATA},${LINTDATA})
28 $(call build_new_sampledata,${TEMPLATE_WITH_DEV_SAMPLEDATA},${LINTDATA_DEV})
29
30-.PHONY: default base all
31+.PHONY: default test dev create check search_path all doc diagram newsampledata_test newsampledata_dev newsampledata lintdata
32

Subscribers

People subscribed via source and target branches

to status/vote changes: