Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066555
D5499.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5499.id.diff
View Options
diff --git a/sql/Makefile b/sql/Makefile
--- a/sql/Makefile
+++ b/sql/Makefile
@@ -1,6 +1,7 @@
# Depends: postgresql-client, postgresql-autodoc
-DBNAME = softwareheritage-dev
+# When running with pifpaf, $PGDATABASE is already set in the environment
+PGDATABASE ?= softwareheritage-dev
DOCDIR = autodoc
SQL_FILES = $(sort $(wildcard $(CURDIR)/../swh/storage/sql/*.sql))
@@ -16,9 +17,9 @@
createdb: createdb-stamp
createdb-stamp: $(SQL_FILES)
ifeq ($(PIFPAF),)
- -dropdb $(DBNAME)
+ -dropdb $(PGDATABASE)
endif
- createdb $(DBNAME)
+ createdb $(PGDATABASE)
ifeq ($(PIFPAF),)
touch $@
else
@@ -27,7 +28,7 @@
filldb: filldb-stamp
filldb-stamp: createdb-stamp
- cat $(SQL_FILES) | $(PSQL) $(DBNAME)
+ cat $(SQL_FILES) | $(PSQL) $(PGDATABASE)
ifeq ($(PIFPAF),)
touch $@
else
@@ -35,18 +36,18 @@
endif
dropdb:
- -dropdb $(DBNAME)
+ -dropdb $(PGDATABASE)
dumpdb: swh.dump
swh.dump: filldb-stamp
- pg_dump -Fc $(DBNAME) > $@
+ pg_dump -Fc $(PGDATABASE) > $@
$(DOCDIR):
test -d $(DOCDIR)/ || mkdir $(DOCDIR)
doc: autodoc-stamp $(DOCDIR)/db-schema.pdf $(DOCDIR)/db-schema.svg
autodoc-stamp: filldb-stamp $(DOCDIR)
- postgresql_autodoc -d $(DBNAME) -f $(DOCDIR)/db-schema
+ postgresql_autodoc -d $(PGDATABASE) -f $(DOCDIR)/db-schema
cp -a $(DOCDIR)/db-schema.dot $(DOCDIR)/db-schema.dot.orig
ifeq ($(PIFPAF),)
touch $@
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 3:04 PM (12 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220344
Attached To
D5499: docs: Fix db-schema.svg generation to use pifpaf-created database
Event Timeline
Log In to Comment