Skip to content

Commit

Permalink
Merge branch 'themactep:master' into sannce-i21ag
Browse files Browse the repository at this point in the history
  • Loading branch information
diadatp authored Sep 26, 2024
2 parents 70f9308 + f3bd6c8 commit 728e5c2
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 103 deletions.
2 changes: 1 addition & 1 deletion buildroot
Submodule buildroot updated 43 files
+0 −2 .checkpackageignore
+70 −0 package/busybox/0010-Linux-v6.8-rc1-removed-the-definitions-related-to-CB.patch
+1 −1 package/gawk/Config.in
+2 −2 package/gawk/gawk.hash
+1 −1 package/gawk/gawk.mk
+1 −1 package/hicolor-icon-theme/hicolor-icon-theme.hash
+2 −2 package/hicolor-icon-theme/hicolor-icon-theme.mk
+0 −27 package/httping/0001-fix-math-library-linking.patch
+0 −48 package/httping/0002-Makefile-allow-build-without-gettext.patch
+11 −2 package/httping/Config.in
+2 −2 package/httping/httping.hash
+13 −28 package/httping/httping.mk
+0 −5 package/libcurl/libcurl.mk
+2 −2 package/libpcap/libpcap.hash
+1 −1 package/libpcap/libpcap.mk
+2 −2 package/mc/mc.hash
+1 −1 package/mc/mc.mk
+2 −2 package/nano/nano.hash
+1 −1 package/nano/nano.mk
+2 −2 package/qlibc/Config.in
+1 −1 package/qt5/qt5.mk
+1 −1 package/qt5/qt5base/0005-eglfs-avoid-breaking-compilation-for-obscure-EGLNativeDisplayType-types.patch
+1 −1 package/qt5/qt5connectivity/Config.in
+1 −1 package/qt5/qt5enginio/qt5enginio.mk
+1 −1 package/qt5/qt5virtualkeyboard/Config.in
+1 −1 package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch
+1 −1 package/rapidxml/Config.in
+1 −1 package/redis/0003-redis.conf-adjust-defauts-for-buildroot.patch
+1 −1 package/rlwrap/Config.in
+2 −2 package/rpi-firmware/Config.in
+1 −1 package/selinux-python/0001-python-sepolgen-fix-ausearch-path.patch
+1 −1 package/skeleton-init-systemd/fakeroot_tmpfiles.sh
+2 −2 package/slirp/Config.in
+1 −1 package/smcroute/smcroute.mk
+1 −1 package/socat/socat.mk
+2 −2 package/softether/0003-use-fhs-install-directories.patch
+1 −1 package/sqlite/Config.in
+3 −3 package/stress-ng/stress-ng.mk
+1 −1 package/supertux/supertux.mk
+2 −2 package/sysklogd/Config.in
+2 −2 package/systemd/Config.in
+2 −2 package/tcpdump/tcpdump.hash
+1 −1 package/tcpdump/tcpdump.mk
227 changes: 126 additions & 101 deletions package/prudynt-t/files/prudyntcfg.awk
Original file line number Diff line number Diff line change
@@ -1,139 +1,166 @@
#!/usr/bin/awk -f
# write line if y is set, it's commented out
function w(y){
for(i=0;i<d;i++){u=u"\t"};
##############################################
# functions always start with _
#
# flag o:
# 1 = key / value mode
# 2 = array open
# 4 = question marks open
# 8 = comment after value
# 64 = error
# 128 = write
# 256 = finish
##############################################
function _s(q){
o=or(o,q);
}
function _u(q){
if(and(o,q)){o=xor(o,q)};
}
function _q(q){
return and(o,q)!=0;
}
function _i(q){
u="";
for(i=0;i<q;i++){u=u"\t"}
return u;
}
function _e(q){
if(g){g=g"\n"}
g=g""q;
}
function _w(y){
# if y is set we uncomment the line else we create a new one
u=_i(d);
if(y){
u=u"# "t": "r";"
}else{
if(!length(v)){v=r}
if(!v){v=r}
u=u""e": "v";"
}
if(length(n)){u=u" # "n}
o=or(o,128);
if(n){u=u" # "n}
_s(128);
return u;
}
function b(){
function _b(){
# section does not exists, we need to create
if(!v){return}
d=split(s,j,".");
for(k in j){
if(length(m)){m=m"."}
if(m){m=m"."}
m=m""j[k];
if(p!=m&&(m~"^"p".*")){
u="";
for(i=1;i<k;i++){u=u"\t"}
g[h++]=u""j[k]": {"
u=_i(k-1);
_e(u""j[k]": {")
}else{x=k}
}
u="";g[h++]=w();
_e(_w());
for(d--;d>=x;d--){
u="";
for(i=d;i>0;i--){u=u"\t"}
g[h++]=u"};";u=""
}
u=_i(d);
_e(u"};");
u=""
}
_s(128);
}
# split line by char
function a(l){
split(l,c,"");
function _a(){
for(i=1;i<=length($0);i++){
s(c[i]);
}
}
# analyze char
function s(c){
if(and(o,4)&&c!="\""){
# everything is allowed in quotation marks
k=k""c;
}else if(c==":"||c=="="){
# here we set value flag
o=or(o,1);t=k;k="";
}else if(c=="{"){
if(!and(o,2)){
# section opener, current key(k) = this(t)
d++;
if(length(p)>0){
p=p"."t;k="";t=""
c=substr($0,i,1);
if(_q(4)&&c!="\""){
# everything is allowed in quotation marks
k=k""c;
}else if(c==":"||c=="="){
# here we set value flag
_s(1);t=k;k="";
}else if(c=="{"){
if(!_q(2)){
# section opener, current key(k) = this(t)
d++;
if(p){
p=p"."t;k="";t=""
}else{
p=t;t=""
}
}else{
p=t;t=""
}
}else{
# object opener in an array
}
}else if(c=="}"){
if(!and(o,2)){
# section closer
#
# if the section is closed and the value should be set but does not exist.
# we insert a new line here
if(s==p&&f~"^set$"&&(!and(o,128))){
if(length(v)){g[h++]=w()}else{o=or(o,128)}
# object opener in an array
}
if(s~"^"p".*$"&&f~"^set$"&&(!and(o,128))){
b();
}
# remove last path element and cleanup current(t)
if(sub(/\.[[:alnum:]]+$/,"",p)==0){
p=""
}else if(c=="}"){
if(!_q(2)){
# section closer
#
# if the section is closed and the value should be set but does not exist.
# we insert a new line here
if(s==p&&f~"^set$"&&(!_q(128))){
if(v){_e(_w())}
}
if(s~"^"p"\\..*$"&&f~"^set$"&&(!_q(128))){
if(v){_b()}
}
# remove last path element and cleanup current(t)
if(sub(/\.[[:alnum:]]+$/,"",p)==0){
p=""
}
t="";d--
} else {
# object closer in an array
}
t="";d--
} else {
# object closer in an array
}else if(c=="("){
# array opener
_s(2);
}else if(c==")"){
# array closer
_i(2);
}else if(_q(1)==1&&c=="\""){
# opening / closing quotation marks, assign string value on close
if(!_q(4)){_s(4);k=""}else{_u(4);r="\""k"\"";k=""}
}else if(_q(1)&&c==";"){
# value terminator ';'
if(length(r)==0){r=k;k=""};
}else if(_q(1)&&c=="#"){
# comment at the end of the line
_s(8);
}else if(match(c,"[^[:space:]]")){
k=k""c;
}
}else if(c=="("){
# array opener
o=or(o,2);
}else if(c==")"){
# array closer
o=xor(o,2);
}else if(and(o,1)==1&&c=="\""){
# opening / closing quotation marks, assign string value on close
if(!and(o,4)){o=or(o,4);k=""}else{o=xor(o,4);r="\""k"\"";k=""}
}else if(and(o,1)&&c==";"){
# value terminator ';'
if(length(r)==0){r=k;k=""};
}else if(and(o,1)&&c=="#"){
# comment at the end of the line
o=or(o,8);
}else if(match(c,"[^[:space:]]")){
k=k""c;
}
}
function p(l) {
_m=(s==p&&match(l,"^[[:space:]]*#.*"e".*:.*"));
if(length(l)&&((!match(l,"^[[:space:]]*#")&&!match(l,"^\s*$")&&!match(l,"^version.*$"))||_m)){
function _p() {
# match key/value line in section also if commented out
b=(s==p&&match($0,"^[[:space:]]*#[[:space:]]*"e"[[:space:]]*:.*"));
if(length($0)&&((!match($0,"^[[:space:]]*#")&&!match($0,"^\\s*$")&&!match($0,"^version.*$"))||b)){
# check if line is commented out
if(_m){sub("#[[:space:]]", "",l)}
if(b){sub("#([[:space:]]*)","",$0)}
# value mode reset on each line
if(and(o,1)){o=xor(o,1)}
# comment reset on each line
if(and(o,8)){o=xor(o,8)}
_u(9);
# current (k), value(r), comment(n) rest on each line
k="";r="";n="";
# call a to analyze character
a(l);
# call _a to analyze line
_a();
# if k is not empty here, it must be a (unterminated) value or comment
if(length(k)>0){if(and(o,8)==8){n=k}else{r=k}}
if(length(k)>0){if(_q(8)){n=k}else{r=k}}
# exact section and value match
if(f~"^list$"&&!_m&&(p==s||p~"^"s".*$"||length(s)==0)&&length(p)&&length(t)&&length(r)){
o=or(o,128);
if(f~"^list$"&&!b&&(p==s||p~"^"s"\\..*$"||!s)&&p&&t&&r){
print(p"."t"="r)
}
if(s==p&&e==t) {
if(f~"^get$"&&!_m){o=or(o,256);print(r);exit;}
if(f~"^set$"){if(length(v)||_m){$0=w()}else{o=or(o,128)}}
if(f~"^unset$"){$0=w(1)}
if(f~"^get$"&&!b){_s(256);print(r);exit;}
if(f~"^set$"){if(v||b){$0=_w()}}
if(f~"^unset$"){$0=_w(1)}
}
}
}

BEGIN {
f=ARGV[1];
s=ARGV[2];
if((f~"^[g|s]et|unset$"&&ARGV[2])){
if((f~"^(get|set|unset)$"&&s)){
i=split(s,j,".");
e=j[i];sub(/\.[[:alnum:]]+$/,"",s)
e=j[i];
sub(/\.[[:alnum:]_]+$/,"",s)
}
v=ARGV[3];
if(!ARGV[1]||(f~"^[g|s]et|unset$"&&!ARGV[2])||i==1){
if(!f||(!(f~"^(get|set|unset|list)$"))||(!(f~"^list$")&&i==1&&s)){
print "prudynt configuration helper v0.1";
print "";
print "Usage [get|set|list|unset] <section>.<setting> <value>";
Expand All @@ -143,24 +170,22 @@ BEGIN {
print "\t\tif value is not provided but setting exists as comment, it will be uncomment";
print "\tlist\tlist all configured <settings>. Can be limited by providing a <section>";
print "\tunset\tcomment a <setting> if exists";
o=or(o,320);f="";
exit;
f="";_s(320);exit;
}

for (i=ARGC;i>2;i--){ARGC--}
ARGV[1]="/etc/prudynt.cfg";
}
{if(!and(o,256)){p($0);g[h++]=$0}}
{if(o<256){if(o<128){_p()};_e($0)}}
END{
if(f~"^set$"&&(!and(o,128))){
if(f~"^set$"&&(!_q(128))){
# main section does not exists, we need to create
g[h++];b()
_e("");_b()
}
if(f~"^set$|^unset$") {
for(i=0;i<h;i++) {
print g[i]>ARGV[1]
}
if(_q(128)) {
print g>ARGV[1]
}
if((and(o,256)||and(o,128))&&!and(o,64)){
if((_q(128)||_q(256))&&f){
exit 0
}
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ IFS=$'\n'
for line in $lsfiles; do
echo "<tr>"
# skip .
[ -n "$(echo $line | grep \s\./$)" ] && continue
echo $line | grep -q ' \./$' && continue
name=${line##* }; line=${line% *}
path=$(echo "$dir/$name" | sed s#^//#/#)
Expand Down

0 comments on commit 728e5c2

Please sign in to comment.