From ba3730a5425e735f1ffdc7ae6cdf09d409d7b1e7 Mon Sep 17 00:00:00 2001 From: Ricardo Barbedo Date: Sun, 12 Apr 2020 13:47:10 +0200 Subject: [PATCH] Filter out IP repos outside of the project directory --- README.md | 8 ++++---- scripts/write_project_tcl_git.tcl | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c44f21..a0d1af2 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Vivado is a pain in the ass to source control decently, so these scripts provide ├── project_name.sim/ ├── project_name.srcs/ │ ├── sources_1/ - │ │ ├── bd/ # BDs are regenerated from script + │ │ ├── bd/ # BDs are regenerated from script │ │ │ ├── my_bd/hdl/my_bd_wrapper.{v,vhd} # BD wrappers are also regenerated │ │ │ └── ... │ │ └── ... @@ -101,10 +101,10 @@ tracked by Git. If you need to manually modify the BD wrapper generated by Vivad you can write a handwritten wrapper to the generated wrapper and put only the handwritten one under source control. -#### Board part repository paths +#### Board part and IP repositories paths -Only board part repositories inside the project are stored in the project +Only board part and IP repositories inside the project are stored in the project generator script. -If you have a system wide board part repository, you will need to add it manually +If you have a system wide board part or IP repository, you will need to add it manually after recreating the project from the Tcl script (e.g. via `Settings --> Board Repository`). diff --git a/scripts/write_project_tcl_git.tcl b/scripts/write_project_tcl_git.tcl index 83fe82b..e124cb0 100644 --- a/scripts/write_project_tcl_git.tcl +++ b/scripts/write_project_tcl_git.tcl @@ -841,6 +841,8 @@ proc write_specified_fileset { proj_dir proj_name filesets } { lappend path_list $path } else { set rel_file_path "[get_relative_file_path_for_source $path [get_script_execution_dir]]" + # Filter out IP repositories outside of the project directory + if { [string first .. $rel_file_path] == 0 } { continue } set path "\[file normalize \"\$origin_dir/$rel_file_path\"\]" lappend path_list $path }