summaryrefslogtreecommitdiffstats
path: root/mashrepo
blob: 08ec0ff117c4a638179a6821fbe04ad0c668ea81 (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
#!/bin/bash

function mashit()
{
echo "Mashing $2 $3"

mash=$1
where=$2/remi/$3
options="-type f -print"
refdate=$2/safe/.mashdate.$3
if [ -f $refdate ]
then	options="-newer $refdate $options"
else    touch -d 19950101 $refdate
fi

[ $debug = 1 ] && echo "   find $where -name \*rpm $options"

find $where -name \*rpm $options | while read rpm
do
  name=$(rpm -qp --qf "%{NAME}" $rpm)
  copy=${rpm/remi/safe}
  if [ -f $copy ]
  then
    if [ $debug = 1 ]
    then	echo "  $rpm (ok)"
    fi
  elif grep -q "^${name}\$" $mash
  then
    ln $rpm $copy && echo "+ $rpm"
  else
    if [ $debug = 1 ]
    then	echo "  $rpm (ignored)"
    fi
  fi
  [ $rpm -nt $refdate ] && touch -r $rpm $refdate
done
}

function mash54() {
  echo "Mashing php54 $2 $3"
  for rpm in $1/remi/$2/php-*5.4*$3.rpm; do
    copy=${rpm/remi/php54}
    if [ -f $copy ]
    then
      if [ $debug = 1 ]
      then	echo "  $rpm (ok)"
      fi
    else
      ln $rpm $copy && echo "+ $rpm"
    fi
  done
}

debug=0
for opt in $*
do
	case "$opt" in
		-d)	debug=1
			;;
		*)	echo "unkown option $opt"
			exit 1
			;;
	esac
done
export debug


mash54 enterprise/7 x86_64 x86_64
mash54 enterprise/6 i386   i686
mash54 enterprise/6 x86_64 x86_64
mashit mashinfo.el7 enterprise/7 x86_64
mashit mashinfo.el6 enterprise/6 i386
mashit mashinfo.el6 enterprise/6 x86_64
echo Done