################################################################################
import os, pg, re, stat, sys
################################################################################
import os, pg, re, stat, sys
legacy_filename = qid["path"]+qid["filename"]
size = os.stat(legacy_filename)[stat.ST_SIZE]
if (poolized_size + size) > limit and limit >= 0:
legacy_filename = qid["path"]+qid["filename"]
size = os.stat(legacy_filename)[stat.ST_SIZE]
if (poolized_size + size) > limit and limit >= 0:
destination_filename = base_filename
# Work out the source package name
if re_isadeb.match(base_filename):
destination_filename = base_filename
# Work out the source package name
if re_isadeb.match(base_filename):
package = control.Find("Package", "")
source = control.Find("Source", package)
if source.find("(") != -1:
package = control.Find("Package", "")
source = control.Find("Source", package)
if source.find("(") != -1:
source = m.group(1)
# If it's a binary, we need to also rename the file to include the architecture
version = control.Find("Version", "")
architecture = control.Find("Architecture", "")
if package == "" or version == "" or architecture == "":
source = m.group(1)
# If it's a binary, we need to also rename the file to include the architecture
version = control.Find("Version", "")
architecture = control.Find("Architecture", "")
if package == "" or version == "" or architecture == "":
- dak.lib.utils.fubar("%s: couldn't determine required information to rename .deb file." % (legacy_filename))
- version = dak.lib.utils.re_no_epoch.sub('', version)
+ daklib.utils.fubar("%s: couldn't determine required information to rename .deb file." % (legacy_filename))
+ version = daklib.utils.re_no_epoch.sub('', version)
# Work out the component name
component = qid["component"]
if component == "":
q = projectB.query("SELECT DISTINCT(c.name) FROM override o, component c WHERE o.package = '%s' AND o.component = c.id;" % (source))
ql = q.getresult()
if not ql:
# Work out the component name
component = qid["component"]
if component == "":
q = projectB.query("SELECT DISTINCT(c.name) FROM override o, component c WHERE o.package = '%s' AND o.component = c.id;" % (source))
ql = q.getresult()
if not ql:
component = ql[0][0]
# Work out the new location
q = projectB.query("SELECT l.id FROM location l, component c WHERE c.name = '%s' AND c.id = l.component AND l.type = 'pool';" % (component))
ql = q.getresult()
if len(ql) != 1:
component = ql[0][0]
# Work out the new location
q = projectB.query("SELECT l.id FROM location l, component c WHERE c.name = '%s' AND c.id = l.component AND l.type = 'pool';" % (component))
ql = q.getresult()
if len(ql) != 1:
- dak.lib.utils.fubar("couldn't determine location ID for '%s'. [query returned %d matches, not 1 as expected]" % (source, len(ql)))
+ daklib.utils.fubar("couldn't determine location ID for '%s'. [query returned %d matches, not 1 as expected]" % (source, len(ql)))
pool_filename = pool_location + destination_filename
destination = Cnf["Dir::Pool"] + pool_location + destination_filename
if os.path.exists(destination):
pool_filename = pool_location + destination_filename
destination = Cnf["Dir::Pool"] + pool_location + destination_filename
if os.path.exists(destination):
# Then Update the DB's files table
if verbose:
print "SQL: UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, location_id, qid["files_id"])
if not no_action:
q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, location_id, qid["files_id"]))
# Then Update the DB's files table
if verbose:
print "SQL: UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, location_id, qid["files_id"])
if not no_action:
q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, location_id, qid["files_id"]))
for i in ["help", "limit", "no-action", "verbose" ]:
for i in ["help", "limit", "no-action", "verbose" ]:
Arguments = [('h',"help","Poolize::Options::Help"),
Arguments = [('h',"help","Poolize::Options::Help"),