Skip to content

Commit

Permalink
Resolve conflicts in port of #1483
Browse files Browse the repository at this point in the history
This addresses two conflicts:
* The numbering of the instructions in INSTALL.md had to be adjusted for
 the new pg-gvm installation step.
* The check_db_extensions function now includes the check for and the
 creation of the pg-gvm extension.
  • Loading branch information
timopollmeier committed Apr 29, 2021
1 parent 6736dd4 commit af32c89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
26 changes: 3 additions & 23 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,13 @@ Certificates`.
grant dba to mattm; # mattm is the user created in step 4
```

<<<<<<< HEAD
6. Create DB extensions (also necessary when the database got dropped).

```sh
sudo -u postgres bash # if you logged out after step 5
psql gvmd
create extension "uuid-ossp";
create extension "pgcrypto";
create extension "pg-gvm"; # if it is not installed in step 2.
```

7. Make Postgres aware of the gvm libraries if not installed
in a ld-aware directory. For example create file `/etc/ld.so.conf.d/gvm.conf`
with appropriate path and then run `ldconfig`.

8. Run Manager as usual.

9. To run SQL on the database.
=======
5. Make Postgres aware of the gvm libraries if not installed
6. Make Postgres aware of the gvm libraries if not installed
in a ld-aware directory. For example create file `/etc/ld.so.conf.d/gvm.conf`
with appropriate path and then run `ldconfig`.

6. Run Manager as usual.
7. Run Manager as usual.

7. To run SQL on the database.
>>>>>>> 14614dcde... Remove creation of DB extensions from INSTALL.md
8. To run SQL on the database.

```sh
psql gvmd
Expand Down
10 changes: 3 additions & 7 deletions src/manage_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2921,14 +2921,9 @@ db_extension_available (const char *name)
int
check_db_extensions ()
{
<<<<<<< HEAD
if (db_extension_installed ("uuid-ossp")
&& db_extension_installed ("pgcrypto")
&& db_extension_installed ("pg-gvm"))
=======
if (db_extension_available ("uuid-ossp")
&& db_extension_available ("pgcrypto"))
>>>>>>> 7ff40fb85... Try to install PostgreSQL extensions automatically
&& db_extension_available ("pgcrypto")
&& db_extension_available ("pg-gvm"))
{
g_debug ("%s: All required extensions are available.", __func__);

Expand All @@ -2937,6 +2932,7 @@ check_db_extensions ()

sql ("CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"");
sql ("CREATE EXTENSION IF NOT EXISTS \"pgcrypto\"");
sql ("CREATE EXTENSION IF NOT EXISTS \"pg-gvm\"");

sql ("RESET ROLE;");
return 0;
Expand Down

0 comments on commit af32c89

Please sign in to comment.