summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20120711/3b0f3073/attachment-0001.bin
blob: a28699d26f3450419052942e15f306927ecc1025 (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
#!/bin/bash

LIST=slash-bin.txt
if [ -n "$1" -a -e "$1" ]; then
  LIST="$1"
fi

echo "Using file: $LIST" >&2

IFS='
'

OP=""
for pkg in $(cat $LIST | cut -d':' -f1 | sort -u); do
  regexp="^/usr($(cat $LIST | grep "^$pkg:" | cut -d':' -f2 | xargs | sed 's/ /|/g'))\$"
  file=$(echo $line | cut -d':' -f2)

  echo -n "Checking for conflicts for package $pkg..." >&2
  conflicts="$(urpmf "$regexp")"
  if [ -n "$conflicts" ]; then
    otherconflicts="$(echo "$conflicts" | grep -v "^$pkg:")"
    if [ -z "$otherconflicts" ]; then
      echo " self" >&2
      OP="${OP}$pkg:self\n"
    else
      otherpkgs=$(echo "$otherconflicts" | cut -d':' -f1 | sort -u | xargs)
      echo " $otherpkgs" >&2
      OP="${OP}$pkg:$otherpkgs\n"
    fi
  else
    echo " none" >&2
  fi
done

echo -e "$OP"