aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs6
-rw-r--r--URPM/Resolve.pm18
-rw-r--r--perl-URPM.spec39
3 files changed, 38 insertions, 25 deletions
diff --git a/URPM.xs b/URPM.xs
index 60f5549..464aa4d 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -656,12 +656,12 @@ return_list_uint_16(Header header, int_32 tag_name) {
void
return_list_tag_modifier(Header header, int_32 tag_name) {
dSP;
+ int i;
int_32 *list;
int_16 *list16;
int_32 count, type;
headerGetEntry(header, tag_name, &type, (void **) &list, &count);
- int i;
for (i=0; i<count; i++) {
char *buff[15];
char *s= buff;
@@ -671,14 +671,16 @@ return_list_tag_modifier(Header header, int_32 tag_name) {
if (list[i] & RPMFILE_DOC) *s++ = 'd';
if (list[i] & RPMFILE_GHOST) *s++ = 'g';
if (list[i] & RPMFILE_LICENSE) *s++ = 'l';
- if (list[i] & RPMFILE_ICON) *s++ = 'i';
if (list[i] & RPMFILE_MISSINGOK) *s++ = 'm';
if (list[i] & RPMFILE_NOREPLACE) *s++ = 'n';
if (list[i] & RPMFILE_SPECFILE) *s++ = 'S';
if (list[i] & RPMFILE_README) *s++ = 'R';
if (list[i] & RPMFILE_EXCLUDE) *s++ = 'e';
+#ifdef RPM_42
+ if (list[i] & RPMFILE_ICON) *s++ = 'i';
if (list[i] & RPMFILE_UNPATCHED) *s++ = 'u';
if (list[i] & RPMFILE_PUBKEY) *s++ = 'p';
+#endif
break;
default:
return;
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 30849cd..853f0df 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -413,7 +413,7 @@ sub resolve_requested {
#- take the best choice possible.
my @chosen = $urpm->find_chosen_packages($db, $state, $dep->{required});
-
+
#- if no choice are given, this means that nothing possible can be selected
#- according to $dep, we need to retry the selection allowing all packages that
#- conflicts or anything similar to see which strategy can be tried.
@@ -474,7 +474,7 @@ sub resolve_requested {
exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]},
$pkg->flag_disable_obsolete ? (install => 1) : @{[]},
};
-
+
$pkg->set_flag_required;
#- check if package is not already installed before trying to use it, compute
@@ -502,18 +502,18 @@ sub resolve_requested {
#- examine rpm db too (but only according to packages name as a fix in rpm itself)
$db->traverse_tag('name', [ $n ], sub {
my ($p) = @_;
-
+
#- without an operator, anything (with the same name) is matched.
#- with an operator, check with package EVR with the obsoletes EVR.
my $satisfied = !$o || eval($p->compare($v) . $o . 0);
$p->name eq $pkg->name || $satisfied or return;
-
+
#- do not propagate now the broken dependencies as they are
#- computed later.
my $rv = $state->{rejected}{$p->fullname} ||= {};
$rv->{closure}{$pkg->fullname} = undef;
$rv->{size} = $p->size;
-
+
if ($p->name eq $pkg->name) {
#- all packages older than the current one are obsoleted,
#- the others are simply removed (the result is the same).
@@ -546,7 +546,7 @@ sub resolve_requested {
});
}
}
-
+
push @diff_provides, map { +{ name => $_, pkg => $pkg } } keys %diff_provides;
}
@@ -555,12 +555,12 @@ sub resolve_requested {
exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]},
exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]},
} } $urpm->unsatisfied_requires($db, $state, $pkg);
-
+
#- keep in mind what is requiring each item (for unselect to work).
foreach ($pkg->requires_nosense) {
$state->{whatrequires}{$_}{$pkg->id} = undef;
}
-
+
#- examine conflicts, an existing package conflicting with this selection should
#- be upgraded to a new version which will be safe, else it should be removed.
foreach ($pkg->conflicts) {
@@ -638,7 +638,7 @@ sub resolve_requested {
}
}
});
-
+
#- keep existing package and therefore cancel current one.
if (@keep) {
unshift @properties, $urpm->backtrack_selected($db, $state, +{ keep => \@keep, psel => $pkg }, %options);
diff --git a/perl-URPM.spec b/perl-URPM.spec
index e90ff61..9bb899c 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,22 +1,29 @@
%define name perl-URPM
%define real_name URPM
%define version 0.94
-%define release 9mdk
+%define release 10mdk
-%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
+%define group %(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "Development/Perl" : "Applications/CPAN"')
+%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)
+
+%{expand:%%define compat_makeinstall_std %(perl -e 'printf "%%s\n", "%{?makeinstall_std:1}" ? "%%makeinstall_std" : "%%{__make} install PREFIX=%%{buildroot}%%{_prefix}"')}
+%{expand:%%define compat_perl_vendorarch %(perl -MConfig -e 'printf "%%s\n", "%{?perl_vendorarch:1}" ? "%%{perl_vendorarch}" : "$Config{installvendorarch}"')}
+%{expand:%%define buildreq_perl_devel %%(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "perl-devel" : "perl"')}
+%{expand:%%define distribution %%(perl -e 'printf "%%s\\n", ("%_vendor" =~ /mandrake/i ? "Mandrake Linux" : "Red Hat Linux")')}
+%{expand:%%define real_release %%(perl -e 'printf "%%s\\n", ("%_vendor" !~ /mandrake/i && ("%release" =~ /(.*?)mdk/)[0] || "%release")')}
Packager: François Pons <fpons@mandrakesoft.com>
Summary: URPM module for perl
Name: %{name}
Version: %{version}
-Release: %{release}
+Release: %{real_release}
License: GPL or Artistic
-Group: Development/Perl
-Distribution: Mandrake Linux
+Group: %{group}
+Distribution: %{distribution}
Source: %{real_name}-%{version}.tar.bz2
URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/perl-URPM
Prefix: %{_prefix}
-BuildRequires: perl-devel rpm-devel >= 4.0.3 bzip2-devel gcc
+BuildRequires: %{buildreq_perl_devel} rpm-devel >= 4.0.3 bzip2-devel
Requires: rpm >= %{rpm_version}, bzip2 >= 1.0
Provides: perl(URPM::Build) = %{version}-%{release}
Provides: perl(URPM::Resolve) = %{version}-%{release}
@@ -32,26 +39,30 @@ hdlist files and manage them in memory.
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
-make OPTIMIZE="$RPM_OPT_FLAGS"
-#make test
+%{__make} OPTIMIZE="$RPM_OPT_FLAGS"
+%{__make} test
%install
-rm -rf $RPM_BUILD_ROOT
-%makeinstall_std
+%{__rm} -rf %{buildroot}
+%{compat_makeinstall_std}
%clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README
#%{_mandir}/man3pm/*
-%{perl_vendorarch}/URPM.pm
-%{perl_vendorarch}/URPM
-%{perl_vendorarch}/auto/URPM
+%{compat_perl_vendorarch}/URPM.pm
+%{compat_perl_vendorarch}/URPM
+%dir %{compat_perl_vendorarch}/auto/URPM
+%{compat_perl_vendorarch}/auto/URPM/URPM.so
%changelog
+* Tue Dec 9 2003 François Pons <fpons@mandrakesoft.com> 0.94-10mdk
+- added compability with RH 7.3.
+
* Mon Nov 17 2003 François Pons <fpons@mandrakesoft.com> 0.94-9mdk
- fixed bug preventing adding local media.