summaryrefslogtreecommitdiffstats
path: root/scripts/keywordsgen.sh
blob: 47ce0dfdf5d0025d99095bd1dee628ca94f55f64 (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
#! /bin/bash

# Unlock last version of virtual/perl packages (helps if we upgrading to current unstable release)
(
    cd /usr/portage

    rm /etc/portage/package.keywords/xdeps-perl530.xgen.keywords
    for p in virtual/perl-*; do 
        (
            name=$(basename "$p")
            #cd "$p"
            
            regexp=$(echo "${p}/${name}-" | sed "s/\+/\\\\+/g")
            
            latest=$(ls "${p}/${name}"*.ebuild | sed -r "s#${regexp}##" | sort -V | tail -n 1)

            ebuild="${p}/${name}-${latest}"
            category=$(echo "$p" | awk -F '/' '{ print $1 }')
            package=$(basename $ebuild .ebuild)

            (cat $ebuild | grep perl-5.30 &> /dev/null) && echo "=$category/$package ~amd64" >> /etc/portage/package.keywords/xdeps-perl530.xgen.keywords
        )
    done
)