[pacman-dev] Minor patches to improve portability
I'm about to send 4 minor patches that should improve portability. They mostly address using proper paths for binaries, databases and configs. I don't necessarily know what I'm doing especially inside Makefiles. So, I apologise If I did anything stupid in there.
"/etc" was hardcoded in some scripts and manpages. Change this to
respect sysconfdir
Signed-off-by: Nezmer
On Mon, Oct 11, 2010 at 2:16 PM, Nezmer
"/etc" was hardcoded in some scripts and manpages. Change this to respect sysconfdir
Signed-off-by: Nezmer
--- contrib/Makefile.am | 10 ++++++++++ contrib/bacman | 12 ++++++------ contrib/pacscripts | 2 +- contrib/pactree | 6 +++--- contrib/wget-xdelta.sh | 4 ++-- contrib/zsh_completion | 6 +++--- doc/Makefile.am | 8 ++++++++ doc/makepkg.8.txt | 2 +- doc/pacman.conf.5.txt | 4 ++-- scripts/rankmirrors.sh.in | 2 +- 10 files changed, 37 insertions(+), 19 deletions(-) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index c6243b1..cb2ffc7 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -12,4 +12,14 @@ EXTRA_DIST = \ zsh_completion \ README
+edit = sed -e 's|@sysconfdir[@]|$(sysconfdir)|g' + +# Use sysconfdir +$(EXTRA_DIST): Makefile + cp -a $@ $@.tmp # To reserve permissions in tmp files + $(edit) $@ >$@.tmp || true + mv $@.tmp $@ + +all-am: $(EXTRA_DIST) +
Unfortunately, none of this works quite as expected unless I am missing something. 1) You will immediately mark files as dirty to git and 2) there is no more @sysconfdir@ once this runs once, making it not all that useful. The first step to these patches will be to do to contrib/ what was done to scripts/ way back when, and move them to extensions such as .sh.in and then have the final result in a bare .sh file. -Dan
On Mon, Oct 11, 2010 at 02:52:01PM -0500, Dan McGee wrote:
On Mon, Oct 11, 2010 at 2:16 PM, Nezmer
wrote: "/etc" was hardcoded in some scripts and manpages. Change this to respect sysconfdir
Signed-off-by: Nezmer
--- contrib/Makefile.am | 10 ++++++++++ contrib/bacman | 12 ++++++------ contrib/pacscripts | 2 +- contrib/pactree | 6 +++--- contrib/wget-xdelta.sh | 4 ++-- contrib/zsh_completion | 6 +++--- doc/Makefile.am | 8 ++++++++ doc/makepkg.8.txt | 2 +- doc/pacman.conf.5.txt | 4 ++-- scripts/rankmirrors.sh.in | 2 +- 10 files changed, 37 insertions(+), 19 deletions(-) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index c6243b1..cb2ffc7 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -12,4 +12,14 @@ EXTRA_DIST = \ zsh_completion \ README
+edit = sed -e 's|@sysconfdir[@]|$(sysconfdir)|g' + +# Use sysconfdir +$(EXTRA_DIST): Makefile + cp -a $@ $@.tmp # To reserve permissions in tmp files + $(edit) $@ >$@.tmp || true + mv $@.tmp $@ + +all-am: $(EXTRA_DIST) +
Unfortunately, none of this works quite as expected unless I am missing something. 1) You will immediately mark files as dirty to git and 2) there is no more @sysconfdir@ once this runs once, making it not all that useful.
The first step to these patches will be to do to contrib/ what was done to scripts/ way back when, and move them to extensions such as .sh.in and then have the final result in a bare .sh file.
-Dan
I know. I wasn't sure you would accept renaming all files.
On Mon, Oct 11, 2010 at 2:57 PM, Nezmer
On Mon, Oct 11, 2010 at 02:52:01PM -0500, Dan McGee wrote:
On Mon, Oct 11, 2010 at 2:16 PM, Nezmer
wrote: "/etc" was hardcoded in some scripts and manpages. Change this to respect sysconfdir
Signed-off-by: Nezmer
--- contrib/Makefile.am | 10 ++++++++++ contrib/bacman | 12 ++++++------ contrib/pacscripts | 2 +- contrib/pactree | 6 +++--- contrib/wget-xdelta.sh | 4 ++-- contrib/zsh_completion | 6 +++--- doc/Makefile.am | 8 ++++++++ doc/makepkg.8.txt | 2 +- doc/pacman.conf.5.txt | 4 ++-- scripts/rankmirrors.sh.in | 2 +- 10 files changed, 37 insertions(+), 19 deletions(-) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index c6243b1..cb2ffc7 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -12,4 +12,14 @@ EXTRA_DIST = \ zsh_completion \ README
+edit = sed -e 's|@sysconfdir[@]|$(sysconfdir)|g' + +# Use sysconfdir +$(EXTRA_DIST): Makefile + cp -a $@ $@.tmp # To reserve permissions in tmp files + $(edit) $@ >$@.tmp || true + mv $@.tmp $@ + +all-am: $(EXTRA_DIST) +
Unfortunately, none of this works quite as expected unless I am missing something. 1) You will immediately mark files as dirty to git and 2) there is no more @sysconfdir@ once this runs once, making it not all that useful.
The first step to these patches will be to do to contrib/ what was done to scripts/ way back when, and move them to extensions such as .sh.in and then have the final result in a bare .sh file.
-Dan
I know.
I wasn't sure you would accept renaming all files.
It's the only way I will take it. :) The patch can be made a lot more compact if you use the '-M -B -C' set of options to diff/log/format-patch. -Dan
"/var" was hardcoded in some scripts and manpages. Change this to
respect localstatedir
Signed-off-by: Nezmer
'/bin/bash' is hardcoded in shebangs. bash is not a system shell in
all platforms and its path is not necessarily '/bin/bash'.
I used 'which bash' to detect the real path of bash.
Signed-off-by: Nezmer
'mknod <file> p' is apparently GNU-only. Looking at coreutils' source
code, It just calls mkfifo.
This one line patch should fix makepkg logging in non-GNU systems.
Signed-off-by: Nezmer
On Mon, Oct 11, 2010 at 2:16 PM, Nezmer
'mknod <file> p' is apparently GNU-only. Looking at coreutils' source code, It just calls mkfifo.
This one line patch should fix makepkg logging in non-GNU systems.
Signed-off-by: Nezmer
--- Looks good, thanks.
scripts/makepkg.sh.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index baabf26..afedc31 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -767,7 +767,7 @@ run_function() {
# ensure overridden package variables survive tee with split packages logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX") - mknod "$logpipe" p + mkfifo "$logpipe" exec 3>&1 tee "$BUILDLOG" < "$logpipe" & exec 1>"$logpipe" 2>"$logpipe" -- 1.7.3.1
participants (2)
-
Dan McGee
-
Nezmer