public inbox for [email protected]  
help / color / mirror / Atom feed
From: Philippe BEAUDOIN <[email protected]>
To: [email protected]
Cc: Thibaud Walkowiak <[email protected]>
Subject: Extension uninstall issue with PGXS
Date: Mon, 6 May 2024 10:29:12 +0200
Message-ID: <[email protected]> (raw)

Hi all,

I am in trouble when building an extension with PGXS. At uninstall time, 
the documentation and script files are not removed.

The specificity of my distribution tree is that these script and 
documentation files are located into subdirectories. So in the Makefile, 
the DOCS and SCRIPTS variables are described like DATA, with something like:
DOCS         = \$(wildcard doc/*)
SCRIPTS      = \$(wildcard script/*)

At install time, all files of both subdirectories are correctly copied 
into the DOCDIR and BINDIR directories respectively.
But at uninstall time, these files are not removed.

Attached is a simple test case that reproduces the issue, with the 
execution result on my PC.

As you can see, the uninstall step tries to remove files from DOCDIR and 
BINDIR, using the original subdirectories.

I don't know if this can be considered as a bug or if it is a functional 
limitation or if there is a better way to code the Makefile.

Kind regards. Philippe.


------------ Install the extension ------------
make: rien à faire pour « all ».
/bin/mkdir -p '/usr/share/postgresql/14/extension'
/bin/mkdir -p '/usr/share/postgresql/14/myext'
/bin/mkdir -p '/usr/share/doc/postgresql-doc-14/myext'
/bin/mkdir -p '/usr/lib/postgresql/14/bin'
/usr/bin/install -c -m 644 .//myext.control '/usr/share/postgresql/14/extension/'
/usr/bin/install -c -m 644 .//sql/myext_1.0.0.sql  '/usr/share/postgresql/14/myext/'
/usr/bin/install -c -m 644 .//doc/mydoc1 .//doc/mydoc2 '/usr/share/doc/postgresql-doc-14/myext/'
/usr/bin/install -c -m 755 .//script/myscript1 .//script/myscript2 '/usr/lib/postgresql/14/bin/'
------------ Check ------------
/usr/share/postgresql/14/extension/myext.control
myext_1.0.0.sql
/usr/lib/postgresql/14/bin/myscript1  /usr/lib/postgresql/14/bin/myscript2
mydoc1	mydoc2
------------ Uninstall the extension ------------
rm -f '/usr/share/postgresql/14/extension'/myext.control
rm -f '/usr/share/postgresql/14/myext'/myext_1.0.0.sql
rm -f '/usr/share/doc/postgresql-doc-14/myext'/doc/mydoc1 '/usr/share/doc/postgresql-doc-14/myext'/doc/mydoc2
rm -f '/usr/lib/postgresql/14/bin'/script/myscript1 '/usr/lib/postgresql/14/bin'/script/myscript2
------------ Check (nothing should be found here) ------------
ls: impossible d'accéder à '/usr/share/postgresql/14/extension/myext.control': Aucun fichier ou dossier de ce nom
ls: impossible d'accéder à '/usr/share/postgresql/14/extension/myext': Aucun fichier ou dossier de ce nom
/usr/lib/postgresql/14/bin/myscript1  /usr/lib/postgresql/14/bin/myscript2
mydoc1	mydoc2



Attachments:

  [application/x-shellscript] testcase.sh (1.5K, 2-testcase.sh)
  download

  [text/plain] testcase.out (1.5K, 3-testcase.out)
  download | inline:
------------ Install the extension ------------
make: rien à faire pour « all ».
/bin/mkdir -p '/usr/share/postgresql/14/extension'
/bin/mkdir -p '/usr/share/postgresql/14/myext'
/bin/mkdir -p '/usr/share/doc/postgresql-doc-14/myext'
/bin/mkdir -p '/usr/lib/postgresql/14/bin'
/usr/bin/install -c -m 644 .//myext.control '/usr/share/postgresql/14/extension/'
/usr/bin/install -c -m 644 .//sql/myext_1.0.0.sql  '/usr/share/postgresql/14/myext/'
/usr/bin/install -c -m 644 .//doc/mydoc1 .//doc/mydoc2 '/usr/share/doc/postgresql-doc-14/myext/'
/usr/bin/install -c -m 755 .//script/myscript1 .//script/myscript2 '/usr/lib/postgresql/14/bin/'
------------ Check ------------
/usr/share/postgresql/14/extension/myext.control
myext_1.0.0.sql
/usr/lib/postgresql/14/bin/myscript1  /usr/lib/postgresql/14/bin/myscript2
mydoc1	mydoc2
------------ Uninstall the extension ------------
rm -f '/usr/share/postgresql/14/extension'/myext.control
rm -f '/usr/share/postgresql/14/myext'/myext_1.0.0.sql
rm -f '/usr/share/doc/postgresql-doc-14/myext'/doc/mydoc1 '/usr/share/doc/postgresql-doc-14/myext'/doc/mydoc2
rm -f '/usr/lib/postgresql/14/bin'/script/myscript1 '/usr/lib/postgresql/14/bin'/script/myscript2
------------ Check (nothing should be found here) ------------
ls: impossible d'accéder à '/usr/share/postgresql/14/extension/myext.control': Aucun fichier ou dossier de ce nom
ls: impossible d'accéder à '/usr/share/postgresql/14/extension/myext': Aucun fichier ou dossier de ce nom
/usr/lib/postgresql/14/bin/myscript1  /usr/lib/postgresql/14/bin/myscript2
mydoc1	mydoc2


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Extension uninstall issue with PGXS
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox