General TC > Programming & Scripting - Unofficial

search provides.db and sizelist

(1/1)

mocore:

 ::)


--- Code: ---
# wget http://tinycorelinux.net/14.x/x86/tcz/provides.db.gz
# wget http://tinycorelinux.net/14.x/x86/tcz/sizelist
ps() { zcat ./provides.db.gz | awk -v"str=$1" '
BEGIN{ insec_flag=0;matcharr[0]="";fa[0]=""  }
{if(FILENAME ~ "sizelist" ) { split( $0,sl," "); if(sl[1] in matcharr) print } }
{if($0 == "") insec_flag=0 }
/tcz/{ insec_flag=1;section=$0; fa[section]="";    } 
{if( $0 !~ "tcz"){ 
   split($0,fp,"/");
   if( fp[length(fp)] ~ str ){ matcharr[section]= "" matcharr[section] "\n" $0 } } 
}
END{   for( i in matcharr) print i matcharr[i] }' - ./sizelist ; }


--- End code ---
#eg
# ps  '^gio$'

--- Quote ---glib2.tcz 1564672
glib2.tcz
/usr/local/bin/gio

--- End quote ---
# ps  '^file$'

--- Quote ---file.tcz 610304
go.tcz 37777408
file.tcz
/usr/local/bin/file
/usr/local/tce.installed/file
go.tcz
usr/local/go/src/net/http/testdata/file

--- End quote ---


Navigation

[0] Message Index

Go to full version