leahneukirchen / xtools

a few helpers for working with XBPS
131 stars 59 forks source link

xlint: check for var definitions other than x=... #42

Open Gottox opened 8 years ago

Gottox commented 8 years ago

The Posix Shell allows to set global variables with constructs other then x=. xlint should check if a variable is set with one of these constructs:

Vaelatern commented 8 years ago

Does declaring i as local actually fix xgensum for your template?

Vaelatern commented 8 years ago
02:04 <Gottox> + sed http://downloads.arduino.cc/reference-1.6.6-3.zip -e '/^checksum...
02:04 <Gottox> okay, something is wrong here.
02:04 <Vaelatern> Should be sed -i
02:04 <Gottox> aaaah.
02:04 <Vaelatern> sed $i -e "/^checksum=/,/^[^ \t]/{ <-- the line
02:05 <Gottox> in the template I'm using a for i ... loop
02:06 <Vaelatern> see lines 8-10 of xgensum
02:06 <Gottox> so the template overwrites i
02:06 <Gottox> and xlint doesn't care as it's not set via i=
Gottox commented 8 years ago

No, it was used to construct the distfiles at the toplevel local doesn't work here. I fixed this by prefixing it with an underscore.

This was an error in my template that caused xgensum to missbehave. These kind of error should be checked in xlint.

Chocimier commented 5 years ago

Also checking for function names may be useful (i merged some of those, unfortunately):

find srcpkgs -name template | xargs -n 1 grep '\S*.+[(][)] [{]' -Ph | grep -vF --regex={do,pre,post,pkg}_{install,check,build,configure,extract,fetch,clean,patch}'() {' -e package'() {' | grep -vP '^_' 
        sed -i 's/op_test() {/& return 0;/' boot-strap
seccomp_audit_get_suffix() {
post_Install() {
Projucer() {
pkg_lang() {
post_intsall() {
disable_module() {
post_intall() {
post-install() {
post-install() {
vopt_hflag() {
mk_string_build_args() {
post-install() {
post-install() {
post-install() {
post-install() {
post-install() {
post-install() {