[Yum-devel] [PATCH] Move /var/lib/yum/vars to /etc/yum/vars as it's not yum generated

Seth Vidal skvidal at fedoraproject.org
Tue Apr 13 15:54:10 UTC 2010



On Tue, 13 Apr 2010, James Antill wrote:

> ---
> Makefile        |    2 +-
> docs/yum.conf.5 |    6 ++----
> etc/Makefile    |    1 +
> yum.spec        |    4 ++--
> yum/config.py   |    6 ++----
> 5 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f20795f..8065899 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -34,7 +34,7 @@ install:
> 	install -m 755 bin/yum-updatesd.py $(DESTDIR)/usr/sbin/yum-updatesd
>
> 	mkdir -p $(DESTDIR)/var/cache/yum
> -	mkdir -p $(DESTDIR)/var/lib/yum/vars
> +	mkdir -p $(DESTDIR)/var/lib/yum
>
> 	for d in $(SUBDIRS); do make PYTHON=$(PYTHON) DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done
>
> diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
> index f4ce88d..dfc09b7 100644
> --- a/docs/yum.conf.5
> +++ b/docs/yum.conf.5
> @@ -770,10 +770,8 @@ the same name. If the shell environment variable does not exist then the
> configuration file variable will not be replaced.
>
> .LP
> -As of 3.2.28, any file in <installroot>/<persistdir>/vars is turned into
> -a variable named after the filename (or overrides any of the above variables).
> -The obvious exception is that you cannot use these variables in the definition
> -of persistdir itself.
> +As of 3.2.28, any file in /etc/yum/vars is turned into a variable named after
> +the filename (or overrides any of the above variables).
>
> Note that no warnings/errors are given if the files are unreadable, so creating
> files that only root can read may be confusing for users.
> diff --git a/etc/Makefile b/etc/Makefile
> index 68dd3c2..91b1791 100644
> --- a/etc/Makefile
> +++ b/etc/Makefile
> @@ -9,6 +9,7 @@ clean:
> install:
> 	mkdir -p $(DESTDIR)/etc/yum/
> 	mkdir -p $(DESTDIR)/etc/yum/repos.d
> +	mkdir -p $(DESTDIR)/etc/yum/vars
>
> 	install -m 644 yum.conf $(YUMETC)/yum.conf
>
> diff --git a/yum.spec b/yum.spec
> index 48e5fea..5ece693 100644
> --- a/yum.spec
> +++ b/yum.spec
> @@ -80,8 +80,9 @@ exit 0
> %doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS
> %config(noreplace) %{_sysconfdir}/yum/yum.conf
> %config(noreplace) %{_sysconfdir}/yum/version-groups.conf
> -%dir %{_sysconfdir}/%{name}
> +%dir %{_sysconfdir}/yum
> %dir %{_sysconfdir}/yum/repos.d
> +%dir %{_sysconfdir}/yum/vars
> %config %{_sysconfdir}/logrotate.d/%{name}
> %{_sysconfdir}/bash_completion.d
> %{_datadir}/yum-cli/*
> @@ -91,7 +92,6 @@ exit 0
> /usr/lib/python?.?/site-packages/rpmUtils
> %dir /var/cache/yum
> %dir /var/lib/yum
> -%dir /var/lib/yum/vars
> %ghost /var/lib/yum/uuid
> %ghost /var/lib/yum/history
> %ghost /var/lib/yum/plugins
> diff --git a/yum/config.py b/yum/config.py
> index ea8bcbf..3e91735 100644
> --- a/yum/config.py
> +++ b/yum/config.py
> @@ -873,11 +873,9 @@ def readMainConfig(startupconf):
>         ir_path = varReplace(ir_path, yumvars)
>         setattr(yumconf, option, ir_path)
>
> -    _apply_installroot(yumconf, 'persistdir')
> -
>     # Read the FS yumvars
>     try:
> -        dir_fsvars = yumconf.persistdir + "/vars/"
> +        dir_fsvars = yumconf.installroot + "/etc/yum/vars/"
>         fsvars = os.listdir(dir_fsvars)
>     except OSError:
>         fsvars = []
> @@ -893,7 +891,7 @@ def readMainConfig(startupconf):
>         yumvars[fsvar] = val
>
>     # These can use the above FS yumvars
> -    for option in ('cachedir', 'logfile'):
> +    for option in ('cachedir', 'logfile', 'persistdir'):
>         _apply_installroot(yumconf, option)
>
>     # Add in some extra attributes which aren't actually configuration values
> -- 
> 1.6.6.1

ACK.

-sv



More information about the Yum-devel mailing list