Commit Diff
Diff:
697bbcb93ba881a55a956e04db529f411a3cb357
bee62be736b0fe57d9c8b90ef650bf9aec8cd68f
Commit:
bee62be736b0fe57d9c8b90ef650bf9aec8cd68f
Tree:
b0c35986056b1cbe1a340b5b9b17be320e571f42
Author:
fredgnix <fredgnix@a8afeb8c-277c-4b4a-a4f6-ef4c85adc32b>
Committer:
fredgnix <fredgnix@a8afeb8c-277c-4b4a-a4f6-ef4c85adc32b>
Date:
Thu Apr 19 14:49:48 2012 UTC
Message:
to xml
blob - 809ae9972ad458fc13e160f6ca5a5d79e547cade
blob + e707c1cc2b17a1173952b7bfc3c99d89bfcea825
--- Pkgtxt2db.pm
+++ Pkgtxt2db.pm
@@ -210,4 +210,23 @@ sub tojson {
print "$target-$release.json has been built.\n";
}
+sub toxml {
+ my $outx = "$target-$release.xml";
+ open(X, ">$outx") or die "Unable to open $outx for writing, aborting.";
+ print X "<?xml version=\"1.1\" encoding=\"UTF-8\" ?>\n";
+ print X "<packages>";
+ for my $p (keys %pkgdb) {
+ print X "\t<pkgname>$p</pkgname>\n";
+ print X "\t<pkgver>$pkgdb{$p}[1]</pkgver>\n";
+ print X "\t<arch>$pkgdb{$p}[2]</arch>\n";
+ print X "\t<pkgver>$pkgdb{$p}[3]</pkgver>\n";
+ print X "\t<location>$pkgdb{$p}[4]</location>\n";
+ print X "\t<dep>$pkgdb{$p}[5]</dep>\n";
+ print X "\t<sizeC>$pkgdb{$p}[6]</sizeC>\n";
+ print X "\t<sizeU>$pkgdb{$p}[7]</sizeU>\n";
+ print X "\t<pkgdesc>$pkgdb{$p}[8]</pkgdesc>\n";
+ }
+ print X "</packages>\n";
+}
+
1;
Frédéric Galusik