Experimental package creation tool for MinGW.org
Revision | 3db4e23bf4020caa9ff6bfb00f702b05195e0a97 (tree) |
---|---|
Time | 2022-03-13 05:04:37 |
Author | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Optimize program configuration procedure.
* src/modules/config.sh (/etc/mingw-pkg/*.sh): New configuration
script source; process matching scripts before, but together with...
($HOME/.mingw-pkgrc, .mingw-pkg/*.sh): ...these, as previously, but
now incorporating all within the scope of a single "for" loop.
@@ -8,7 +8,7 @@ | ||
8 | 8 | # $Id$ |
9 | 9 | # |
10 | 10 | # Written by Keith Marshall <keith@users.osdn.me> |
11 | -# Copyright (C) 2011, 2013, 2017, 2018, 2020, MinGW.OSDN Project | |
11 | +# Copyright (C) 2011, 2013, 2017, 2018, 2020, 2022, MinGW.OSDN Project | |
12 | 12 | # |
13 | 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
14 | 14 | # of this software and associated documentation files (the "Software"), to deal |
@@ -35,17 +35,14 @@ | ||
35 | 35 | local name |
36 | 36 | for name in dmh actions options; do require module $name; done |
37 | 37 | |
38 | -# Accept user specified customisation. | |
39 | -# | |
40 | - test -f "$HOME/.${cmd}rc" && . "$HOME/.${cmd}rc" || true | |
41 | - | |
42 | -# Reload any locally saved configuration overrides; if the configuration | |
43 | -# directory exists, take care that a failed glob match doesn't lure us into | |
44 | -# an attempt to parse a non-existent script named "*.sh". | |
45 | -# | |
46 | - test -d .$cmd && { | |
47 | - for name in .$cmd/*.sh; do test -f "$name" && . "$name"; done | |
48 | - } || true | |
38 | +# Load system wide configuration options, (if any), apply any user-specified | |
39 | +# custom configuration, and reload any locally saved configuration overrides; | |
40 | +# for each possible configuration source nomination, take care that a failed | |
41 | +# glob match doesn't lure us into an attempt to parse a non-existent script | |
42 | +# named "*.sh". | |
43 | +# | |
44 | + for name in /etc/$cmd/*.sh "$HOME/.${cmd}rc" .$cmd/*.sh | |
45 | + do test -f "$name" && . "$name"; done || true | |
49 | 46 | # |
50 | 47 | # ----------------------------------------------------------------------------- |
51 | 48 | # $RCSfile$: end of file |