# 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
-distribution = "sid"
+distribution = "unstable"
build_place = os.path.join(os.getcwd(), 'debian_build')
+suffix_map = {
+ 'wheezy': 'deb70',
+ 'jessie': 'deb80',
+ 'unstable': 'sid',
+ 'sid': 'sid'}
+
class CommandError(exceptions.StandardError):
pass
package_name = cl.package
package_version = re.sub('^\d+:','',str(cl.version))
orig_tar = package_name+'_'+ cl.upstream_version + ".orig.tar"
- dsc_name = package_name+"_"+package_version + ".dsc"
+ dsc_name = package_name+"_"+package_version + '~' + version_suffix+ ".dsc"
+ run_cmd(['dch', '-b', '-v' +str(cl.version)+'~'+version_suffix, '-D'+distribution, 'Autobuilt package'])
print "==> Package: ", package_name
source_format = command_output(('dpkg-source', '--print-format', '.'))
if "native" not in source_format:
for f in dsc_files(dsc_name):
try: os.unlink(f)
except OSError: pass
+ with current_directory(package_path): run_cmd('git checkout debian/changelog', shell=True)
with current_directory(build_place):
sb = ['sbuild', '-n', '-d', distribution, '--setup-hook',
build_place + '/add_source']
opt.add_option('-b', '--build-place',
dest='build_place', help="Write resulting packages to BUILD_PLACE",
default=build_place)
+opt.add_option('--version-suffix', dest ='version_suffix')
opt.add_option('-d', '--distribution',
help="Set the Debian distribution to DISTRIBUTION",
dest="distribution",
(options, packages) = opt.parse_args()
build_place = options.build_place
distribution = options.distribution
+version_suffix = options.version_suffix
+if not version_suffix: version_suffix = suffix_map.get(distribution, '0')
sbuild_opts = options.sbuild_opts
tar_file = options.tar_file