Skip to content

fix: Avoid creating a .yml-r file - #5358

Merged
rjsparks merged 2 commits into
ietf-tools:mainfrom
richsalz:ignore.yml-r
Apr 14, 2023
Merged

fix: Avoid creating a .yml-r file#5358
rjsparks merged 2 commits into
ietf-tools:mainfrom
richsalz:ignore.yml-r

Conversation

@richsalz

Copy link
Copy Markdown
Collaborator

These seem to be created if initial setup fails. Ignore them.

Not sure if this is something you want or not.

@rjsparks
rjsparks requested review from NGPixel and removed request for NGPixel March 17, 2023 17:14
@rjsparks

Copy link
Copy Markdown
Member

Are you sure this isn't a side-effect of an editor you are using touching the file?
I haven't ever seen such a thing.
If you can reproduce (or guess at what led to) the initial setup failure, it might help with assessing.

@richsalz

Copy link
Copy Markdown
Collaborator Author

I'll close this. It came about, I think, when I didn't have 'docker compose' and the initial setup failed. Not worth it.

@richsalz richsalz closed this Mar 17, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 22, 2023
@rjsparks rjsparks reopened this Mar 25, 2023
@rjsparks

Copy link
Copy Markdown
Member

Other people at the sprint are running into this - ignoring the file won't hurt us, but it would be good to know what is creating it.

@rjsparks

Copy link
Copy Markdown
Member

We need to add code to the run script that detects the version of sed.
For people getting sed from os/x, the -i or -I takes an argument, and in this case it's eating -r as the argument

rjsparks@dhcp-80c4 foo % ls
rjsparks@dhcp-80c4 foo % echo "This is a test" > a
rjsparks@dhcp-80c4 foo % sed -i -r -e "s/ a / the /" a
rjsparks@dhcp-80c4 foo % ls -al
total 16
drwxr-xr-x    4 rjsparks  staff   128 Mar 25 14:44 .
drwxr-xr-x  236 rjsparks  staff  7552 Mar 25 14:43 ..
-rw-r--r--    1 rjsparks  staff    17 Mar 25 14:44 a
-rw-r--r--    1 rjsparks  staff    15 Mar 25 14:44 a-r

From man sed on osx:

     -I extension
             Edit files in-place, saving backups with the specified extension.
             If a zero-length extension is given, no backup will be saved.  It
             is not recommended to give a zero-length extension when in-place
             editing files, as you risk corruption or partial content in
             situations where disk space is exhausted, etc.

             Note that in-place editing with -I still takes place in a single
             continuous line address space covering all files, although each
             file preserves its individuality instead of forming one output
             stream.  The line counter is never reset between files, address
             ranges can span file boundaries, and the “$” address matches only
             the last line of the last file.  (See Sed Addresses.) That can lead
             to unexpected results in many cases of in-place editing, where
             using -i is desired.

     -i extension
             Edit files in-place similarly to -I, but treat each file
             independently from other files.  In particular, line numbers in
             each file start at 1, the “$” address matches the last line of the
             current file, and address ranges are limited to the current file.
             (See Sed Addresses.) The net result is as though each file were
             edited by a separate sed instance.

Use sed portably, "sed <foo >bar" and avoid the flags.
@ietf-tools ietf-tools unlocked this conversation Apr 14, 2023
Comment thread docker/run Outdated
Fix command line, per Carsten.

Co-authored-by: cabo <cabo@tzi.org>
@richsalz richsalz changed the title fix: Ignore .yml-r files fix: Avoid creating a .yml-r file Apr 14, 2023
@rjsparks
rjsparks merged commit cffc5cf into ietf-tools:main Apr 14, 2023
richsalz added a commit to richsalz/datatracker that referenced this pull request Apr 17, 2023
* fix: Don't create yml-r files on OSx

Use sed portably, "sed <foo >bar" and avoid the flags.

* Update docker/run

Fix command line, per Carsten.

Co-authored-by: cabo <cabo@tzi.org>

---------

Co-authored-by: cabo <cabo@tzi.org>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 18, 2023
@richsalz
richsalz deleted the ignore.yml-r branch July 22, 2023 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants