Another try for sp
[moonshot.git] / debian-builder
index d371780..1a1830d 100755 (executable)
@@ -16,7 +16,6 @@ from shutil import copy
 
 import debian.changelog, debian.deb822
 
-
 # These variables can be overridden by options. If packages is not
 # set, then it is read from the source_packages file
 packages = []  # Set of packages to build
@@ -51,14 +50,14 @@ def command_output(args) :
 def dsc_files(dsc) :
     '''Describe all the files included in dsc, wich is a string name
     of a dsc package. dsc itself is included'''
-    package = debian.deb822.Dsc(file(dsc))
+    package = debian.deb822.Dsc(open(dsc))
     internal_files = map( lambda(x): x['name'], package['Files'])
     internal_files.append(dsc)
     return internal_files
 
 def build(package):
     with current_directory(package):
-        cl = debian.changelog.Changelog(file('debian/changelog'))
+        cl = debian.changelog.Changelog(open('debian/changelog'))
         package_name = cl.package
         package_version = str(cl.version)
         orig_tgz = package_name+'_'+ cl.upstream_version + ".orig.tar.gz"
@@ -108,7 +107,7 @@ def gen_package_files() :
     '''.format (
         build_place = build_place
         )
-    f = file(build_place + "/add_source", "w")
+    f = open(build_place + "/add_source", "w")
     f.write(script)
     f.close()
     with current_directory(build_place):
@@ -120,7 +119,7 @@ def gen_package_files() :
 def read_packages():
     '''Read in the packages file from source_packages
     '''
-    try: pf = file("source_packages")
+    try: pf = open("source_packages")
     except IOError:
         print "Error: source_packages file not found"
         exit(1)
@@ -153,7 +152,6 @@ distribution = options.distribution
 sbuild_opts = options.sbuild_opts
 
 if len(packages) == 0: packages = read_packages()
-
 try:
     os.makedirs(build_place)
 except OSError: pass