[Fedora-security-commits] fedora-security/tools/lib/Libexig Bodhi.pm, 1.3, 1.4

fedora-security-commits at redhat.com fedora-security-commits at redhat.com
Tue Aug 26 06:38:22 UTC 2008


Author: thoger

Update of /cvs/fedora/fedora-security/tools/lib/Libexig
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11622/tools/lib/Libexig

Modified Files:
	Bodhi.pm 
Log Message:
fix check-updates to work with new bodhi JSON output, no more text blob parsing



Index: Bodhi.pm
===================================================================
RCS file: /cvs/fedora/fedora-security/tools/lib/Libexig/Bodhi.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Bodhi.pm	14 Jan 2008 16:33:12 -0000	1.3
+++ Bodhi.pm	26 Aug 2008 06:37:51 -0000	1.4
@@ -5,9 +5,12 @@
 package Libexig::Bodhi;
 
 use JSON;
+use Data::Dumper;
 
 # Convert the text blob from bodhi to a hash,
 # dissect some multipart values
+#
+# XXX No longer needed with bodhi 0.5.x XXX
 sub update_to_hashref
 {
 	my @lines = split /\n/, shift;
@@ -89,19 +92,13 @@
 sub get_updates
 {
 	my $pkg = shift or die 'No package name supplied';
-	my @retval;
-
 	
 	# Get updates
 	$json = `wget --post-data 'package=$pkg&tg_paginate_limit=0' -qO - \\
 			'https://admin.fedoraproject.org/updates/list?tg_format=json'`;
-	$obj = jsonToObj ($json);
-
-	foreach my $update (@{$obj->{'updates'}}) {
-		push @retval, update_to_hashref ($update);
-	}
+	$obj = jsonToObj ($json, {unmapping => 1});
 
-	return @retval;
+	return @{$obj->{'updates'}};
 }
 
 1;




More information about the Fedora-security-commits mailing list