summaryrefslogtreecommitdiff
path: root/conf/intel/repo/kogaionlinux.ro/packages.db.post_update.sh
blob: 2770480a69e7f7ab6b3353dca9ceb3cac59540f3 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
# Entropy Framework 1.0
# Entropy Client post repository update (equo update <repoid>) script
# -- called every time repositories are updated --
#
# This is a sample file shipped with client repositories which contains
# per-repository post repository update hook. More precisely, this script is
# triggered when entropy updates repositories. As stated, this script is PER-
# repository and it's shipped with it.
# It MUST return 0, any different value will be considered as critical error.
#
# This script must be called with specific arguments explained here below:
#
#     # sh packages.db.post_upgrade.sh [REPOSITORY_ID] [ROOT] [ENTROPY_BRANCH]
#
# example:
#
#     # sh packages.db.post_branch.sh "kogaionlinux.ro" "/" "5"
#
# PLEASE NOTE: this script is called automatically by entropy and, unless
# requested otherwise, it should be NEVER EVER called by user.

[ "$(id -u)" != "0" ] && echo && echo "Skipping update script, you are not root" && exit 0

[ -z "$3" ] && echo "not enough parameters" && exit 1

REPO_ID=$1
ROOT=$2
BRANCH=$3

configure_correct_binutils() {
    # configure correct binutils
    # new profile needs to be configured
    echo
    binutils_dir="${ROOT}/etc/env.d/binutils"
    if [ -d "${binutils_dir}" ]; then
        binutils_profile=$(find "${binutils_dir}" -name "$(uname -m)*" | \
            sort | tail -n 1 | xargs basename)
        echo "trying to set binutils profile ${binutils_profile}"
        binutils-config ${binutils_profile}
    else
        echo "binutils directory ${binutils_dir} not found"
        echo "cannot properly set binutils profile"
        rc=1
    fi
}

if [ ! -f "/usr/$(uname -m)-pc-linux-gnu/bin/ld" ]; then
	configure_correct_binutils
fi

autoconfl_file="${ROOT}/etc/env.d/00-entropy-autoconflict"
if [ -e "${autoconfl_file}" ]; then
	rm -f "${autoconfl_file}"
fi

# 2012-04-23 (remove in 12 months)
# fixup wrong disabled USE deps matching
tmp_path=$(mktemp)
if [ -z "${tmp_path}" ]; then
	exit 1
fi
cat << EOF >> "${tmp_path}"
--- a/usr/lib/entropy/lib/entropy/db/skel.py
+++ b/usr/lib/entropy/lib/entropy/db/skel.py
@@ -4651,7 +4651,9 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
             else:
                 # for compatibility reasons with older Entropy versions,
                 # use flags not in pkguse are considered disabled.
-                pkguse.add(use)
+                en_use = use[1:]
+                if en_use not in pkguse:
+                    pkguse.add(use)
             disabled_use.add(use)
 
         enabled_not_satisfied = enabled_use - pkguse
EOF

( cd "${ROOT}/" && patch -N -r - -p1 < "${tmp_path}" 2>&1 > /dev/null ) # ignore any outcome
rm -f "${tmp_path}"

exit 0

### CUT HERE ###