summaryrefslogtreecommitdiffstats
path: root/makelist
blob: e8cd8d9d2032d7b4972bc4c6275b424eff1f0f47 (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
#!/bin/bash

# Warning: make sure you don't have Adobe linux repository enabled.
# That stupid sh*t has some of the needed glibc libraries in it!
# Can cause problems.

set -e

function makelist {
	if [[ -z "$@" ]]
	then
		echo "syntax: makelist PACKAGE [PACKAGE ...]"
		echo "	e.g: makelist cpp gcc gcc-c++"
		echo "	e.g: makelist fpc"
		exit
	fi

	HASH="/tmp/.makelist_HASH"
	touch $HASH

	echo $@ | sed "s/ /\n/g" >> list
	cat list | sort | uniq | sponge list

	yum deplist `cat list` > deps
	cat deps | grep provider | awk {'print $2'} | cut -d'.' -f1 >> list
	cat list | sort | uniq | sponge list
	if [ `cat list | md5sum | awk {'print $1'}` == "`cat $HASH 2> /dev/null`" ]
	then
		exit
	else
		cat list | md5sum | awk {'print $1'} > $HASH
		makelist `cat list`
	fi
}

makelist $@