Announcer: put the state of the last version into /var/lib
This commit is contained in:
parent
e1d2862c4b
commit
d05a0c80c0
@ -29,6 +29,7 @@ import os
|
||||
import sys
|
||||
import email.utils
|
||||
from optparse import OptionParser
|
||||
from xdg.BaseDirectory import save_data_path
|
||||
|
||||
parser = OptionParser()
|
||||
parser.add_option("--dry", action="store_true", help="dry run")
|
||||
@ -48,6 +49,7 @@ if not options.sender or not options.to or not options.relay:
|
||||
url = "http://download.opensuse.org/tumbleweed/iso/"
|
||||
iso = "openSUSE-Tumbleweed-DVD-x86_64-Current.iso"
|
||||
changes = "Changes.%s.txt"
|
||||
DATADIR = save_data_path('opensuse.org', 'factory-announcer')
|
||||
intro = """
|
||||
Please note that this mail was generated by a script.
|
||||
The described changes are computed based on the x86_64 DVD.
|
||||
@ -62,7 +64,7 @@ while discussing a specific problem.
|
||||
|
||||
"""
|
||||
|
||||
current_fn = os.path.join(os.path.dirname(__file__), "announcer-current-version")
|
||||
current_fn = os.path.join(DATADIR, "announcer-current-version")
|
||||
|
||||
if not options.version:
|
||||
u = urlparse(urljoin(url, iso))
|
||||
@ -132,7 +134,7 @@ else:
|
||||
s.sendmail(options.sender, [msg['To']], msg.as_string())
|
||||
s.quit()
|
||||
|
||||
tmpfn = os.path.join(os.path.dirname(__file__), ".announcer-current-version")
|
||||
tmpfn = os.path.join(DATADIR, ".announcer-current-version")
|
||||
os.symlink(version, tmpfn)
|
||||
os.rename(tmpfn, current_fn)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user