#31336 closed defect (fixed)

Fix usage for add_c_file.py

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: 043-should, 042-can network-team-roadmap-september
Cc: nickm, gaba, danielpinto52@… Actual Points:
Parent ID: #29217 Points: 0.1
Reviewer: ahf Sponsor: Sponsor31-can


add_c_file.py was added in commit 2f31c8146f in

But it has a bug: the suggested usage fails with:

$ scripts/maint/add_c_file.py ./src/feature/dirauth/ocelot.c
Made files successfully but couldn't identify include.am for ./src/feature/dirauth/ocelot.c
Exit 1

The correct usage has no "./":

$ scripts/maint/add_c_file.py src/feature/dirauth/ocelot.c

We should fix the usage, or make topdir_file() use python's canonical path functions.

Child Tickets

Change History (7)

comment:1 Changed 11 months ago by Jigsaw52

Status: newneeds_review

I've created a patch that fixes this by using os.path.relpath to get the path relative to ./src.
Both ./src/foo.c and src/foo.c are supported.

Pull request here: https://github.com/torproject/tor/pull/1329

comment:2 Changed 11 months ago by nickm

Keywords: 042-can added

comment:3 Changed 11 months ago by Jigsaw52

Cc: danielpinto52@… added

comment:4 Changed 11 months ago by asn

Reviewer: ahf

comment:5 Changed 10 months ago by ahf

Status: needs_reviewmerge_ready

Looks good. Thanks for the patch!

comment:6 Changed 10 months ago by nickm

Milestone: Tor: 0.4.2.x-finalTor: 0.4.3.x-final

Merged to master!

comment:7 Changed 10 months ago by nickm

Resolution: fixed
Status: merge_readyclosed
Note: See TracTickets for help on using tickets.