1 |
commit: 056de1754eddc251ef41d9ab7afc856f41e7ce5d |
2 |
Author: Alex Legler <alex <AT> a3li <DOT> li> |
3 |
AuthorDate: Sun Oct 4 12:30:11 2015 +0000 |
4 |
Commit: Alex Legler <a3li <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 4 12:30:11 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/sites/www.git/commit/?id=056de175 |
7 |
|
8 |
Adapt to pgo updates |
9 |
|
10 |
_plugins/packages.rb | 15 ++++++--------- |
11 |
bin/update-packages.sh | 4 ++-- |
12 |
2 files changed, 8 insertions(+), 11 deletions(-) |
13 |
|
14 |
diff --git a/_plugins/packages.rb b/_plugins/packages.rb |
15 |
index eab8168..7b406ce 100644 |
16 |
--- a/_plugins/packages.rb |
17 |
+++ b/_plugins/packages.rb |
18 |
@@ -15,14 +15,10 @@ module Gentoo |
19 |
item.children.each do |tag| |
20 |
case tag.name |
21 |
when 'title' |
22 |
- tag.css('span').each do |span| |
23 |
- if span['class'] == 'cpvstr' |
24 |
- item_data['atom'] = span.text.strip |
25 |
- item_data['atom_c'], pv = item_data['atom'].split('/', 2) |
26 |
- item_data['atom_p'], item_data['atom_v'] = pv.rpartition('-') |
27 |
- elsif span['class'] == 'description' |
28 |
- item_data['description'] = span.text.strip |
29 |
- end |
30 |
+ if tag.text =~ /^Added: (.*) \((.*)\)$/ |
31 |
+ item_data['atom'] = $1.strip |
32 |
+ item_data['atom_c'], item_data['atom_p'] = item_data['atom'].split('/', 2) |
33 |
+ item_data['description'] = $2 |
34 |
end |
35 |
when 'link' |
36 |
item_data['uri'] = tag['href'] |
37 |
@@ -32,6 +28,7 @@ module Gentoo |
38 |
site.data['packages']['updates'] << item_data |
39 |
end |
40 |
|
41 |
+ puts site.data['packages']['updates'] |
42 |
end |
43 |
end |
44 |
-end |
45 |
\ No newline at end of file |
46 |
+end |
47 |
|
48 |
diff --git a/bin/update-packages.sh b/bin/update-packages.sh |
49 |
index 1c4ef31..1140207 100755 |
50 |
--- a/bin/update-packages.sh |
51 |
+++ b/bin/update-packages.sh |
52 |
@@ -1,5 +1,5 @@ |
53 |
#!/bin/bash |
54 |
|
55 |
echo -n 'Updating Packages information...' |
56 |
-wget 'http://packages.gentoo.org/feed/newpackage' -O _data/packages.xml 2>/dev/null |
57 |
-echo 'done.' |
58 |
\ No newline at end of file |
59 |
+wget 'https://packages.gentoo.org/packages/added.atom' -O _data/packages.xml 2>/dev/null |
60 |
+echo 'done.' |