Page MenuHomeSoftware Heritage

D5499.id.diff
No OneTemporary

D5499.id.diff

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

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

Event Timeline