I finally found a solution.
the command vdir -lib $lib -prop dpnd $entity
returns you something like this:
data: ENTITY E1
# Depends on: P ieee std_logic_unsigned RYmj:=TK`k=k>D@Cz`zoB3
# Depends on: P ieee std_logic_arith 4`Y?g_lldn;7UL9IiJck01
# Depends on: P std textio 5>J:;AW>W1[[dW0I6EN1Q0
# Depends on: P ieee std_logic_1164 5=aWaoGZSMWIct0i^f`XF1
# ARCHITECTURE BODY rtl
# Depends on: E L2 E2 3B3>6RbjY07ohgTgj<M4r0
# Depends on: E L3 E3 5?a[d8Ikz7>zWX`U97gNE2
# Depends on: P ieee std_logic_unsigned RYMj;=TK`k=k>C@Cz`zoB3
# Depends on: P ieee std_logic_arith 7`F?g_lkdn;7UL9IiJck01
# Depends on: P std textio 5>J:;AW>w0[[dW0I6EN1Q0
# Depends on: P ieee std_logic_1164 5=aWboGZSMlIcH0i^f`XF1
# Depends on: E work E1 ;4e7E?eQ@DHPeB>5WUDQK3
P stands for package and E for Entity. So you can use regular expressions (like me in the extracting function) to extract the data you want.
proc get_dependency_list_of_entity { lib entity } {
set vdir_data [ vdir -lib $lib -prop dpnd $entity ]
set match [extracting $vdir_data "^ *Depends on: (.+)"]
...
}
...
}
As I mentioned already in the question: There are ways to get the library of an entity with vdir and also with write report -tcl