suites=session.query(Suite).filter(Suite.untouchable == False).all()
threadpool = ThreadPool()
+
+ startdir = os.getcwd()
+ os.chdir(cnf["Dir::TempPath"])
+
# For each given suite, each architecture, run one apt-ftparchive
for s in suites:
- arch_list=get_suite_architectures(s.suite_name, skipsrc=False, skipall=False, session=session)
+ arch_list=get_suite_architectures(s.suite_name, skipsrc=False, skipall=True, session=session)
+ Logger.log(['generating output for Suite %s, Architectures %s' % (s.suite_name, arch_list)])
for a in arch_list:
- Logger.log(['generating output for Suite %s, Architecture %s' % (s.suite_name, a.arch_string)])
- print 'generating output for Suite %s, Architecture %s' % (s.suite_name, a.arch_string)
threadpool.queueTask(s.generate_packages_sources, (a.arch_string))
threadpool.joinAll()
+ os.chdir(startdir)
# this script doesn't change the database
session.close()
Logger.close()
import re
import psycopg2
import traceback
+import commands
from datetime import datetime, timedelta
from errno import ENOENT
from tempfile import mkstemp, mkdtemp
Default
{
- Packages::Compress ". bzip2 gzip";
- Sources::Compress ". bzip2 gzip";
+ Packages::Compress "bzip2 gzip";
+ Sources::Compress "bzip2 gzip";
Contents::Compress "gzip";
DeLinkLimit 0;
MaxContentsChange 25000;
"""
apt_trees={}
+apt_trees["di"]={}
apt_trees["testing"]="""
tree "dists/testing"
{
ExtraOverride "override.squeeze.extra.$(SECTION)";
SrcOverride "override.squeeze.$(SECTION).src";
};
+"""
+apt_trees["di"]["testing"]="""
tree "dists/testing/main"
{
FileList "/srv/ftp-master.debian.org/database/dists/testing_main_$(SECTION)_binary-$(ARCH).list";
SrcOverride "override.squeeze.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb";
+ %(contentsline)s
};
tree "dists/testing/non-free"
SrcOverride "override.squeeze.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb-nf";
+ %(contentsline)s
};
"""
ExtraOverride "override.sid.extra.$(SECTION)";
SrcOverride "override.sid.$(SECTION).src";
};
+"""
+apt_trees["di"]["unstable"]="""
tree "dists/unstable/main"
{
FileList "/srv/ftp-master.debian.org/database/dists/unstable_main_$(SECTION)_binary-$(ARCH).list";
SrcOverride "override.sid.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb";
+ %(contentsline)s
};
tree "dists/unstable/non-free"
SrcOverride "override.sid.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb-nf";
+ %(contentsline)s
};
"""
BinOverride "override.sid.$(SECTION)";
SrcOverride "override.sid.$(SECTION).src";
};
+"""
+apt_trees["di"]["experimental"]="""
tree "dists/experimental/main"
{
FileList "/srv/ftp-master.debian.org/database/dists/experimental_main_$(SECTION)_binary-$(ARCH).list";
SrcOverride "override.sid.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb";
+ %(contentsline)s
};
tree "dists/experimental/non-free"
SrcOverride "override.sid.main.src";
BinCacheDB "packages-debian-installer-$(ARCH).db";
Packages::Extensions ".udeb";
- Contents "$(DIST)/../Contents-udeb-nf";
+ %(contentsline)s
};
"""
SrcOverride "override.squeeze.$(SECTION).src";
Contents " ";
};
+"""
+apt_trees["di"]["testing-proposed-updates"]="""
tree "dists/testing-proposed-updates/main"
{
FileList "/srv/ftp-master.debian.org/database/dists/testing-proposed-updates_main_$(SECTION)_binary-$(ARCH).list";
FileList "/srv/ftp-master.debian.org/database/dists/proposed-updates_$(SECTION)_binary-$(ARCH).list";
SourceFileList "/srv/ftp-master.debian.org/database/dists/proposed-updates_$(SECTION)_source.list";
Sections "main contrib non-free";
- Architectures "amd64";
+ Architectures "%(arch)s";
BinOverride "override.lenny.$(SECTION)";
ExtraOverride "override.lenny.extra.$(SECTION)";
SrcOverride "override.lenny.$(SECTION).src";
Contents " ";
};
+"""
+apt_trees["di"]["proposed-updates"]="""
tree "dists/proposed-updates/main"
{
FileList "/srv/ftp-master.debian.org/database/dists/proposed-updates_main_$(SECTION)_binary-$(ARCH).list";
@param arch: Architecture name
"""
- tempdir = None
- startdir = os.getcwd()
-
+ cnf = Config()
try:
# Write apt.conf
- (ac_fd, ac_name) = mkstemp()
+ (ac_fd, ac_name) = mkstemp(dir=cnf["Dir::TempPath"])
os.write(ac_fd, DAILY_APT_CONF)
# here we want to generate the tree entries
os.write(ac_fd, apt_trees[self.suite_name] % {'arch': arch})
+ # this special casing needs to go away, but this whole thing may just want an
+ # aptconfig class anyways
+ if arch != 'source':
+ if arch == 'hurd-i386' and self.suite_name == 'experimental':
+ pass
+ else:
+ if arch == "amd64":
+ os.write(ac_fd, apt_trees["di"][self.suite_name] %
+ {'arch': arch, 'contentsline': 'Contents "$(DIST)/../Contents-udeb";'})
+ else:
+ os.write(ac_fd, apt_trees["di"][self.suite_name] % {'arch': arch, 'contentsline': ''})
os.close(ac_fd)
# Run apt-ftparchive generate
- os.chdir(os.path.dirname(ac_name))
# We might want to add a -q or -qq here
- os.system('apt-ftparchive generate %s' % os.path.basename(ac_name))
+ os.environ['GZIP'] = '--rsyncable'
+ os.chdir(cnf["Dir::TempPath"])
+ (result, output) = commands.getstatusoutput('apt-ftparchive generate %s' % os.path.basename(ac_name))
+ sn="a-f %s,%s: " % (self.suite_name, arch)
+ print sn + output.replace('\n', '\n%s' % (sn))
# Clean up any left behind files
finally:
- os.chdir(startdir)
if ac_fd:
try:
os.close(ac_fd)