Skip to content

Commit

Permalink
Move the emaj.control file from the sql to the root directory. This i…
Browse files Browse the repository at this point in the history
…s where the Makefile is supposed to find it.
  • Loading branch information
beaud76 committed Aug 2, 2017
1 parent 34ea01d commit 0e007b3
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Enhancements:
- Forbid to protect a mark that is logicaly deleted.
- Optimize the execution of alter group operations.
- Improve the installation procedure when E-Maj is downloaded from pgxn.org.
The emaj.control file is now in the root directory.
- Improve some error messages.

Bug fixes:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ To perform this task:

pg_config --sharedir

* copy the emaj.contol file from the sql subdirectory of the decompressed structure into the *SHAREDIR* directory,
* copy the emaj.contol file from the root directory of the decompressed structure into the *SHAREDIR* directory,
* adjust the *directory* parameter of the *emaj.control* file to reflect the actual location of the E-Maj components.

2 changes: 1 addition & 1 deletion docs/fr/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ Pour ce faire :

pg_config --sharedir

* Copier le fichier emaj.control fourni dans le répertoire sql de la version décompressée vers le répertoire *SHAREDIR*,
* Copier le fichier emaj.control fourni dans le répertoire racine de la version décompressée vers le répertoire *SHAREDIR*,
* Adapter la directive *directory* du fichier *emaj.control* pour spécifier le répertoire sql contenant les scripts d’installation d’E-Maj.

File renamed without changes.
1 change: 0 additions & 1 deletion test/91/expected/upgrade_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SET default_tablespace TO tspemaj;
-----------------------------
-- emaj update to next_version
-----------------------------
--\! cp /usr/local/pg912/share/postgresql/extension/emaj.control.0.12.0 /usr/local/pg912/share/postgresql/extension/emaj.control
-- check the extension is available
select * from pg_available_extension_versions where name = 'emaj';
name | version | installed | superuser | relocatable | schema | requires | comment
Expand Down
1 change: 0 additions & 1 deletion test/93/expected/upgrade_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SET default_tablespace TO tspemaj;
-----------------------------
-- emaj update to next_version
-----------------------------
--\! cp /usr/local/pg912/share/postgresql/extension/emaj.control.0.12.0 /usr/local/pg912/share/postgresql/extension/emaj.control
-- check the extension is available
select * from pg_available_extension_versions where name = 'emaj';
name | version | installed | superuser | relocatable | schema | requires | comment
Expand Down
1 change: 0 additions & 1 deletion test/95/expected/upgrade_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SET default_tablespace TO tspemaj;
-----------------------------
-- emaj update to next_version
-----------------------------
--\! cp /usr/local/pg912/share/postgresql/extension/emaj.control.0.12.0 /usr/local/pg912/share/postgresql/extension/emaj.control
-- check the extension is available
select * from pg_available_extension_versions where name = 'emaj';
name | version | installed | superuser | relocatable | schema | requires | comment
Expand Down
1 change: 0 additions & 1 deletion test/sql/upgrade_while_logging.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SET default_tablespace TO tspemaj;
-----------------------------
-- emaj update to next_version
-----------------------------
--\! cp /usr/local/pg912/share/postgresql/extension/emaj.control.0.12.0 /usr/local/pg912/share/postgresql/extension/emaj.control

-- check the extension is available
select * from pg_available_extension_versions where name = 'emaj';
Expand Down
2 changes: 1 addition & 1 deletion tools/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mkdir tsplog1
mkdir tsplog2

# Copy and adjust the emaj.control file # if pg 9.1+
sudo cp $EMAJDIR/sql/emaj.control /usr/local/pg$PGVERSION/share/postgresql/extension/emaj.control
sudo cp $EMAJDIR/emaj.control /usr/local/pg$PGVERSION/share/postgresql/extension/emaj.control
sudo bash -c "echo \"directory = '$EMAJDIR/sql'\" >>/usr/local/pg$PGVERSION/share/postgresql/extension/emaj.control"

# Create all what is needed inside the cluster (tablespaces, roles, extensions,...)
Expand Down
22 changes: 14 additions & 8 deletions tools/create_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
# Tool to create a new version from the un-versionned emaj environment
# Usage:
# cd ~/proj
# sh emaj/tools/create_version <new_version>
# bash emaj/tools/create_version <new_version>
#
# If the operation has to be reverted:
# rm -Rf ~/proj/<new directory>
# and on ~/proj/emaj:
# git reset HEAD
# git checkout *
# rm sql/emaj--<new_vers>--next_version.sql
# rm sql/emaj--<old_vers>--<new_vers>.sql

# Checks
# ------
Expand Down Expand Up @@ -45,11 +53,6 @@
find -name "*~" -type f -exec rm '{}' \;
cd ..

# tag the new version (do it manually, once the changes are committed)
# cd emaj
# git tag 'v$NEW'
# cd ..

# Create the new version environment
# ----------------------------------

Expand All @@ -71,7 +74,7 @@

# Process sql directory: change version identifiers inside the right files (excluding migration scripts)
for file in sql/*; do
if [[ ! $file =~ "(--|-to-|control)" ]]; then
if [[ ! $file =~ "(--|-to-)" ]]; then
sed -i "s/<NEXT_VERSION>/${NEW}/g" $file
sed -i "s/next_version/${NEW}/g" $file
fi
Expand All @@ -81,6 +84,9 @@
# Change version identifiers inside files from /php + /tools + META.json README.md
find php tools META.json README.md -type f -exec sed -i "s/<NEXT_VERSION>/${NEW}/g" '{}' \;

# Change version identifiers inside emaj.control
sed -i "s/next_version/${NEW}/g" emaj.control

# Change version identifiers inside files from /test/sql
find test/sql -type f -exec sed -i "s/<NEXT_VERSION>/${NEW}/g" '{}' \;
find test/sql -type f -exec sed -i "s/-to-next.sql/-to-${NEW}.sql/g" '{}' \;
Expand Down Expand Up @@ -116,5 +122,5 @@
# End of processing
# -----------------
echo "--> New version $NEW is ready."
echo "Don't forget to: git commit -am 'Setup new $NEW version' on both environments..."
echo "Don't forget to: git commit -am 'Setup the new $NEW version' on both environments..."

4 changes: 2 additions & 2 deletions tools/regress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ cd $EMAJ_HOME

# update the emaj.control files with the proper emaj version
echo "Customizing emaj.control files..."
for dir in $PGDIR91 $PGDIR92 $PGDIR93 $PGDIR94 $PGDIR95 $PGDIR96 ; do
sudo cp sql/emaj.control $dir/share/postgresql/extension/emaj.control
for dir in $PGDIR91 $PGDIR92 $PGDIR93 $PGDIR94 $PGDIR95 $PGDIR96 $PGDIR10 ; do
sudo cp emaj.control $dir/share/postgresql/extension/emaj.control
sudo sed -ri "s/^#directory\s+= .*$/directory = '\/home\/postgres\/proj\/emaj\/sql\/'/" $dir/share/postgresql/extension/emaj.control
done

Expand Down

0 comments on commit 0e007b3

Please sign in to comment.