Compare commits
No commits in common. "cd4296832d4c62b23c3a79cc375ee90a75b56bc9" and "2c2d5037ee4a8c3dcc12d2707a70b099f3afcdb7" have entirely different histories.
cd4296832d
...
2c2d5037ee
@ -1,7 +1,7 @@
|
||||
%global gem_name sprockets-rails
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 3.4.2
|
||||
Release: 2
|
||||
Version: 3.2.1
|
||||
Release: 1
|
||||
Summary: Sprockets Rails integration
|
||||
License: MIT
|
||||
URL: https://github.com/rails/sprockets-rails
|
||||
@ -36,7 +36,7 @@ cp -a .%{gem_dir}/* \
|
||||
%check
|
||||
pushd .%{gem_instdir}
|
||||
ln -s %{_builddir}/%{gem_name}-%{version}/test .
|
||||
taskset -c 0 ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
|
||||
ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
|
||||
popd
|
||||
|
||||
%files
|
||||
@ -51,11 +51,5 @@ popd
|
||||
%doc %{gem_instdir}/README.md
|
||||
|
||||
%changelog
|
||||
* Thu Aug 31 2023 Ge Wang <wang__ge@126.com> - 3.4.2-2
|
||||
- fix probabilistic failure caused by resource competition
|
||||
|
||||
* Thu Mar 24 2022 liyanan <liyanan32@huawei.com> - 3.4.2-1
|
||||
- update to 3.4.2
|
||||
|
||||
* Fri Aug 21 2020 shenleizhao <shenleizhao@huawei.com> - 3.2.1-1
|
||||
- package init
|
||||
|
||||
151
spec_prep.sh
Normal file
151
spec_prep.sh
Normal file
@ -0,0 +1,151 @@
|
||||
changelog_update(){
|
||||
# changelog replace
|
||||
sed -i '/^%changelog/,$d' $file
|
||||
date=`date +"%a %b %_d %Y"`
|
||||
name='yanan li'
|
||||
email='liyanan032@huawei.com'
|
||||
changelog="%changelog\n* $date $name <$email> - ${version}-$release\n- Package init"
|
||||
echo -e $changelog >> $file #sed -n '/^%changelog/,$p' $file
|
||||
echo "Hint: changelog updated"
|
||||
}
|
||||
|
||||
|
||||
single_merge(){
|
||||
awk -v key="$1" -v max_len=80 -F : \
|
||||
'BEGIN {\
|
||||
tmp="";\
|
||||
} \
|
||||
{\
|
||||
if( key == $1 ){\
|
||||
if( NF > 2){\
|
||||
oofs=FS;FS="#";
|
||||
bbb=sub(/[[:alnum:] ]+:/,"",$0);\
|
||||
aaa=$bbb;
|
||||
FS=oofs;
|
||||
}\
|
||||
else{\
|
||||
$1=""; \
|
||||
aaa=$0;\
|
||||
}\
|
||||
|
||||
tmp1=tmp aaa
|
||||
gsub(" +"," ",tmp1);\
|
||||
#print FNR tmp1
|
||||
if(length(tmp1) > max_len){\
|
||||
gsub(" +"," ",tmp);\
|
||||
printf "%-20s%s\n",key ":",tmp;\
|
||||
tmp="";\
|
||||
}\
|
||||
tmp=tmp aaa;\
|
||||
}\
|
||||
else {\
|
||||
if( length(tmp) != 0){\
|
||||
gsub(" +"," ",tmp);\
|
||||
printf "%-20s%s\n",key ":",tmp;\
|
||||
tmp="";\
|
||||
}\
|
||||
print $0;\
|
||||
}\
|
||||
|
||||
}'
|
||||
}
|
||||
|
||||
headers_merge(){
|
||||
cat $file | single_merge "BuildRequires" | single_merge "Requires" > .$file
|
||||
mv -f .$file $file
|
||||
echo "Hint: Tags merged"
|
||||
}
|
||||
|
||||
delete_comment(){
|
||||
sed -i '/^#.*/d' $file
|
||||
echo "Hint: commentline deleted"
|
||||
}
|
||||
delete_blank(){
|
||||
sed -i 's/[[:blank:]]\{1,\}$//g' $file
|
||||
echo "Hint: tail-blank deleted "
|
||||
}
|
||||
|
||||
insert_enter(){
|
||||
sed -i '/^$/d' $file
|
||||
sed -i '/^%package.*/i\ ' $file
|
||||
sed -i '/^%pre.*/i\ ' $file
|
||||
sed -i '/^%post.*/i\ ' $file
|
||||
sed -i '/^%build.*/i\ ' $file
|
||||
sed -i '/^%install.*/i\ ' $file
|
||||
sed -i '/^%check*/i\ ' $file
|
||||
sed -i '/^%files.*/i\ ' $file
|
||||
sed -i '/^%changelog.*/i\ ' $file
|
||||
echo "Hint: insert newline before stages"
|
||||
}
|
||||
|
||||
increase_release(){
|
||||
# release +1
|
||||
sed -i "/^Release.*$/s/${release_oo}/${release}/" $file
|
||||
# delete Group Tags
|
||||
sed -i '/^Group.*/d' $file
|
||||
echo "Hint: release ++"
|
||||
}
|
||||
|
||||
header_align() {
|
||||
awk '{
|
||||
if ($0 ~ /^[A-Z][[:alnum:]]*: / ) {
|
||||
va="";
|
||||
for(i=2;i<=NF;i++){ va=va" "$i};
|
||||
printf("%-20s%s\n",$1,va);
|
||||
}
|
||||
else print $0;
|
||||
}' $file > .$file
|
||||
mv -f .$file $file
|
||||
echo "Hint: header_align done"
|
||||
}
|
||||
|
||||
#################### main
|
||||
main(){
|
||||
|
||||
file_o=$1
|
||||
file=${file_o}.cp
|
||||
cp -f $file_o $file
|
||||
|
||||
# got verison release
|
||||
version=`cat $file |grep '^Version' | awk '{print $2}'`
|
||||
release_oo=`cat $file |grep '^Release' | awk '{print $2}'`
|
||||
release_o=`echo $release_oo | sed 's/%{.*}//'`
|
||||
release=$((release_o+1))
|
||||
|
||||
#marcos_expand keep this bug ...
|
||||
delete_comment
|
||||
changelog_update
|
||||
increase_release
|
||||
header_align
|
||||
headers_merge
|
||||
insert_enter
|
||||
delete_blank
|
||||
|
||||
#let's play
|
||||
read -p "Hint: exec vimdiff $file $file_o ? enter [yes/no]: " ans
|
||||
vimdiff $file $file_o
|
||||
read -p "Hint: do mv -b -f $file $file_o ? enter [yes/no]: " ans
|
||||
if [[ $ans =~ [Yy]([Ee][Ss])? ]];then
|
||||
mv -b -f $file $file_o
|
||||
echo "Hint: $file_o updated"
|
||||
else
|
||||
rm -f $file
|
||||
echo "Hint: $file deleted. Not my bad :P "
|
||||
fi
|
||||
echo "From SONG: Enjoy your spec working !"
|
||||
}
|
||||
|
||||
banner(){
|
||||
cat <<eof
|
||||
+-+-+-+-+-+-+-+-+-+
|
||||
|s|p|e|c|_|p|r|e|p|
|
||||
+-+-+-+-+-+-+-+-+-+
|
||||
eof
|
||||
}
|
||||
if [[ $# != 1 ]];then
|
||||
banner
|
||||
echo "USAGE: $(basename $0) SPECFILE"
|
||||
exit 2
|
||||
fi
|
||||
banner
|
||||
main $1
|
||||
BIN
sprockets-rails-3.2.1-tests.tgz
Normal file
BIN
sprockets-rails-3.2.1-tests.tgz
Normal file
Binary file not shown.
BIN
sprockets-rails-3.2.1.gem
Normal file
BIN
sprockets-rails-3.2.1.gem
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user