('Codename', 'codename') )
# A "Sub" Release file has slightly different fields
- subattribs = ( ('Origin', 'origin'),
+ subattribs = ( ('Archive', 'suite_name'),
+ ('Origin', 'origin'),
('Label', 'label'),
- ('Archive', 'suite_name'),
('Version', 'version') )
# Boolean stuff. If we find it true in database, write out "yes" into the release file
cnf = Config()
- outfile = os.path.join(cnf["Dir::Root"], 'dists', suite.suite_name, "Release")
+ suite_suffix = "%s" % (cnf.Find("Dinstall::SuiteSuffix"))
+
+ outfile = os.path.join(cnf["Dir::Root"], 'dists', "%s/%s" % (suite.suite_name, suite_suffix), "Release")
out = open(outfile, "w")
for key, dbfield in attribs:
out.write("Architectures: %s\n" % (" ".join([a.arch_string for a in architectures])))
- suite_suffix = "%s" % (cnf.Find("Dinstall::SuiteSuffix"))
-
## FIXME: Components need to be adjusted to whatever will be in the db
## Needs putting in the DB
components = ['main', 'contrib', 'non-free']
out.write("Description: %s\n" % suite.description)
for comp in components:
- for dirpath, dirnames, filenames in os.walk("%sdists/%s/%s" % (cnf["Dir::Root"], suite.suite_name, comp), topdown=True):
+ for dirpath, dirnames, filenames in os.walk("%sdists/%s/%s%s" % (cnf["Dir::Root"], suite.suite_name, suite_suffix, comp), topdown=True):
if not re_gensubrelease.match(dirpath):
continue
subfile = os.path.join(dirpath, "Release")
- subrel = open(subfile, "w")
+ subrel = open(subfile + '.new', "w")
for key, dbfield in subattribs:
if getattr(suite, dbfield) is not None:
subrel.write("%s: yes\n" % (key))
subrel.write("Component: %s%s\n" % (suite_suffix, comp))
+
+ # Urgh, but until we have all the suite/component/arch stuff in the DB,
+ # this'll have to do
+ arch = os.path.split(dirpath)[-1]
+ if arch.startswith('binary-'):
+ arch = arch[7:]
+
+ subrel.write("Architecture: %s\n" % (arch))
subrel.close()
+ os.rename(subfile + '.new', subfile)
+
# Now that we have done the groundwork, we want to get off and add the files with
# their checksums to the main Release file
oldcwd = os.getcwd()
- os.chdir("%sdists/%s" % (cnf["Dir::Root"], suite.suite_name))
+ os.chdir("%sdists/%s/%s" % (cnf["Dir::Root"], suite.suite_name, suite_suffix))
hashfuncs = { 'MD5Sum' : apt_pkg.md5sum,
'SHA1' : apt_pkg.sha1sum,