This file is indexed.

/usr/bin/dimstrap is in xbuilder 1.0.

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
#!/bin/sh 

timestamp=`date +%Y%m%d-%H%M`
configfile=/etc/dimstrap.cfg


if [ -f "$configfile" ]; then 
  . "$configfile"
else
  echo "config in $configfile not found - exiting"
  exit 1
fi

if [ "$1" = "" ]; then
  packagefile=$basepath/../pkgorder
else
  package=$1
fi

mkdir -p $basepath/build $basepath/logs 
cd $basepath/build


# upload to repo and run processincoming. remove old source first in case of rebuilds.
# Removing src removes builds for all arches, not just host. Proper buildd needed...
# The remote distro needs to be set up. Make sure above key matches
# local dupload config needs to match repopath and machine too
upload ()
{
  echo "Uploading ${package}_${version} to ${uploadname}"
  dupload -f -t ${uploadname} ${package}_${version}_${arch}.changes > /dev/null 2>&1
  ssh  ${uploadmachine} reprepro -b ${uploadrepopath} processincoming ${incomingrule} || \
  ( ssh  ${uploadmachine} reprepro -b ${uploadrepopath} removesrc ${suitename} $package && \
    ssh  ${uploadmachine} reprepro -b ${uploadrepopath} processincoming ${incomingrule} )  
}

getrepoversion ()
{
#get latest version of Sources files and find current version of package
repoURL=http://${uploadmachine}/${repourlpath}
for component in $components; do
( cd /tmp; wget -N -q ${repoURL}/dists/${suitename}/${component}/source/Sources.bz2 && \
  mv /tmp/Sources.bz2 ${suitename}_${component}_source.bz2 )
done
rm -f /tmp/reposource
for component in $components; do
  bzcat /tmp/${suitename}_${component}_source.bz2 >> /tmp/reposource
done
cat /tmp/reposource | grep-dctrl -P -X -s Version $package | awk '{ print $2 }' | uniq
}


if [ "$package" = "" ] ; then
  packagelist=$packagefile
else
  echo $package > /tmp/pkgfile
  packagelist=/tmp/pkgfile
fi  

#use FD5 instead of stdin to stop ssh stealing the rest of the entries
while read package profile <&5; do
  distro_version=`rmadison -u $distro -s $suite -b source $package | grep source | awk '{ print $3 }' | uniq`
  repo_version=$(getrepoversion)
  if dpkg --compare-versions $repo_version gt $distro_version > /dev/null 2>&1; then 
    epochversion=$repo_version
  else
    echo "Picked version $distro_version from bootstrap repository." 
    epochversion=$distro_version
  fi
  version=`echo $epochversion | cut -d: -f2`
  
  if [ "$version" = "" ]; then
    echo "No such package:  ${package}"
  else
    sbuild_options="--host=$arch  --verbose --nolog -d $suite -c $chroot -k${signkey} "
    echo -n "Building ${package}_${epochversion} " 
    if [ ! "$profile" = "" ] ; then 
      echo -n "(Profile:$profile) "; 
      sbuild_options="$sbuild_options --profile $profile "
    fi
    echo -n "in logs/${package}_${epochversion}-${suite}-${arch}-${timestamp}.log :"
    
    if sbuild $sbuild_options ${package}_${epochversion} > ../logs/${package}_${epochversion}-${suite}-${arch}-${timestamp}.log 2>&1; then
      echo "OK" 
      upload
    else
      echo "Build of $package_$version failed"
      exit 1
    fi
  fi  
${basepath}/../buildd-synclogs > /dev/null 2>&1
done  5< $packagelist