pass GBP_BUILD_DIR to the build command
authorGuido Günther <agx@sigxcpu.org>
Sun, 5 Apr 2009 17:03:34 +0000 (19:03 +0200)
committerGuido Günther <agx@sigxcpu.org>
Sun, 5 Apr 2009 17:03:49 +0000 (19:03 +0200)
this allows hooks to figure out where to copy back the build result.
Adjust the cowbuilder example accordingly.

examples/gbp-cowbuilder-sid
git-buildpackage

index bcbf148..4021f23 100755 (executable)
@@ -30,6 +30,7 @@ case $ACTION in
        # pass all options to dpkg-buildpackage:
        pdebuild --configfile ${CONF}                \
                --pbuilder cowbuilder                \
+               --buildresult ${GBP_BUILD_DIR}/..    \
                --debbuildopts "-i\.git/ -I.git $*"  \
                -- $OPTS
        ;;
index 7362156..2e9ebdd 100755 (executable)
@@ -282,13 +282,15 @@ def main(argv):
                 build_dir = repo_dir
 
             # Finally build the package:
-            RunAtCommand(options.builder, dpkg_args, shell=True)(dir=build_dir)
+            RunAtCommand(options.builder, dpkg_args, shell=True, 
+                         extra_env={'GBP_BUILD_DIR': build_dir})(dir=build_dir)
             if options.postbuild:
                 arch = du.get_arch()
                 changes = os.path.abspath("%s/../%s_%s_%s.changes" %
                                           (build_dir, cp['Source'], version_no_epoch, arch))
                 Command(options.postbuild, shell=True,
-                        extra_env={'GBP_CHANGES_FILE': changes})()
+                        extra_env={'GBP_CHANGES_FILE': changes,
+                                   'GBP_BUILD_DIR': build_dir})()
         if options.tag or options.tag_only:
             print "Tagging %s" % version
             tag = build_tag(options.debian_tag, version)