5 Script to re-build entire archive from one release for another.
7 Often usecase -- rebuilding for a new Ubuntu brew every 6 months.
12 nd_rebuildarchive old_release new_release
16 nd_rebuildarchive natty oneiric
27 # some NeuroDebian variables hardcoded in for now
28 repo_server=neuro.debian.net
32 repo_distspath=$repo_toppath/$repo_urlpath/dists
36 list_file="$old_dist-$dist.list"
37 summary_file="$old_dist-$dist.summary"
39 [ -e "$list_file" ] || \
40 ssh -l $repo_user $repo_server cat $repo_distspath/$old_dist/*/source/Sources.gz \
41 | zgrep -e '^\(Package:\|Directory:\| [a-z0-9]\{32\} [0-9]* \S*.dsc$\)' \
42 | sed -e 's,.* \([^ ][^ ]*\)$,\1,g' | tr '\n' ' '| sed -e 's,\.dsc,.dsc\n,g' \
47 dist_id=$(nd_querycfg "release backport ids" "$dist")
49 | while read name topdir dscfile; do
50 echo "I: Forwardporting for $dist_id $dscfile"
53 || dget -d http://$repo_server/$repo_urlpath/$topdir/$dscfile || {
54 echo -e "E: $dscfile\t\tFAILED to fetch" >> $summary_file
59 bpdscfile=$(/home/neurodebian/neurodebian/tools/backport-dsc \
60 --target-distribution "$dist" \
61 --no-maintainer-update \
62 --version-prefix "+" \
63 --version-suffix "$dist_id" \
64 "$dscfile" | tail -n1 | sed -e 's/^.* //g')
66 echo " I: Building backported dscfile: $bpdscfile"
68 $CMD sudo nd_build $family $dist $bpdscfile && {
69 echo -e "I: $bpdscfile\t\tOk" >> $summary_file
71 echo -e "E: $bpdscfile\t\tFAILED to build" >> $summary_file
77 # Then following steps were done manually ATM and here kept as notes
78 # but version checking should altogether go into nd_backportdsc I guess
79 # or at least in the logic above
81 # upload all not yet uploaded
82 for f in *~nd*.changes; do uf=${f//.changes/.neurodn.upload}; [ -e $uf ] && continue; debsign $f; dput neurodn $f; done
84 # on the neuro.debian.net side
85 # filtered out incoming from pkgs with versions in official distribution
86 for c in *changes; do pkg_ver=`grep '\.deb$' $c | head -1 | sed -e 's,.* \([^_]*\)_\(.*\)_.*,\1 \2,g'`; echo $pkg_ver; done | uniq | while read p v; do uver=$(whohas -D Ubuntu --strict $p | grep "/$dist/" | awk '{print $3;}'); dpkg --compare-versions $v lt "$uver" && echo $c $p $v $uver; done 2>&1 | tee up-to-date-list.txt
88 # and moved corresponding changelogs away
89 mv `awk '{print $1,$2;}' up-to-date-list.txt | while read p v; do grep -l "${p}_${v}" *changes; done | sort | uniq` NOT_UPLOADED/
91 # processed the incoming
92 /home/neurodebian/reprepro/nd_processincoming.sh
94 # locally now updated the cows
95 sudo nd_updatedist nd+ubuntu $dist
97 # And build which previously failed, most probably due to unsatisfied dependencies
98 # and possibly failure with outdated versions of 3rd party modules
99 #grep -v OLD summary.build | grep FAILED | sed -e 's,_\(i386\|amd64\).build.*,,g' | sort | uniq | while read p; do sudo nd_build nd+ubuntu precise $p.dsc; done
100 grep -v -e OLD -e networkx summary.build | grep FAILED | sed -e 's,_\(i386\|amd64\).build.*,,g' | sort | uniq | while read p; do sudo nd_build nd+ubuntu $dist $p.dsc; done