#!/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" elif [[ "^${name}" =~ "^php74" ]] then ln $rpm $copy && echo "+ $rpm" elif [[ "^${name}" =~ "^php80" ]] then ln $rpm $copy && echo "+ $rpm" elif [[ "^${name}" =~ "^php81" ]] then ln $rpm $copy && echo "+ $rpm" elif [[ "^${name}" =~ "^php82" ]] then ln $rpm $copy && echo "+ $rpm" elif [[ "^${name}" =~ "^php83" ]] then ln $rpm $copy && echo "+ $rpm" elif [[ "^${name}" =~ "^php84" ]] 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 $1/remi/$2/uwsgi-*5.4*$3.rpm $1/remi/$2/unit-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 } function mashgd() { echo "Mashing GD in Fedora repo" for rpm in fedora/*/remi/i386/gd*; do copy=${rpm/i386/x86_64} 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 mashgd #mash54 enterprise/7 x86_64 x86_64 #mash54 enterprise/6 i386 i686 #mash54 enterprise/6 x86_64 x86_64 mashit mashinfo.el10 enterprise/10 x86_64 mashit mashinfo.el10 enterprise/10 aarch64 mashit mashinfo.el9 enterprise/9 x86_64 mashit mashinfo.el9 enterprise/9 aarch64 mashit mashinfo.el8 enterprise/8 x86_64 mashit mashinfo.el8 enterprise/8 aarch64 #mashit mashinfo.el7 enterprise/7 x86_64 #mashit mashinfo.el6 enterprise/6 i386 #mashit mashinfo.el6 enterprise/6 x86_64 echo Done