bugparallel - Bugs: bug #64327, parallel --citation will loop...


bug #64327: parallel --citation will loop forever if the config dir does not exist yet

Submitter:  Preben Guldberg <preben>
Submitted:  Tue 20 Jun 2023 06:19:35 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Tue 20 Jun 2023 06:42:06 PM UTC, comment #1: 

My apologies - I found the wrong group when searching.

This is mean for GNU parallel where I will report it next.

Sorry for the noise.

Preben Guldberg <preben>
Tue 20 Jun 2023 06:19:35 PM UTC, original submission:  

If you run "parallel --citation" immedaitely after installaing
parallel, when the config dir does not yet exist, the command
will loop forever.

The loop in question is

    while(not grep { -e "$_/will-cite" } @Global::config_dirs) {

Although $Global::config_dir is created if the user enters
"will cite", this is not sufficient to break out of the loop.

The diff calls init_globals() if the directory is created.
I suppose this is safe as --citation is handled on its own.

diff --git a/src/parallel b/src/parallel
index e455592e..047ae53e 100755
--- a/src/parallel
+++ b/src/parallel
@@ -5953,7 +5953,10 @@ sub citation() {
        if($input =~ /will cite/i) {
-           mkdir $Global::config_dir;
+           if(mkdir $Global::config_dir) {
+                # Reset @Global::config_dirs so we can break out of the loop.
+                init_globals();
+            }
            if(open (my $fh, ">", $Global::config_dir."/will-cite")) {
                close $fh;

Preben Guldberg <preben>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by preben (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.12