summaryrefslogtreecommitdiffstats
path: root/mashrepo
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-12-18 10:33:16 +0100
committerRemi Collet <fedora@famillecollet.com>2015-12-18 10:33:16 +0100
commit4638f990ceb4b314ce15ddfcfeeb638432273c95 (patch)
tree8acbc0379ef0919d13c85483dd3e5a517b6f8473 /mashrepo
parentdaef766c2a953e4db3e9a69cbff8bf7a67788f85 (diff)
initial import
Diffstat (limited to 'mashrepo')
-rwxr-xr-xmashrepo55
1 files changed, 55 insertions, 0 deletions
diff --git a/mashrepo b/mashrepo
new file mode 100755
index 00000000..57fc558a
--- /dev/null
+++ b/mashrepo
@@ -0,0 +1,55 @@
+#!/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
+}
+
+debug=0
+for opt in $*
+do
+ case "$opt" in
+ -d) debug=1
+ ;;
+ *) echo "unkown option $opt"
+ exit 1
+ ;;
+ esac
+done
+export debug
+
+mashit mashinfo.el7 enterprise/7 x86_64
+mashit mashinfo.el6 enterprise/6 i386
+mashit mashinfo.el6 enterprise/6 x86_64
+echo Done