diff options
author | Olivier Blin <blino@mageia.org> | 2013-05-28 21:57:33 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2013-05-28 21:57:33 +0000 |
commit | 784843575c81d95112bc0e2bfa0acb3174c1f45d (patch) | |
tree | 17d0e36b83ba1a141d33d9909fcb027bc535f731 /rebuild_perl_iurt | |
parent | 00ee35598494858f8d64d9a17b3fa32206fcd27f (diff) | |
download | iurt-784843575c81d95112bc0e2bfa0acb3174c1f45d.tar iurt-784843575c81d95112bc0e2bfa0acb3174c1f45d.tar.gz iurt-784843575c81d95112bc0e2bfa0acb3174c1f45d.tar.bz2 iurt-784843575c81d95112bc0e2bfa0acb3174c1f45d.tar.xz iurt-784843575c81d95112bc0e2bfa0acb3174c1f45d.zip |
use here-document (suggested by tv) with quotes to simplify
Diffstat (limited to 'rebuild_perl_iurt')
-rwxr-xr-x | rebuild_perl_iurt | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/rebuild_perl_iurt b/rebuild_perl_iurt index e7b65dd..384c847 100755 --- a/rebuild_perl_iurt +++ b/rebuild_perl_iurt @@ -17,28 +17,29 @@ if [ -z "$perlchroot" ]; then perlchroot=$(echo | iurt --shell -r $distro $arch 2>&1 | perl -lne '/dumping to a chrooted shell into (.*)/ and print $1') fi -echo "\ -set -x; \ -set -e; \ -skip() { echo \$*; }; \ -sudo urpmi.update -a; \ -sudo urpmi mgarepo; \ -mkdir -p ~/.mgarepo; \ -perl -pe 's/svn\+ssh:/svn:/' /etc/mgarepo.conf > ~/.mgarepo/config; \ -perlapis_path=\$HOME/perlapis.txt; \ -[ -e \$perlapis_path ] || rpm -q --provides perl-base | grep ^perlapi > \$perlapis_path; \ -for p in perl perl-List-MoreUtils perl-URPM perl-Locale-gettext; do mgarepo getsrpm -l -n \$p; done; \ -rpm -ivh *.src.rpm; \ -sudo urpmi --auto --no-verify-rpm rpmbuild/SPECS/*.spec; \ -rpmbuild -ba rpmbuild/SPECS/perl.spec; \ -sudo rpm -Uvh --nodeps --force \$(ls rpmbuild/RPMS/*/perl-*.rpm | grep -v debuginfo); \ -PERL5LIB=\$(rpm -ql perl-List-MoreUtils | perl -ne 's!/List/MoreUtils.pm!! && print') LIST_MOREUTILS_PP=1 rpmbuild -ba rpmbuild/SPECS/perl-List-MoreUtils.spec; \ -sudo rpm -Uvh --force rpmbuild/RPMS/*/perl-List-MoreUtils-*.rpm; \ -rpmbuild -ba rpmbuild/SPECS/perl-URPM.spec; \ -rpmbuild -ba rpmbuild/SPECS/perl-Locale-gettext.spec; \ -sudo rpm -Uvh --force rpmbuild/RPMS/*/perl-URPM-*.rpm rpmbuild/RPMS/*/perl-Locale-gettext-*.rpm; \ -updatepkgs() { spec=\$1; toupdate=; while read line; do set -- \$line; name=\$1; path=\$2; rpm -q \$name --quiet && toupdate=\"\$toupdate \$path\"; done < <(rpm -q --specfile \$spec --qf '%{name} rpmbuild/RPMS/%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\n' | egrep -v -- '-(debuginfo|__restore__)-'); [ -n \"\$toupdate\" ] && sudo rpm -Uvh --force \$toupdate; }; \ -rebuild() { p=\$1; mgarepo getsrpm -l -n \$p; rpm -ivh \@*:\$p-*.src.rpm; spec=rpmbuild/SPECS/\$p.spec; sudo urpmi --auto --no-verify-rpm \$spec; rpmbuild -ba \$spec; updatepkgs \$spec; }; \ -pkgs=\$(LC_ALL=C rpm -q --qf '%{SOURCERPM}\n' --whatrequires \$(cat \$perlapis_path) | perl -lne '/^(\S+)-[^-]+-[^-]+\$/ and print \$1' | uniq); for p in \$pkgs; do rebuild \$p; done; \ -" | iurt --shell -r $distro $arch --use-old-chroot $perlchroot --chrooted-urpmi -m $media -- $repository +iurt --shell -r $distro $arch --use-old-chroot $perlchroot --chrooted-urpmi -m $media -- $repository <<"EOF" +set -x +set -e +skip() { echo $*; } +sudo urpmi.update -a +sudo urpmi mgarepo +mkdir -p ~/.mgarepo +perl -pe 's/svn\+ssh:/svn:/' /etc/mgarepo.conf > ~/.mgarepo/config +perlapis_path=$HOME/perlapis.txt +[ -e $perlapis_path ] || rpm -q --provides perl-base | grep ^perlapi > $perlapis_path +for p in perl perl-List-MoreUtils perl-URPM perl-Locale-gettext; do mgarepo getsrpm -l -n $p; done +rpm -ivh *.src.rpm +sudo urpmi --auto --no-verify-rpm rpmbuild/SPECS/*.spec +rpmbuild -ba rpmbuild/SPECS/perl.spec +sudo rpm -Uvh --nodeps --force $(ls rpmbuild/RPMS/*/perl-*.rpm | grep -v debuginfo) +PERL5LIB=$(rpm -ql perl-List-MoreUtils | perl -ne 's!/List/MoreUtils.pm!! && print') LIST_MOREUTILS_PP=1 rpmbuild -ba rpmbuild/SPECS/perl-List-MoreUtils.spec +sudo rpm -Uvh --force rpmbuild/RPMS/*/perl-List-MoreUtils-*.rpm +rpmbuild -ba rpmbuild/SPECS/perl-URPM.spec +rpmbuild -ba rpmbuild/SPECS/perl-Locale-gettext.spec +sudo rpm -Uvh --force rpmbuild/RPMS/*/perl-URPM-*.rpm rpmbuild/RPMS/*/perl-Locale-gettext-*.rpm +updatepkgs() { spec=$1; toupdate=; while read line; do set -- $line; name=$1; path=$2; rpm -q $name --quiet && toupdate="$toupdate $path"; done < <(rpm -q --specfile $spec --qf '%{name} rpmbuild/RPMS/%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\n' | egrep -v -- '-(debuginfo|__restore__)-'); [ -n "$toupdate" ] && sudo rpm -Uvh --force $toupdate; } +rebuild() { p=$1; mgarepo getsrpm -l -n $p; rpm -ivh @*:$p-*.src.rpm; spec=rpmbuild/SPECS/$p.spec; sudo urpmi --auto --no-verify-rpm $spec; rpmbuild -ba $spec; updatepkgs $spec; } +pkgs=$(LC_ALL=C rpm -q --qf '%{SOURCERPM}\n' --whatrequires $(cat $perlapis_path) | perl -lne '/^(\S+)-[^-]+-[^-]+$/ and print $1' | uniq); for p in $pkgs; do rebuild $p; done +EOF + echo $perlchroot |