summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-31 10:41:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-31 10:41:10 +0000
commit2bc5884ec3473c039254286d5d33fca59f473491 (patch)
tree0d0d99c76eff910770670173c29aa6f1cb48cfae /t
parentddd855e54e8298ef21d346a9636dd88937dcde85 (diff)
downloadurpmi-2bc5884ec3473c039254286d5d33fca59f473491.tar
urpmi-2bc5884ec3473c039254286d5d33fca59f473491.tar.gz
urpmi-2bc5884ec3473c039254286d5d33fca59f473491.tar.bz2
urpmi-2bc5884ec3473c039254286d5d33fca59f473491.tar.xz
urpmi-2bc5884ec3473c039254286d5d33fca59f473491.zip
do not use builrequires dash-static, use gcc to build a special binary, so
that we are less mandriva centered
Diffstat (limited to 't')
-rw-r--r--t/data/SPECS/ordering-scriptlets/a_1.spec40
-rw-r--r--t/data/SPECS/ordering-scriptlets/a_2.spec (renamed from t/data/SPECS/ordering-scriptlets/ash_2.spec)4
-rw-r--r--t/data/SPECS/ordering-scriptlets/ash_1.spec24
-rw-r--r--t/data/SPECS/ordering-scriptlets/requires_post_1.spec4
-rw-r--r--t/data/SPECS/ordering-scriptlets/requires_postun_1.spec4
-rw-r--r--t/data/SPECS/ordering-scriptlets/requires_pre_1.spec4
-rw-r--r--t/data/SPECS/ordering-scriptlets/requires_preun_1.spec4
-rw-r--r--t/superuser--ordering-scriptlets.t33
8 files changed, 67 insertions, 50 deletions
diff --git a/t/data/SPECS/ordering-scriptlets/a_1.spec b/t/data/SPECS/ordering-scriptlets/a_1.spec
new file mode 100644
index 00000000..f1ec3ea7
--- /dev/null
+++ b/t/data/SPECS/ordering-scriptlets/a_1.spec
@@ -0,0 +1,40 @@
+Summary: x
+Name: a
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Provides: /bin/a
+BuildRequires: gcc
+BuildRoot: %{_tmppath}/%{name}
+
+%prep
+%setup -c -T
+cat <<EOF > a.c
+#include <stdio.h>
+int main(int argc, char **argv) {
+ FILE *f = fopen(argv[1], "r");
+ int c;
+ while ((c = getc(f)) > 0) putchar(c);
+ putchar('\n');
+ return 0;
+}
+EOF
+
+%build
+gcc -Wall -static -o a a.c
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -D a $RPM_BUILD_ROOT/bin/a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%description
+x
+
+%files
+%defattr(-,root,root)
+/bin/*
diff --git a/t/data/SPECS/ordering-scriptlets/ash_2.spec b/t/data/SPECS/ordering-scriptlets/a_2.spec
index a6dbebad..0cd2afc8 100644
--- a/t/data/SPECS/ordering-scriptlets/ash_2.spec
+++ b/t/data/SPECS/ordering-scriptlets/a_2.spec
@@ -1,5 +1,5 @@
-Summary: ordering_ash
-Name: ordering_ash
+Summary: x
+Name: a
Version: 2
Release: 1
License: x
diff --git a/t/data/SPECS/ordering-scriptlets/ash_1.spec b/t/data/SPECS/ordering-scriptlets/ash_1.spec
deleted file mode 100644
index 7b6e1ab8..00000000
--- a/t/data/SPECS/ordering-scriptlets/ash_1.spec
+++ /dev/null
@@ -1,24 +0,0 @@
-Summary: ordering_ash
-Name: ordering_ash
-Version: 1
-Release: 1
-License: x
-Group: x
-Url: x
-Provides: /bin/ash
-BuildRequires: dash-static
-BuildRoot: %{_tmppath}/%{name}
-
-%install
-rm -rf $RPM_BUILD_ROOT
-install -D /bin/dash.static $RPM_BUILD_ROOT/bin/ash
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%description
-x
-
-%files
-%defattr(-,root,root)
-/bin/*
diff --git a/t/data/SPECS/ordering-scriptlets/requires_post_1.spec b/t/data/SPECS/ordering-scriptlets/requires_post_1.spec
index 3603f6a6..052d09fb 100644
--- a/t/data/SPECS/ordering-scriptlets/requires_post_1.spec
+++ b/t/data/SPECS/ordering-scriptlets/requires_post_1.spec
@@ -10,7 +10,7 @@ BuildRoot: %{_tmppath}/%{name}
%description
x
-%post -p /bin/ash
-echo "%post is running ok"
+%post -p /bin/a
+post is running ok
%files
diff --git a/t/data/SPECS/ordering-scriptlets/requires_postun_1.spec b/t/data/SPECS/ordering-scriptlets/requires_postun_1.spec
index 8a9dc0fb..f7fd871c 100644
--- a/t/data/SPECS/ordering-scriptlets/requires_postun_1.spec
+++ b/t/data/SPECS/ordering-scriptlets/requires_postun_1.spec
@@ -10,7 +10,7 @@ BuildRoot: %{_tmppath}/%{name}
%description
x
-%postun -p /bin/ash
-echo "%postun is running ok"
+%postun -p /bin/a
+postun is running ok
%files
diff --git a/t/data/SPECS/ordering-scriptlets/requires_pre_1.spec b/t/data/SPECS/ordering-scriptlets/requires_pre_1.spec
index cc5e9430..0783397e 100644
--- a/t/data/SPECS/ordering-scriptlets/requires_pre_1.spec
+++ b/t/data/SPECS/ordering-scriptlets/requires_pre_1.spec
@@ -10,7 +10,7 @@ BuildRoot: %{_tmppath}/%{name}
%description
x
-%pre -p /bin/ash
-echo "%pre is running ok"
+%pre -p /bin/a
+pre is running ok
%files
diff --git a/t/data/SPECS/ordering-scriptlets/requires_preun_1.spec b/t/data/SPECS/ordering-scriptlets/requires_preun_1.spec
index 9b0d6d90..9df5135c 100644
--- a/t/data/SPECS/ordering-scriptlets/requires_preun_1.spec
+++ b/t/data/SPECS/ordering-scriptlets/requires_preun_1.spec
@@ -10,7 +10,7 @@ BuildRoot: %{_tmppath}/%{name}
%description
x
-%preun -p /bin/ash
-echo "%preun is running ok"
+%preun -p /bin/a
+preun is running ok
%files
diff --git a/t/superuser--ordering-scriptlets.t b/t/superuser--ordering-scriptlets.t
index 53e3c7cc..ae9c81a7 100644
--- a/t/superuser--ordering-scriptlets.t
+++ b/t/superuser--ordering-scriptlets.t
@@ -1,5 +1,6 @@
#!/usr/bin/perl
+# /bin/a in package is a simple "cat"
use strict;
use lib '.', 't';
use helper;
@@ -9,8 +10,8 @@ my $medium_name = 'ordering-scriptlets';
need_root_and_prepare();
-my $ash_1 = "media/$medium_name/ordering_ash-1-*.rpm";
-my $ash_2 = "media/$medium_name/ordering_ash-2-*.rpm";
+my $a_1 = "media/$medium_name/a-1-*.rpm";
+my $a_2 = "media/$medium_name/a-2-*.rpm";
test_install_remove_rpm("requires_$_") foreach qw(pre post preun postun);
test_install_upgrade_rpm("requires_$_") foreach qw(preun postun);
@@ -24,29 +25,29 @@ test_install_upgrade_urpmi("requires_$_", '--split-level 1') foreach qw(preun po
sub test_install_remove_rpm {
my ($name) = @_;
- system_("rpm --root $::pwd/root -i $ash_1 media/$medium_name/$name-1-*.rpm");
- check_installed_and_remove('ordering_ash', $name);
+ system_("rpm --root $::pwd/root -i $a_1 media/$medium_name/$name-1-*.rpm");
+ check_installed_and_remove('a', $name);
- system_("rpm --root $::pwd/root -i media/$medium_name/$name-1-*.rpm $ash_1");
- check_installed_and_remove($name, 'ordering_ash');
+ system_("rpm --root $::pwd/root -i media/$medium_name/$name-1-*.rpm $a_1");
+ check_installed_and_remove($name, 'a');
}
sub test_install_upgrade_rpm {
my ($name) = @_;
- system_("rpm --root $::pwd/root -i $ash_1 media/$medium_name/$name-1-*.rpm");
- system_("rpm --root $::pwd/root -U media/$medium_name/$name-2-*.rpm $ash_2");
- check_installed_and_remove('ordering_ash', $name);
+ system_("rpm --root $::pwd/root -i $a_1 media/$medium_name/$name-1-*.rpm");
+ system_("rpm --root $::pwd/root -U media/$medium_name/$name-2-*.rpm $a_2");
+ check_installed_and_remove('a', $name);
- system_("rpm --root $::pwd/root -i media/$medium_name/$name-1-*.rpm $ash_1");
- system_("rpm --root $::pwd/root -U $ash_2 media/$medium_name/$name-2-*.rpm");
- check_installed_and_remove($name, 'ordering_ash');
+ system_("rpm --root $::pwd/root -i media/$medium_name/$name-1-*.rpm $a_1");
+ system_("rpm --root $::pwd/root -U $a_2 media/$medium_name/$name-2-*.rpm");
+ check_installed_and_remove($name, 'a');
}
sub test_install_remove_urpmi {
my ($name, $urpmi_option) = @_;
- my @names = ('ordering_ash', $name);
+ my @names = ('a', $name);
my @names_rev = reverse @names;
urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
@@ -62,16 +63,16 @@ sub test_install_remove_urpmi {
sub test_install_upgrade_urpmi {
my ($name, $urpmi_option) = @_;
- my @names = ('ordering_ash', $name);
+ my @names = ('a', $name);
my @names_rev = reverse @names;
urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
- system_("rpm --root $::pwd/root -i $ash_1 media/$medium_name/$name-1-*.rpm");
+ system_("rpm --root $::pwd/root -i $a_1 media/$medium_name/$name-1-*.rpm");
urpmi(join(' ', $urpmi_option, @names));
check_installed_and_urpme(@names);
- system_("rpm --root $::pwd/root -i $ash_1 media/$medium_name/$name-1-*.rpm");
+ system_("rpm --root $::pwd/root -i $a_1 media/$medium_name/$name-1-*.rpm");
urpmi(join(' ', $urpmi_option, @names_rev));
check_installed_and_urpme(@names_rev);