This file is indexed.

/usr/bin/nd_rebuildarchive is in neurodebian-dev 0.37.6.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
#!/bin/bash

if [ -z "$1" ]; then
cat << EOT
Script to re-build entire archive from one release for another.

Often usecase -- rebuilding for a new Ubuntu brew every 6 months.

Synopsis
--------

  nd_rebuildarchive old_release new_release

e.g.
  
  nd_rebuildarchive natty oneiric

EOT
exit 1	
fi

set -eu

old_dist=$1
dist=$2

# some NeuroDebian variables hardcoded in for now
repo_server=neuro.debian.net
repo_user=neurodebian
repo_toppath=www
repo_urlpath=debian
repo_distspath=$repo_toppath/$repo_urlpath/dists

family=nd+ubuntu

list_file="$old_dist-$dist.list"
summary_file="$old_dist-$dist.summary"

[ -e "$list_file" ] || \
    ssh -l $repo_user $repo_server cat $repo_distspath/$old_dist/*/source/Sources.gz \
    | zgrep -e '^\(Package:\|Directory:\| [a-z0-9]\{32\} [0-9]* \S*.dsc$\)' \
    | sed -e 's,.* \([^ ][^ ]*\)$,\1,g' | tr '\n' ' '| sed -e 's,\.dsc,.dsc\n,g' \
    > "$list_file"
   
CMD=
#echo
dist_id=$(nd_querycfg "release backport ids" "$dist")
cat $list_file \
| while read name topdir dscfile; do
    echo "I: Forwardporting for $dist_id $dscfile"

    [ -e $dscfile ]  \
	|| dget -d http://$repo_server/$repo_urlpath/$topdir/$dscfile || { 
	echo -e "E: $dscfile\t\tFAILED to fetch" >> $summary_file
	continue
    }

   # TODO -- we need to strip intermediate versions to avoid this horrible
   # ./pool/main/s/stabilitycalc/stabilitycalc_0.1-1~nd11.04+1+nd11.10+1+nd12.04+1+nd12.10+1+nd13.04+1+nd13.10+1+nd14.04+1+nd14.10+1+nd15.04+1.debian.tar.xz
   # which should become may be
   # ./pool/main/s/stabilitycalc/stabilitycalc_0.1-1~nd11.04+nd15.04+1.debian.tar.xz
    bpdscfile=$(/home/neurodebian/neurodebian/tools/backport-dsc \
        --target-distribution "$dist" \
	--no-maintainer-update \
        --version-prefix "+" \
        --version-suffix "$dist_id" \
        "$dscfile" | tail -n1 | sed -e 's/^.* //g')

    echo " I: Building backported dscfile: $bpdscfile"

    $CMD sudo nd_build $family $dist $bpdscfile && {
	echo -e "I: $bpdscfile\t\tOk" >> $summary_file
    } || {
 	echo -e "E: $bpdscfile\t\tFAILED to build" >> $summary_file
    }
done

exit 0

# Then following steps were done manually ATM and here kept as notes
# but version checking should altogether go into nd_backportdsc I guess
# or at least in the logic above

# upload all not yet uploaded
for f in *~nd*.changes; do uf=${f//.changes/.neurodn.upload}; [ -e $uf ] && continue;  debsign $f; dput neurodn $f; done 

# on the neuro.debian.net side
# filtered out incoming from pkgs with versions in official distribution
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

# and moved corresponding changelogs away
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/

# processed the incoming
/home/neurodebian/reprepro/nd_processincoming.sh

# locally now updated the cows
sudo nd_updatedist nd+ubuntu $dist

# And build which previously failed, most probably due to unsatisfied dependencies
# and possibly failure with outdated versions of 3rd party modules
#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
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