Исправление для пакетов без папки

master
Artem Proskurnev 3 years ago
parent 402e78ad97
commit 16088f6e6d
  1. 23
      build.sh

@ -1,4 +1,9 @@
#!/bin/sh
mkdir -p ~/RPM/SOURCES
mkdir -p ~/RPM/SPECS
mkdir -p ~/RPM/BUILD
mkdir -p ~/RPM/RPMS
mkdir -p ~/RPM/SRPMS
rm -rf ~/RPM/BUILD/*
rm -rf ~/RPM/RPMS/*
rm -rf ~/RPM/SOURCES/*
@ -6,11 +11,15 @@ rm -rf ~/RPM/SPECS/*
rm -rf ~/RPM/SRPMS/*
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
tar -cvf $d.tar $d
mv -f $d.tar ~/RPM/SOURCES/
cp -f $i ~/RPM/SPECS/
rpm -ba ~/RPM/SPECS/$i
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/
rm -rf $d
fi
cp -f $i ~/RPM/SPECS/
rpm -ba ~/RPM/SPECS/$i
done

Loading…
Cancel
Save