[tbb-commits] [Git][tpo/applications/rbm][main] Bug 40064: Fix usage of exec without git_url/hg_url

richard (@richard) git at gitlab.torproject.org
Mon Nov 13 16:21:05 UTC 2023



richard pushed to branch main at The Tor Project / Applications / RBM


Commits:
4fd67eea by Nicolas Vigier at 2023-11-08T08:51:23+01:00
Bug 40064: Fix usage of exec without git_url/hg_url

- - - - -


2 changed files:

- doc/rbm_templates.asc
- lib/RBM.pm


Changes:

=====================================
doc/rbm_templates.asc
=====================================
@@ -107,7 +107,9 @@ exec::
         considered to be a script, which will be written to a temporary
         file and executed. The second argument of the exec function is
         an optional $options hash, used to override values of 'git_url',
-        'hg_url', 'fetch', 'git_hash' or 'hg_hash'.
+        'hg_url', 'fetch', 'git_hash' or 'hg_hash'. If neither 'git_url'
+        nor 'hg_url' is set, the command is executed from the directory
+        where the 'rbm.conf' file is located.
 
 path::
         A function to return an absolute path. It takes a path as first


=====================================
lib/RBM.pm
=====================================
@@ -549,7 +549,7 @@ sub git_submodule_init_sync_update {
 sub execute {
     my ($project, $cmd, $options) = @_;
     CORE::state %cache;
-    my $res_name;
+    my $res_name = '';
     my $old_cwd = getcwd;
     if (project_config($project, 'git_url', $options)) {
         my $git_hash = project_config($project, 'git_hash', $options)
@@ -571,6 +571,8 @@ sub execute {
         my ($stdout, $stderr, $success, $exit_code)
                 = capture_exec('hg', 'update', '-C', $hg_hash);
         exit_error "Cannot checkout $hg_hash:\n$stderr" unless $success;
+    } else {
+        chdir($config->{basedir});
     }
     my ($stdout, $stderr, $success, $exit_code)
                 = run_script($project, $cmd, \&capture_exec);



View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/4fd67eea510a6806394c760b6dba4bbdbae8f298

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/4fd67eea510a6806394c760b6dba4bbdbae8f298
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20231113/15e66e63/attachment-0001.htm>


More information about the tbb-commits mailing list