Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.do files of the form do/a.do were not found #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rfl4kx
Copy link

@rfl4kx rfl4kx commented Mar 7, 2013

First commit:
With a 'do/default.do' file, or 'do/a.do' file, the command 'redo a.do' did not work.
Note: in the test 107-dodir, the line 'mkdir -p x/y' seems unnecessary.

Commits 2 & 3: tiny cleanups

rfl4kx added 4 commits March 7, 2013 15:36
It should produce exactly the same result whether a .do file is under
a do/ dir or not (e.g. ./do/y.do or ./y.do), but it wasn't the case, for
example:

$ cat ./do/default.do # empty file
$ cat ./do/x.do
redo y
$ redo y # builds ./y
redo  y
$ redo x # builds ./x and ./do/y
redo  x
redo    do/y

The last command should build ./x and ./y, not ./do/y.
@eternaleye
Copy link

This pull request has a bug, due to misusing rstrip. In three places in state.py, it calls ".rstrip('/do')" as though rstrip was a right-aligned replace, when it really has more in common with 'tr -d'. The reason the parameter is named 'chars' is because it isn't a string at all - it's a set of chars which rstrip is permitted to treat as 'trailing garbage'.

This has the amusing effect of causing redo to fail in building itself, because it chops off the 'do' and then can't find 're'.

@eternaleye
Copy link

One way to resolve that:

abs_pwd = abs_pwd[0:-3] if abs_pwd[-3:] == '/do' else abs_pwd
(ditto on rel_orig_dir and base)

@mildred
Copy link
Owner

mildred commented Mar 6, 2014

I pushed some changes in the dodir feature where $1 and $2 are prefixed with ../ in case the .do file is in a do/ directory, perhaps that could solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants