summaryrefslogtreecommitdiff
path: root/tests/data/SPECS/replacetest.spec
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-24 12:51:26 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-08-24 12:51:26 +0300
commit0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f (patch)
tree5bcaf6527bb691857001988bc95aab8f39549e76 /tests/data/SPECS/replacetest.spec
parentfb0d4f643a21b7d1fcb23ee705e309c394927055 (diff)
downloadlibrpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.tar.gz
librpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.tar.bz2
librpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.zip
Add pile of new test-cases for file type changes in upgrades
- Of particular interest is directory changing to something else (including the infamous symlink case), which we miserably fail currently. Until we can somehow manage them someday, we should abort early (by conflicts) instead of barfing up garbage in middle of transaction.
Diffstat (limited to 'tests/data/SPECS/replacetest.spec')
-rw-r--r--tests/data/SPECS/replacetest.spec47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/data/SPECS/replacetest.spec b/tests/data/SPECS/replacetest.spec
new file mode 100644
index 000000000..e8a64e803
--- /dev/null
+++ b/tests/data/SPECS/replacetest.spec
@@ -0,0 +1,47 @@
+%{!?filetype: %global filetype file}
+%{?fixit: %global havepretrans 1}
+
+Name: replacetest%{?sub:-%{sub}}
+Version: %{ver}
+Release: 1
+Summary: Testing file replacement behavior
+
+Group: Testing
+License: GPL
+BuildArch: noarch
+
+%description
+%{summary}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/opt
+case %{filetype} in
+file)
+ echo "%{filedata}" > $RPM_BUILD_ROOT/opt/foo
+ ;;
+link)
+ ln -s "%{filedata}" $RPM_BUILD_ROOT/opt/foo
+ ;;
+dir)
+ mkdir -p $RPM_BUILD_ROOT/opt/foo
+ ;;
+datadir)
+ mkdir -p $RPM_BUILD_ROOT/opt/foo
+ echo WOOT > $RPM_BUILD_ROOT/opt/foo/%{filedata}
+ ;;
+esac
+mkdir -p $RPM_BUILD_ROOT/opt/zoo
+echo FOO > $RPM_BUILD_ROOT/opt/goo
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if 0%{?havepretrans}
+%pretrans -p <lua>
+%{fixit}
+%endif
+
+%files
+%defattr(-,root,root,-)
+/opt/*