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

arch_loaddef cannot perform correctly as designed #70

Closed Icenowy closed 9 years ago

Icenowy commented 9 years ago

look at the original arch_loaddef Why is ARCH_FINDFILELIST reverted before finding and sourceing? Because autobuild/x/defines can override autobuild/defines

Commit 9cbdb1229e9fe8754774aea2ffb0e18421acfe14 broken this feature, and make arch_loaddef a nonsense, as the specified defines will be override by the general one.

Artoria2e5 commented 9 years ago

Loaddef uses loadfiles internally, which does not stop on found. Read the current one and come back.

Icenowy commented 9 years ago

I don't mean you can have no main defines but sub-defines, but I mean that sub-defines can patch to main defines

Icenowy commented 9 years ago

For example, for arch amd64,mipsel,blah, PKGDEP=a b c, but for armel, d is also needed. I can write autobuild/defines: PKGDEP="a b c" autobuild/armel/defines: PKGDEP+=" d"

Icenowy commented 9 years ago

At last, do not change the program logic, unless you know why it's written.

Artoria2e5 commented 9 years ago

RedBullshit. Luke it.

MingcongBai commented 9 years ago

RedBullshit. Luke it.

But it really did not work.

Artoria2e5 commented 9 years ago

Fine, tracing.

Artoria2e5 commented 9 years ago

It does work. Minimal reproduction code used:

# not sourcing the whole file so we don't fail at pm lib
ARCH_FINDFILELIST=("autobuild/cross-$ARCH-$CROSS" "autobuild/cross-$CROSS" "autobuild/$ARCH" "autobuild")
arch_loadfiles(){
    local _archpath _archpidx _archokay=0
    for (( _archpidx = "${#ARCH_FINDFILELIST[@]}"; _archpidx; --_archpidx ))
    do
        _archpath="${ARCH_FINDFILELIST[$_archpidx]}"
        if [ -e "$_archpath/$1" ]; then
            . "$_archpath/$1"
            _archokay=1
        fi
    done
    (( _archokay )) || return 127
}
arch_loaddef(){ arch_loadfiles defines; }

ARCH=amd128
cd "$(mktemp -d)"
mkdir -p autobuild/amd128
echo echo a > autobuild/defines
echo echo amd128 > autobuild/amd128/defines
arch_loaddef
Icenowy commented 9 years ago

define is not plain echo

MingcongBai commented 9 years ago

@Arthur2e5 Please do not close this yet, I am investigating this issue.

MingcongBai commented 9 years ago

@Arthur2e5 Test case is extra-gnome/nautilus.

Artoria2e5 commented 9 years ago

AND DEFINE IS NOT PLAIN ECHO BUT THOSE ARE ALL CODE RUN

Artoria2e5 commented 9 years ago

If you want it, fine, change echo to PKGFAK+=a and see

Icenowy commented 9 years ago

CODE SHOULD NOT ONLY RUNS, BUT ALSO RUN IN A SPECIFIED SEQUENCE. DO YOU THINK A GENERAL defines CAN OVERRIDE WHAT IS DEFINED IN A SPECIFIED ONE?

Artoria2e5 commented 9 years ago

IT DID NOT COULD YOU PLEASE FUCKING READ THE OUTPUT?

MingcongBai commented 9 years ago

Okay, gotcha.

MingcongBai commented 9 years ago

... oh...?

MingcongBai commented 9 years ago

Okay, gotcha.

MingcongBai commented 9 years ago

Let me make a test case real soon...

MingcongBai commented 9 years ago

... oh...?

Icenowy commented 9 years ago

I've tested it

MingcongBai commented 9 years ago

Let me make a test case real soon...

Icenowy commented 9 years ago

永远没有把bug assign给用户的做法

Icenowy commented 9 years ago

I've tested it

Icenowy commented 9 years ago

永远没有把bug assign给用户的做法

Artoria2e5 commented 9 years ago

@JeffBai 咦,发生什么了

Artoria2e5 commented 9 years ago

我倒是知道有个设计纰漏 也就是 ab/cross-$CROSS 和 ab/$ARCH 意味着在 armel 上打包 armel 的时候你不能用 cross 过来的那个,反之亦然 但很可惜不是我的锅 总之关我肉棒事…( 自己留下了个垃圾设计现在又装孙,啊不装用户

So go mkfs yourself luser.