Package: whohas
Version: 0.22-1
Severity: wishlist

Hello,

Please, could you consider the management of Mandriva packages in your
tool ?

A patch fixing this bug is attached to this bug report.

Regards,
Sylvestre

diff -ur whohas-0.22.orig/program/whohas whohas-0.22/program/whohas
--- whohas-0.22.orig/program/whohas	2009-01-04 19:54:05.000000000 +0100
+++ whohas-0.22/program/whohas	2009-01-29 11:32:35.000000000 +0100
@@ -49,6 +49,7 @@
 my $fink_bool		= 1;
 my $freebsd_bool	= 1;
 my $macports_bool	= 1;
+my $mandriva_bool	= 1;
 my $netbsd_bool		= 1;
 my $openbsd_bool	= 1;
 my $opensuse_bool	= 1;
@@ -69,6 +70,7 @@
 			$fink_bool		= 0;
 			$freebsd_bool		= 0;
 			$macports_bool		= 0;
+			$mandriva_bool		= 0;
 			$netbsd_bool		= 0;
 			$openbsd_bool		= 0;
 			$opensuse_bool		= 0;
@@ -84,6 +86,7 @@
 				} elsif (	$parts[$a] =~ /fink/i) {	$fink_bool		= 1;
 				} elsif (	$parts[$a] =~ /freebsd/i) {	$freebsd_bool		= 1;
 				} elsif (	$parts[$a] =~ /macports/i) {	$macports_bool		= 1;
+				} elsif (	$parts[$a] =~ /mandriva/i) {	$mandriva_bool		= 1;
 				} elsif (	$parts[$a] =~ /netbsd/i) {	$netbsd_bool		= 1;
 				} elsif (	$parts[$a] =~ /openbsd/i) {	$openbsd_bool		= 1;
 				} elsif (	$parts[$a] =~ /opensuse/i) {	$opensuse_bool		= 1;
@@ -121,6 +124,9 @@
 		if ($macports_bool == 1) {
 			$thrs[$here++] = threads->new(\&macports,	$ARGV[0]);
 		}
+		if ($mandriva_bool == 1) {
+			$thrs[$here++] = threads->new(\&mandriva,	$ARGV[0]);
+		}
 		if ($netbsd_bool == 1) {
 #			$thrs[$here++] = threads->new(\&netbsd,		$ARGV[0]); #this worked, but was slow
 			$thrs[$here++] = threads->new(\&netbsd_pkgsrc,	$ARGV[0]);
@@ -174,6 +180,9 @@
 	if ($macports_bool == 1) {
 		&macports(	$ARGV[1]);
 	}
+	if ($mandriva_bool == 1) {
+		&mandriva(	$ARGV[1]);
+	}
 	if ($netbsd_bool == 1) {
 #		&netbsd(	$ARGV[1]);
 		&netbsd_pkgsrc(	$ARGV[1]);
@@ -375,6 +384,34 @@
 }
 
 
+sub mandriva {
+	my $baseurl = "http://sophie.zarb.org";;
+	my @names;
+	my @versions;
+	my @dates;
+	my @sizes;
+	my @repos;
+	my @urls;
+	my @lines = split /\n/, &fetchdoc($baseurl."/rpmfind?distrib=Mandriva&st=rpmname&search=".$_[0]);
+	for (my $i = 70; $i < @lines; $i++) {
+		if ($lines[$i] =~ /<p><a href\=\"http:\/\/sophie.zarb.org\/viewrpm\//) {
+			my @parts = $lines[$i] =~ /\"([^\"]+)\">(\w+)-([0-9-.]+)(\D+)?(?:([0-9\.]+)\.)?(\w+)?\.rpm<\/a>/;
+
+				push @urls,     $parts[0];
+				push @names,    $parts[1];
+				push @versions, $parts[2];
+				push @repos,    $parts[3];
+				push @sizes, "";
+				push @dates, "";
+		}
+	}
+	for (my $i = 0; $i < @repos; $i++) {
+		&pretty_print($cols,@columns,"Mandriva",$names[$i],$versions[$i],$sizes[$i],$dates[$i],$repos[$i],$urls[$i]);
+	}
+	return ();
+}
+
+
 sub fink {
 	my $baseurl = "http://fink.sourceforge.net/pdb/";;
 	my @names;
diff -ur whohas-0.22.orig/usr/share/man/de/man1/whohas.1 whohas-0.22/usr/share/man/de/man1/whohas.1
--- whohas-0.22.orig/usr/share/man/de/man1/whohas.1	2009-01-05 00:00:15.000000000 +0100
+++ whohas-0.22/usr/share/man/de/man1/whohas.1	2009-01-29 12:09:44.000000000 +0100
@@ -7,7 +7,7 @@
 whohas [\fI\-\-no\-threads\fP] [\fI\-d Dist1[,Dist2[,Dist3 etc.]]\fP] \fIpkgname\fP
 .SH "BESCHREIBUNG"
 .LP 
-whohas ist ein Kommandozeilenprogramm, das verfügbare Pakete von Arch, Debian, Fedora, Gentoo, openSUSE, Slackware (and linuxpackages.net), Source Mage, Ubuntu, FreeBSD, NetBSD, OpenBSD, Fink und MacPorts findet, die einem Suchbegriff entsprechen.
+whohas ist ein Kommandozeilenprogramm, das verfügbare Pakete von Arch, Debian, Fedora, Gentoo, openSUSE, Slackware (and linuxpackages.net), Source Mage, Ubuntu, FreeBSD, NetBSD, OpenBSD, Fink, Mandriva und MacPorts findet, die einem Suchbegriff entsprechen.
 .SH "OPTIONEN"
 .LP 
 .TP 
@@ -15,7 +15,7 @@
 Keine Threads bei der Ausführung, Repositories werden seriell nacheinander befragt und jeweils die Antwort abgewartet (sehr viel langsamer)
 .TP 
 \fB\-d Dist1[,Dist2[,Dist3 etc.]]\fR
-Durchsucht nur aufgelistete Distributionen. Gültige Angaben für Dist1 etc. sind "archlinux", "debian", "fedora", "fink", "freebsd", "gentoo", "macports", "netbsd", "openbsd", "opensuse", "slackware", "sourcemage", und "ubuntu".
+Durchsucht nur aufgelistete Distributionen. Gültige Angaben für Dist1 etc. sind "archlinux", "debian", "fedora", "fink", "freebsd", "gentoo", "macports", "mandriva", "netbsd", "openbsd", "opensuse", "slackware", "sourcemage", und "ubuntu".
 .TP 
 \fBpkgname\fR
 Suchbegriff
diff -ur whohas-0.22.orig/usr/share/man/man1/whohas.1 whohas-0.22/usr/share/man/man1/whohas.1
--- whohas-0.22.orig/usr/share/man/man1/whohas.1	2009-01-04 23:59:23.000000000 +0100
+++ whohas-0.22/usr/share/man/man1/whohas.1	2009-01-29 12:09:28.000000000 +0100
@@ -7,7 +7,7 @@
 whohas [\fI\-\-no\-threads\fP] [\fI\-d Dist1[,Dist2[,Dist3 etc.]]\fP] \fIpkgname\fP
 .SH "DESCRIPTION"
 .LP 
-whohas is a command line tool to query package lists from the Arch, Debian, Fedora, Gentoo, openSUSE, Slackware (and linuxpackages.net), Source Mage, Ubuntu, FreeBSD, NetBSD, OpenBSD, Fink and MacPorts distributions.
+whohas is a command line tool to query package lists from the Arch, Debian, Fedora, Gentoo, openSUSE, Slackware (and linuxpackages.net), Source Mage, Ubuntu, FreeBSD, NetBSD, OpenBSD, Fink, Mandriva and MacPorts distributions.
 .SH "OPTIONS"
 .LP 
 .TP 
@@ -15,7 +15,7 @@
 Don't use multiple threads to query package lists (will be much slower)
 .TP 
 \fB\-d Dist1[,Dist2[,Dist3 etc.]]\fR
-Queries only for packages for the listed distributions. Recognised values for Dist1, Dist2, etc. are "archlinux", "debian", "fedora", "fink", "freebsd", "gentoo", "macports", "netbsd", "openbsd", "opensuse", "slackware", "sourcemage", and "ubuntu".
+Queries only for packages for the listed distributions. Recognised values for Dist1, Dist2, etc. are "archlinux", "debian", "fedora", "fink", "freebsd", "gentoo", "macports", "mandriva", "netbsd", "openbsd", "opensuse", "slackware", "sourcemage", and "ubuntu".
 .TP 
 \fBpkgname\fR
 Package name to query for

Reply via email to