Created
October 9, 2013 04:19
-
-
Save sky-y/6896171 to your computer and use it in GitHub Desktop.
debiancode: Debianのコードネームをバージョン番号から求める
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Usage: debiancode version_number | |
import sys | |
import math | |
if len(sys.argv) != 2: | |
print 'Usage: debiancode version_number' | |
quit() | |
version = sys.argv[1] | |
ver_num = float(version) | |
codenames = { | |
"1.1":"buzz", | |
"1.2":"rex", | |
"1.3":"bo", | |
"2.0":"hamm", | |
"2.1":"slink", | |
"2.2":"potato", | |
"3.0":"woody", | |
"3.1":"sarge", | |
"4.0":"etch", | |
"5.0":"lenny", | |
"6.0":"squeeze", | |
"7.0":"wheezy", | |
"8.0":"jessie" | |
} | |
if ver_num >= 4.0: | |
ver_num = math.floor(ver_num) | |
if str(ver_num) in codenames.keys(): | |
print codenames[str(ver_num)] | |
else: | |
print "Not found" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment