Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-02-05 14:13:03 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2022-02-05 14:13:03 +0100
commite6ee9e025462d26a8c5e4b98ae22191405848126 (patch)
treebc4b520e49bb328c266622f4d541dd27c4d5a1a0
parent9ad57e1c50f5e6e387483997c87dd27002f3dd67 (diff)
magnet2feed.py: fixed, but it generates only an entry for the last ISO?
-rwxr-xr-x[-rw-r--r--]magnet2feed.py38
1 files changed, 17 insertions, 21 deletions
diff --git a/magnet2feed.py b/magnet2feed.py
index 5dc767f..dc953c8 100644..100755
--- a/magnet2feed.py
+++ b/magnet2feed.py
@@ -1,30 +1,26 @@
+#!/usr/bin/env python3
+
from feedgenerator import Rss201rev2Feed
import sys
from os.path import basename
-feed_url = 'https://static.dopsi.ch/al32/feed_{arch}.rss'
-architectures = ['i686', 'dual']
-
-
-def main(link, date):
- for arch in architectures:
- feed = Rss201rev2Feed(title='ArchLinux32 torrent download feed ({arch} ISO)'.format(arch=arch),
- link=feed_url,
- description="A torrent feed to download the latest ArchLinux32 {arch} iso".format(
- arch=arch
- ),
- language='en')
-
- feed.add_item(title='ArchLinux32 {arch} {date}'.format(arch=arch, date=date),
- link=link,
- description='ArchLinux32 {arch} {date}'.format(arch=arch, date=date))
+def main(link, arch, date, feed_url):
+ feed = Rss201rev2Feed(title='ArchLinux32 torrent download feed ({arch} ISO)'.format(arch=arch),
+ link=feed_url,
+ description="A torrent feed to download the latest ArchLinux32 {arch} iso".format(
+ arch=arch
+ ),
+ language='en')
- with open(basename(feed_url).format(arch=arch), mode='w') as feed_file:
- feed.write(feed_file, 'utf-8')
+ feed.add_item(title='ArchLinux32 {arch} {date}'.format(arch=arch, date=date),
+ link=link,
+ description='ArchLinux32 {arch} {date}'.format(arch=arch, date=date))
+ with open(basename(feed_url).format(arch=arch), mode='w') as feed_file:
+ feed.write(feed_file, 'utf-8')
if __name__ == '__main__':
- if len(sys.argv) != 3:
- print('Error: {cmd} magnet date'.format(cmd=sys.argv[0]))
+ if len(sys.argv) != 5:
+ print('Error: {cmd} magnet arch date feed_url'.format(cmd=sys.argv[0]))
- main(link=sys.argv[1], date=sys.argv[2])
+ main(link=sys.argv[1], arch=sys.argv[2], date=sys.argv[3], feed_url=sys.argv[4])