diff mbox series

[2/2] libtracevent: Remove tempfile libtraceevent.pc

Message ID 20201123184940.031517790@goodmis.org (mailing list archive)
State Superseded
Headers show
Series libtraceevent: Some Makefile updates | expand

Commit Message

Steven Rostedt Nov. 23, 2020, 6:48 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

"make install" copies libtraceevent.pc.template to libtraceevent.pc and then
modifies it for the installation. This command is usually executed as root,
and when finished, it leaves behind the libtraceevent.pc file owned by root.

Have the "make install" clean up and remove the temporary libtraceevent.pc
file, so that root owned files do not get left behind.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Tzvetomir Stoyanov (VMware) Nov. 24, 2020, 5:26 a.m. UTC | #1
On Mon, Nov 23, 2020 at 8:50 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> "make install" copies libtraceevent.pc.template to libtraceevent.pc and then
> modifies it for the installation. This command is usually executed as root,
> and when finished, it leaves behind the libtraceevent.pc file owned by root.
>
> Have the "make install" clean up and remove the temporary libtraceevent.pc
> file, so that root owned files do not get left behind.

Isn't it useful to have this file after the "make install" command, for debug
purposes - to see how exactly it was modified ? The file is removed by
"make clean".

>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index 2a6bfcce814f..775fbd2b3f0e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -218,6 +218,7 @@ define do_install_pkgconfig_file
>                 sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \
>                 sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \
>                 $(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644);     \
> +               ${RM} ${PKG_CONFIG_FILE}; \
>         else                                                                    \
>                 (echo Failed to locate pkg-config directory) 1>&2;              \
>         fi
> --
> 2.28.0
>
>
Steven Rostedt Nov. 24, 2020, 1:51 p.m. UTC | #2
On Tue, 24 Nov 2020 07:26:25 +0200
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:

> On Mon, Nov 23, 2020 at 8:50 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> >
> > "make install" copies libtraceevent.pc.template to libtraceevent.pc and then
> > modifies it for the installation. This command is usually executed as root,
> > and when finished, it leaves behind the libtraceevent.pc file owned by root.
> >
> > Have the "make install" clean up and remove the temporary libtraceevent.pc
> > file, so that root owned files do not get left behind.  
> 
> Isn't it useful to have this file after the "make install" command, for debug
> purposes - to see how exactly it was modified ? The file is removed by
> "make clean".

Then it needs to be created via normal make. "make install" should leave no
"artifacts" lying around. It's usually done as root, and anything left may
be stuck there for the normal user (not be able to delete it).

The files removed by "make clean" are only those created by normal makes.

I can change the patch to have the creation of the package config created
by "make" and not by "make install", and then have it removed by "make
clean".

-- Steve
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 2a6bfcce814f..775fbd2b3f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -218,6 +218,7 @@  define do_install_pkgconfig_file
 		sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \
 		sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \
 		$(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); 	\
+		${RM} ${PKG_CONFIG_FILE}; \
 	else 									\
 		(echo Failed to locate pkg-config directory) 1>&2;		\
 	fi