rev=$(echo "$ver" | cut -d. -f4)
build="$2"
+distro=${3:="unstable"}
dst_version="$major.$minor.$micro"
dst_name="freeswitch-$dst_version"
# Build the debian source package first, from the source tar file.
cd $src_repo/debbuild/$dst_full_name
-dch -v $dst_full_version-1 "Nightly Build"
+dch -v "${dst_full_version}-0" -M --force-distribution -D "$distro" "Nightly Build"
dpkg-buildpackage -rfakeroot -S -us -uc
micro=$(echo "$ver" | cut -d. -f3)
rev=$(echo "$ver" | cut -d. -f4)
+tmp_dir=${TMP_DIR:="/tmp"}
+
build="$2"
dst_name="freeswitch-$major.$minor.$micro"
-dst_parent="/tmp/jenkis.$$/"
-dst_dir="/tmp/jenkins.$$/$dst_name"
+dst_parent="${tmp_dir}/jenkis.$$/"
+dst_dir="${tmp_dir}/jenkins.$$/$dst_name"
if [ -d "$dst_dir" ]; then
echo "error: destination directory $dst_dir already exists." 1>&2