__block shouldn't append, but preserve position in file #92

Closed
opened 2021-11-20 13:23:46 +00:00 by ungleich-gitea · 6 comments

Created by: 4nd3r

quick hack with sed:

root@ander-test-debian:/tmp# echo -e "1\n2\n3\n4\n5" > test
root@ander-test-debian:/tmp# cat test
1
2
3
4
5
root@ander-test-debian:/tmp# sed -ni '1h; 1!H; ${ g; s/2.*4/2\n0\n4/p }' test
root@ander-test-debian:/tmp# cat test
1
2
0
4
5

but not sure if i'm missing something 🤔

*Created by: 4nd3r* quick hack with sed: ``` root@ander-test-debian:/tmp# echo -e "1\n2\n3\n4\n5" > test root@ander-test-debian:/tmp# cat test 1 2 3 4 5 root@ander-test-debian:/tmp# sed -ni '1h; 1!H; ${ g; s/2.*4/2\n0\n4/p }' test root@ander-test-debian:/tmp# cat test 1 2 0 4 5 ``` but not sure if i'm missing something :thinking:
ungleich-gitea added the
bugfix
label 2021-11-20 13:23:46 +00:00
ander was assigned by ungleich-gitea 2021-11-20 13:23:46 +00:00
Author
Owner

closed

closed
Author
Owner

@ander Ack. I will close it.
When you have something for implementation in python then we can discuss and add it to https://code.ungleich.ch/ungleich-public/cdist/tree/beta.

@ander Ack. I will close it. When you have something for implementation in python then we can discuss and add it to https://code.ungleich.ch/ungleich-public/cdist/tree/beta.
Author
Owner

ugh, time flies.

with introduction of python types, I think there's no point trying to fix __block now and do it when reimplementing this type in python.

(to everyone else reading this: python types doesn't mean you need python in destination 😸)

i consider __file, __link, __directory, __line, __key_value, __block and __staged_file (functionality of this type should be merged into __file, imho) core types (maybe i missed a few?), which is used by many other types. so, if we consider candidates for python reimplemention, pick those.

core or essential types? types, which you use to manipulate files/directories directly.

imho, rest of the types are "nice to have", but i can live without them 😃

so, lets close this for now @poljakowski? or rename this issue and discuss the concept of core/essential types...

ugh, time flies. with introduction of python types, I think there's no point trying to fix __block now and do it when reimplementing this type in python. (to everyone else reading this: python types doesn't mean you need python in destination :smile_cat:) i consider __file, __link, __directory, __line, __key_value, __block and __staged_file (functionality of this type should be merged into __file, imho) core types (maybe i missed a few?), which is used by many other types. so, if we consider candidates for python reimplemention, pick those. core or essential types? types, which you use to manipulate files/directories directly. imho, rest of the types are "nice to have", but i can live without them :smiley: so, lets close this for now @poljakowski? or rename this issue and discuss the concept of core/essential types...
Author
Owner

assigned to @ander

assigned to @ander
Author
Owner

I have half-assed rewrite of __block, but it needs more polish before MR.

you can assign this issue to me.

I have half-assed rewrite of `__block`, but it needs more polish before MR. you can assign this issue to me.
Author
Owner

@ander Do you have some new, more detailed, analysis?

@ander Do you have some new, more detailed, analysis?
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#92
No description provided.