summaryrefslogtreecommitdiff
path: root/auto/create_meta.sh
blob: b427f4132b45298e262a60d1d3cbb7e99b1f3e85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

create() {
    local desc=$*

    printf "#!/bin/bash\n"
    printf "# This file was automatically generated, do not edit!"
    printf "\n\n"

    printf "DESC=\"$desc\"\n" 
    printf "DEPS=("
    while read repo; do
        [ -d repo/$repo ] && [ ! "$repo" = "meta" ] &&
            for file in $(ls repo/$repo/*.xibuild); do
                local name=$(basename -s ".xibuild" $file)
                printf " $name"
            done
    done

    printf ")\n"
}

ls repo | create 'AlL tHe pacKageS!!' > repo/meta/all.xibuild

skip="skip meta linux"

for repo in $(ls repo); do
    if echo $skip | grep -q $repo; then
        echo "Skipping $repo"
    else
        echo $repo | create "All the the packages available in $repo" > repo/meta/$repo.xibuild
        echo "Generated $repo.xibuild"
    fi
done