This is a follow-up to #13532, where @promag already asked if this renaming would make sense.
If network shall be named Onion instead of Tor (like in the option onlynet), renaming the network enum NET_TOR to NET_ONION maybe would make sense and be stringent.
Change was produced with the following script:
0#!/bin/bash
12for file in $(grep --exclude-dir='.git' --files-with-matches --binary-files=without-match --recursive NET_TOR bitcoin/)3do4 sed --in-place --expression='s/NET_TOR/NET_ONION/g'$file5done
Tor is used at many other places in the code, though.
fanquake added the label
Refactoring
on Jun 30, 2018
fanquake added the label
P2P
on Jun 30, 2018
promag
commented at 9:15 am on June 30, 2018:
member
@fanquake OK i replaced the script code. Do other versions of sed not understand the s/regexp/replacement/ syntax? I am surprised that one can leave out the first and last /
The man page for GNU sed 4.4 on Linux says:
s/regexp/replacement/
Attempt to match regexp against the pattern space. If successful, replace that portion matched with replacement.
fanquake
commented at 1:48 pm on July 1, 2018:
member
@wodry Apologies, my commit message was meant to include the first and last /…
@fanquake please see my edits. Is
sed -i"" 's/NET_TOR/NET_ONION/g' src/init.cpp src/netaddress.cpp src/netaddress.h src/netbase.cpp src/qt/optionsdialog.cpp src/test/netbase_tests.cpp src/torcontrol.cpp ok for Mac?
What does the Travis error mean. Is something not ok with my commit?
0The command "if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then test/lint/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi" exited with 1.
10.12s$ test/lint/git-subtree-check.sh src/crypto/ctaes
2src/crypto/ctaes in HEAD currently refers to tree 1b6c31139a71f80245c09597c343936a8e41d0213src/crypto/ctaes in HEAD was last updated in commit 8501bedd7508ac514385806e191aec21ee978891 (tree 1b6c31139a71f80245c09597c343936a8e41d021)
4subtree commit 003a4acfc273932ab8c2e276cde3b4f3541012dd unavailable: cannot compare
I double checked that my change commit is set up onto a freshly fetched master upstream branch.
fanquake
commented at 2:31 pm on July 1, 2018:
member
@wodry You need to add “scripted-diff:” to the commit title. i.e “scripted-diff: rename NET_TOR to NET_ONION”
@Empact I agree. My original script that I posted in my first comment does that.
@MarcoFalke-l is --files-with-matches which I used in my original script that I posted in my first comment.
@fanquake I changed back to my original script but changed --in-place to --in-place'' so it should work on MacOS sed, too.
Thanks @ken2812221 for the fix. Isn’t it better to grep for occurrence of NET_TOR in all non-binary files to see if NET_TOR is maybe also in non-.cpp/.h files?
If this is not the case, like here, it’s fine, and as a benefit one knows that fact.
MarcoFalke
commented at 8:51 am on July 2, 2018:
member
-BEGIN VERIFY SCRIPT-
sed --in-place'' --expression='s/NET_TOR/NET_ONION/g' $(git grep -I --files-with-matches 'NET_TOR')
-END VERIFY SCRIPT-
The --in-place'' hack is required for sed on macOS to edit files in-place without passing a backup extension.
07c493f2d1
Empact
commented at 5:02 pm on July 2, 2018:
member
utACK07c493f
ken2812221
commented at 11:32 pm on July 3, 2018:
contributor
utACK07c493f2d1053d6a1c7d0ca1650da7b6f94c8948
sipa
commented at 11:36 pm on July 3, 2018:
member
utACK07c493f2d1053d6a1c7d0ca1650da7b6f94c8948
laanwj
commented at 9:50 am on July 4, 2018:
member
utACK07c493f2d1053d6a1c7d0ca1650da7b6f94c8948
Tor is used at many other places in the code, though.
The goal should also not be to replace tor with onion. The distinction is:
onion should be used when referring to the representation and connecting to of onion hidden services.
tor when dealing with tor in general, so when connecting out through the tor proxy, Tor is special (unlike say, I2P) in that it’s possible to connect both to internal onion addresses and external addresses through exit nodes.
laanwj merged this
on Jul 4, 2018
laanwj closed this
on Jul 4, 2018
laanwj referenced this in commit
5c05dd6285
on Jul 4, 2018
unknown deleted the branch
on Jul 4, 2018
PastaPastaPasta referenced this in commit
237a76f6fe
on Apr 16, 2020
PastaPastaPasta referenced this in commit
d0d5735290
on Apr 16, 2020
PastaPastaPasta referenced this in commit
c62115a12b
on Apr 19, 2020
PastaPastaPasta referenced this in commit
1c8012a7dc
on Apr 20, 2020
PastaPastaPasta referenced this in commit
14928c3cc9
on May 10, 2020
PastaPastaPasta referenced this in commit
dd31a2bb9a
on May 12, 2020
PastaPastaPasta referenced this in commit
f0e5ef09fc
on Jun 9, 2020
PastaPastaPasta referenced this in commit
dcd94c323f
on Jun 9, 2020
PastaPastaPasta referenced this in commit
732c8d7ab2
on Jun 10, 2020
PastaPastaPasta referenced this in commit
96c5bacba2
on Jun 11, 2020
gades referenced this in commit
b83e2d7c74
on Jun 25, 2021
random-zebra referenced this in commit
85f000ecbe
on Jul 30, 2021
random-zebra referenced this in commit
b4751e10ce
on Aug 11, 2021
gades referenced this in commit
0ab6502b05
on Jan 29, 2022
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-23 12:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me