summaryrefslogtreecommitdiff
path: root/hide_unfree
blob: 2dd02e8e4e7cfc9ac76b5aaa88a965eb35869fc3 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# This script hides unfree packages that repo-maintainer takes read permissions off.

repo_dir='/home/parabolavnx/parabolagnulinux.org/repo'

there_are_packages_on_this_dirs=(
    'community/os/i686'
    'community/os/x86_64'
    'community-testing/os/i686'
    'community-testing/os/x86_64'
    'testing/os/i686'
    'testing/os/x86_64'
    'core/os/i686'
    'core/os/x86_64'
    'extra/os/i686'
    'extra/os/x86_64'
    'multilib/os/i686'
    'multilib/os/x86_64'
)

copy_into_this_dirs=(
    'community/os/any'
    'community/os/i686'
    'community/os/x86_64'
    'core/os/any'
    'core/os/i686'
    'core/os/x86_64'
    'extra/os/any'
    'extra/os/i686'
    'extra/os/x86_64'
    'multilib/os/i686'
    'multilib/os/x86_64'
    'sources/packages'
    'sources/community'
    'community-testing/os/i686'
    'community-testing/os/x86_64'
    'testing/os/i686'
    'testing/os/x86_64'
)

source_dirs=(
    'sources/packages'
    'sources/community'
)

blacklist=($(cat /home/parabolavnx/parabolagnulinux.org/docs/{blacklist,pending-*}.txt | cut -d':' -f1))
echo ${blacklist[@]}

for dir in ${copy_into_this_dirs[@]}; do
    cp --remove-destination ~/hide_unfree_index.php "${repo_dir}/${dir}/index.php"
done

for unfree in ${blacklist[@]}; do
     for source_dir in ${source_dirs[@]}; do
         chmod -rx ${repo_dir}/${source_dir}/${unfree}-[0-9]*-*.src.tar.gz
     done
done

# Duplicate to avoid increasing the window of missing index.php that can show unfree packages
#for dir in ${there_are_packages_on_this_dirs[@]}; do
#    # guess the repo name
#    license-add ${repo_dir}/${dir}/$(echo "$dir" | cut -d'/' -f1).licenses.tar.gz ${repo_dir}/${dir}/*.pkg.tar.*
#done


exit 0