/usr/bin/current-ubuntu-release-codename is in python-launchpadlib-toolkit 0.5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/usr/bin/python
import os.path
import sys
from lpltk import LaunchpadService
from lpltk.utils import (
load_file,
write_file,
file_age
)
cache_file = os.path.join(
"/tmp/lpltk.cache",
os.path.basename(sys.argv[0])
)
# First try using the cached information
if os.path.exists(cache_file):
if file_age(cache_file) < 24*60*60:
print load_file(cache_file)
sys.exit(0)
try:
lp = LaunchpadService(config={'read_only':True})
d = lp.distributions['ubuntu']
text = d.stable_series.name
print text
write_file(cache_file, text)
except:
sys.exit(7)
sys.exit(0)
|