You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
375 B
18 lines
375 B
3 years ago
|
#!/bin/sh
|
||
|
mkdir -p ~/RPM/SOURCES
|
||
|
mkdir -p ~/RPM/SPECS
|
||
|
for i in $(ls *.spec)
|
||
|
do
|
||
|
v=$(cat $i | grep Version | cut -c 9- | sed 's/ *//g')
|
||
|
n=$(basename -s .spec $i)
|
||
|
d=$n-$v
|
||
|
if [ -d $n ]; then
|
||
|
cp -fr $n $d
|
||
|
tar -cvf $d.tar $d
|
||
|
mv -f $d.tar ~/RPM/SOURCES/
|
||
|
cp -f $i ~/RPM/SPECS/
|
||
|
rm -rf $d
|
||
|
fi
|
||
|
rpm -ba ~/RPM/SPECS/$i
|
||
|
done
|