summaryrefslogtreecommitdiff
path: root/auto/create_meta.sh
blob: c05b0840ef4f70523d3306ea560f76113d7d0ff2 (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
#!/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

for repo in $(ls repo); do
    [ "$repo " = "meta" ] || echo $repo | create "All the the packages available in $repo" > repo/meta/$repo.xibuild
done