run-this-one changed command handling (requires a single command now) / shell arg issue

Bug #1238318 reported by Daniel Hahler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
run-one (Ubuntu)
Fix Released
High
Dustin Kirkland 

Bug Description

I have been using "run-this-one" to call a program with multiple arguments, and this stopped working after upgrading to Saucy.

It appears to be related to this change:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/run-one/saucy/revision/1.1.7

Using $@ is different from using $CMD (after CMD="$@").
The first one handles positional arguments, but the second one is just a string (see e.g. http://osr600doc.sco.com/en/SHL_automate/_Passing_to_shell_script.html).

I think the flock line(s) should be reverted to

    flock -xn "$FLAG" "$@"

again. (Note that there's no "-c" here, which requires a single argument).

TEST CASE:
% run-this-one ssh localhost "printf '%s\n' 'on line one' two 3"
onnlinenonentwon3n%

Quoting the command with run-this-one works around this:
% run-this-one "ssh localhost \"printf '%s\n' 'on line one' two 3\""
on line one
two
3

WORKS (flock directly, without -c):
% flock -xn /tmp/flag ssh localhost "printf '%s\n' 'on line one' two 3"
on line one
two
3

WORKS (flock directly, with -c):
% flock -xn /tmp/flag -c "ssh localhost \"printf '%s\n' 'on line one' two 3\""
on line one
two
3

If the current behavior should be kept (which I would not recommend), run-this-one should test if it is being passed a single argument only then.

Funnily it appears that this was meant to fix another bug reported by me (bug 1189950).

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: run-one 1.13-0ubuntu1 [modified: usr/bin/run-one]
ProcVersionSignature: Ubuntu 3.11.0-12.18-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu1
Architecture: amd64
Date: Fri Oct 11 00:29:57 2013
InstallationDate: Installed on 2012-05-28 (500 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: run-one
UpgradeStatus: Upgraded to saucy on 2013-10-08 (2 days ago)

Revision history for this message
Daniel Hahler (blueyed) wrote :
summary: run-this-one changed command handling (requires a single command now) /
- shell arg
+ shell arg issue
Changed in run-one (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Dustin Kirkland  (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package run-one - 1.14-0ubuntu1

---------------
run-one (1.14-0ubuntu1) saucy; urgency=low

  * run-one: LP: #1238318
    - fix regression, $@ handles positional arguments correctly,
      whereas $CMD does not, drop -c
 -- Dustin Kirkland <email address hidden> Tue, 10 Sep 2013 23:50:44 -0500

Changed in run-one (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.