Merge "Implemented methods work working with HTTP proxies"
diff --git a/src/com/mirantis/mk/Debian.groovy b/src/com/mirantis/mk/Debian.groovy
index abcf02e..9aec81c 100644
--- a/src/com/mirantis/mk/Debian.groovy
+++ b/src/com/mirantis/mk/Debian.groovy
@@ -191,7 +191,7 @@
           def orig_md5 = common.cutOrDie("md5sum ${name}", 0)
           def orig_size = common.cutOrDie("ls -l ${name}", 4)
 
-          def retval = sh(script: "wget --quiet -O orig-tmp https://launchpad.net/ubuntu/", returnStatus: true)
+          def retval = sh(script: "wget --quiet -O orig-tmp https://launchpad.net/ubuntu/+archive/primary/+files/${name}", returnStatus: true)
           if (retval == 0) {
              sh("mv orig-tmp ${name}")
              def new_sha1 = common.cutOrDie("sha1sum ${name}", 0)
@@ -203,8 +203,8 @@
              sh("sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.changes")
           }
 
-          sh("debsign --re-sign -k ${gpg_key_id} *.changes")
-          sh("dput -f \"ppa:${ppaRepo}\" *.changes")
+          sh("export GNUPGHOME=${workspace}/.gnupg; debsign --re-sign -k ${gpg_key_id} *.changes")
+          sh("export GNUPGHOME=${workspace}/.gnupg; dput -f \"ppa:${ppaRepo}\" *.changes")
         }
     }
 }
\ No newline at end of file