Skip to content

Commit

Permalink
Treating sources.list as content
Browse files Browse the repository at this point in the history
  • Loading branch information
f-prime committed Aug 1, 2016
1 parent b5fc0fe commit 9f44e6d
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Code Cleanup
- Default settings now use ubuntu xenial instead of ubuntu precise
- Documented changed
- Now treats source.list as content in `content.py` instead of pulling from a URL that could be down.

# 1.1.1

Expand Down
7 changes: 3 additions & 4 deletions coffer/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ def getSourceList(path, version):
if not os.path.exists(path + "/etc/apt/"):
sys.exit(text.failedToCreate)

if version in content.listUrls:
with open(path + "/etc/apt/sources.list", 'wb') as f:
source = urllib.urlopen(content.listUrls[version]).read()
f.write(source)
if version in content.sources:
with open(path + "/etc/apt/sources.list", 'w') as f:
f.write(content.sources[version])

def executeTemplate(template):
templateName = template.split("/")[-1]
Expand Down
183 changes: 174 additions & 9 deletions coffer/utils/content.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,178 @@
versions = ['karmic', 'wily', 'jessie-kfreebsd', 'sarge.buildd', 'maverick', 'oneiric', 'gutsy', 'quantal', 'hardy', 'jessie', 'precise', 'stretch', 'woody.buildd', 'dasyatis', 'utopic', 'lenny', 'jaunty', 'yakkety', 'warty.buildd', 'etch-m68k', 'oldstable', 'hoary', 'stable', 'warty', 'edgy', 'vivid', 'lucid', 'intrepid', 'woody', 'unstable', 'trusty', 'sarge.fakechroot', 'etch', 'xenial', 'breezy', 'feisty', 'wheezy', 'hoary.buildd', 'saucy', 'dapper', 'squeeze', 'natty', 'aequorea', 'sid', 'chromodoris', 'sarge', 'raring', 'bartholomea', 'potato', 'testing']
listUrls = {
"precise":"https://repogen.simplylinux.ch/txt/precise/sources_5890340971fbf0741f7a7cb154cf2a486c8aaf73.txt",
"trusty":"https://repogen.simplylinux.ch/txt/trusty/sources_c55d87eaaab1291e3620cb0f7f86e6a32bd7e092.txt",
"wily":"https://repogen.simplylinux.ch/txt/wily/sources_f596f96f5e4b3a1f5f3f460dc60debb4025d97ea.txt",
"xenial":"https://repogen.simplylinux.ch/txt/xenial/sources_d7042047164a663ac6f51e701b555d7130bba96a.txt",
"wheezy":"https://debgen.simplylinux.ch/txt/wheezy/sources_97b243141d1cc225255cf1fc08b6266f64ddd6d4.txt",
"jessie":"https://debgen.simplylinux.ch/txt/jessie/sources_02afb983ca66b4136396fe1f3cc5e8052fa5532a.txt",
"stretch":"https://debgen.simplylinux.ch/txt/stretch/sources_6254adc7f61eaf8f0643f312e0353eb87c7ef22f.txt",
"sid":"https://debgen.simplylinux.ch/txt/sid/sources_885f89dfe39f95ee61c37ff07c11562d74ceda13.txt",

precise = """
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://01.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
###### Ubuntu Update Repos
deb http://01.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner
###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
"""

trusty = """
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://01.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
###### Ubuntu Update Repos
deb http://01.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
"""

wily = """
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://01.archive.ubuntu.com/ubuntu/ wily main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ wily main restricted universe multiverse
###### Ubuntu Update Repos
deb http://01.archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ wily-proposed main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ wily-proposed main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse
"""

xenial = """
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://01.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
###### Ubuntu Update Repos
deb http://01.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://01.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
"""

wheezy = """
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ wheezy-proposed-updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy-proposed-updates main contrib non-free
"""

jessie = """
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
"""

stretch = """
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ stretch/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ stretch-proposed-updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch-proposed-updates main contrib non-free
"""

sid = """
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.us.debian.org/debian/ sid main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ sid/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ sid-proposed-updates main contrib non-free
deb-src http://security.debian.org/ sid/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ sid-proposed-updates main contrib non-free
"""

sources = {
"precise":precise,
"trusty":trusty,
"wily":wily,
"xenial":xenial,
"wheezy":wheezy,
"jessie":jessie,
"stretch":stretch,
"sid":sid,
}
architectures = {
"32bit":"i386",
Expand Down

0 comments on commit 9f44e6d

Please sign in to comment.