-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
omdb.dump | ||
www.omdb.org/ | ||
www.omdb.org/data/*.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# using PG version with archive format compatible with older releases | ||
PGVERSION = 11 | ||
# use oldest pg_dump available (>= 10) so the dump format is most compatible | ||
PG_DUMP = $(firstword $(shell ls -v /usr/lib/postgresql/[123]*/bin/pg_dump /usr/pgsql-[123]*/bin/pg_dump 2> /dev/null)) | ||
PGVERSION0 = $(patsubst /usr/lib/postgresql/%/bin/pg_dump,%,$(PG_DUMP)) | ||
PGVERSION = $(patsubst /usr/pgsql-%/bin/pg_dump,%,$(PGVERSION0)) | ||
PGUSER = postgres | ||
|
||
dump: omdb.dump | ||
|
||
omdb.dump: www.omdb.org/data/all_movies.csv.bz2 | ||
pg_virtualenv -i '--auth=trust --username=$(PGUSER)' -v $(PGVERSION) sh -c "export PGUSER=$(PGUSER) && ./import && PATH=/usr/lib/postgresql/$(PGVERSION)/bin:/usr/pgsql-$(PGVERSION)/bin:$(PATH) pg_dump -Fc -f $@ omdb" | ||
omdb.dump: www.omdb.org/data/all_movies.csv | ||
pg_virtualenv -i '--auth=trust --username=$(PGUSER)' -v $(PGVERSION) \ | ||
sh -c "export PGUSER=$(PGUSER) && \ | ||
./import && \ | ||
$(PG_DUMP) -Fc -f $@ omdb" | ||
|
||
www.omdb.org/data/all_movies.csv.bz2: | ||
./download | ||
|
||
clean: | ||
rm -rf omdb.dump www.omdb.org | ||
rm -f omdb.dump www.omdb.org/data/*.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters