AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

Data structure: use real arrays (#62) #88

Closed Artoria2e5 closed 1 year ago

Artoria2e5 commented 8 years ago

62

Artoria2e5 commented 8 years ago

Bai, try to run a basic self-build check..

Artoria2e5 commented 8 years ago

rebased. still recommending pull --rebase=preserve origin data.

Artoria2e5 commented 8 years ago

Well, OK, f that, I forgot to check the args in arch/_common.

Artoria2e5 commented 8 years ago

Since the flags are exported into ENV in the traditional sloppy way anyway, there is no point in array-izing it for now.

jyhi commented 7 years ago

How is this PR now?

Artoria2e5 commented 7 years ago

Changes required for merging should be still obvious.

Artoria2e5 commented 6 years ago

Oh. The flags internal part (nolto, usexxx etc) needs some data sanitization too.

Artoria2e5 commented 1 year ago

lmao this isn't going anywhere. Anyways, just came up with these snippets:

is_array() { [[ $(declare -p $1) == 'declare -'[aA]* ]]; }
to_array() {
  declare -n ref=$1
  mapfile -d ' ' -t $1< <(printf %s "$ref")
}
check_type_array() {
  if ! is_array "$1"; then
    ab_warn "$1 should be an array now! splitting."
    to_array "$1"
  fi
}
MingcongBai commented 1 year ago

This has stalled for way too long and requires quite a bit of work still. Let's resurrect this when we feel up for it.