diff options
author | Pavlina Moravcova Varekova <pmoravco@redhat.com> | 2017-04-19 18:16:18 +0200 |
---|---|---|
committer | Pavlina Moravcova Varekova <pmoravco@redhat.com> | 2017-04-19 18:16:18 +0200 |
commit | b9178e43c355e1b60280937737d96a50f7597c1e (patch) | |
tree | beca606fee93cba1ae92e60d2a9b324885211a49 /tests/data/SPECS/updpolicy.spec | |
parent | a239ddefa90575ce80ed4436beb4005a97e32644 (diff) | |
download | rpm-b9178e43c355e1b60280937737d96a50f7597c1e.tar.gz |
Add %mutable and %noupdate update policies (#152)pavlinas_p122
%mutable
- is defined for files and links. It means update until modified.
In more details:
- if a file/link is the same as in new package then touch it,
- if a file/link is the same as in old package then upgrade it as "normal" file/link,
- else do nothing.
%noupdate
- is defined for all file types used internally by rpm. It is for cases, where packager wants just the initial content, never to be touched by rpm again.
In more details:
- if the file does not exist, then create it,
- if the file exists, then do nothing.
Diffstat (limited to 'tests/data/SPECS/updpolicy.spec')
-rw-r--r-- | tests/data/SPECS/updpolicy.spec | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/data/SPECS/updpolicy.spec b/tests/data/SPECS/updpolicy.spec new file mode 100644 index 000000000..4310e8c23 --- /dev/null +++ b/tests/data/SPECS/updpolicy.spec @@ -0,0 +1,38 @@ +# avoid depending on rpm configuration +%define _sysconfdir /etc + +%{!?filetype: %global filetype file} + +Name: update-policy-test%{?sub:-%{sub}} +Version: %{ver} +Release: 1 +Summary: Testing update policy + +Group: Testing +License: GPL +BuildArch: noarch + +%description +%{summary} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} +case %{filetype} in +file) + echo "%{filedata}" > $RPM_BUILD_ROOT/%{_sysconfdir}/policy.conf + ;; +link) + ln -s "%{filedata}" $RPM_BUILD_ROOT/%{_sysconfdir}/policy.conf + ;; +dir) + mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/policy.conf + ;; +esac + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%{?fileattr} %{_sysconfdir}/policy.conf |