This file is indexed.

/usr/bin/piuparts_wrapper is in jenkins-debian-glue 0.18.4.

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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash

set -e
set -u

# make sure we have the sbin directories in our PATH to find piuparts ootb
PATH="${PATH}:/sbin:/usr/local/sbin:/usr/sbin"

if [ "$#" -lt 1 ] ; then
  echo "Usage: $0 <debian_package(s).deb>" >&2
  exit 1
fi

if [ -z "${distribution:-}" ] ; then
  # default to the currently running distribution to avoid hardcoding
  # a distribution which might not be supported by the running system
  distribution=$(lsb_release --short --codename 2>/dev/null)
  [ -n "${distribution}" ] || distribution="sid"  # fallback to "sid" iff lsb_release fails
  echo "*** distribution variable is unset, using distribution $distribution ***"
fi

if [ -z "${architecture:-}" ] ; then
  architecture=$(dpkg --print-architecture)
  echo "*** architecture variable is unset, using system architecture [$architecture] ***"
fi

if [ -n "${SCRIPTSDIR:-}" ] ; then
  echo "*** SCRIPTSDIR variable is set to $SCRIPTSDIR - using for piuparts run ***"
  scriptsdir="$SCRIPTSDIR"
else
  scriptsdir_path="/etc/piuparts/scripts/"
  if [ -d "${scriptsdir_path}" ]; then
    echo "*** SCRIPTSDIR variable is NOT set - using default [/etc/piuparts/scripts/] for piuparts run ***"
    scriptsdir="${scriptsdir_path}"
  else
    # Some old piuparts do not ship a scripts dir
    scriptsdir=""
  fi
fi

if [ -n "${PIUPARTS_TMPDIR:-}" ] ; then
  echo "*** PIUPARTS_TMPDIR is set to $PIUPARTS_TMPDIR - using for piuparts run ***"
  piuparts_tmpdir="$PIUPARTS_TMPDIR"
fi

create_base_tgz() {
  [ -r /var/cache/pbuilder/base-${distribution}-${architecture}.tgz ] && return 0

  if [ -n "${MIRROR:-}" ] ; then
    echo "*** MIRROR variable is set [$MIRROR], using it ***"
  else
    if lsb_release --id 2>/dev/null | grep -q Ubuntu ; then
      MIRROR='http://archive.ubuntu.com/ubuntu'
    else
      MIRROR='http://http.debian.net/debian'
    fi
    echo "*** Using mirror $MIRROR ***"
  fi

  if [ -n "${COMPONENTS:-}" ] ; then
    echo "*** COMPONENTS is set [$COMPONENTS], using for debootstrapping ***"
    components="$COMPONENTS"
  elif lsb_release --id 2>/dev/null | grep -q Ubuntu ; then
    components='main,universe,restricted,multiverse'
    echo "*** Ubuntu detected, using components $components ***"
  else
    components='main,contrib,non-free'
    echo "*** COMPONENTS is unset and looks like Debian - therefore using components $components ***"
  fi

  tmpdir=$(mktemp -d)

  if [ -n "${DEBOOTSTRAP_OPTIONS:-}" ] ; then
    echo "*** DEBOOTSTRAP_OPTIONS is set [$DEBOOTSTRAP_OPTIONS], using for debootstrapping ***"
  fi

  debootstrap --variant=minbase \
              --components="$components" \
              --arch="$architecture" \
              ${DEBOOTSTRAP_OPTIONS:-} \
              "$distribution" \
              "$tmpdir" \
              "$MIRROR"

  (
    cd "$tmpdir"
    tar acf /var/cache/pbuilder/base-${distribution}-${architecture}.tgz *
    rm -rf ./*
  )
}

if [ -n "${SKIP_BASE_TGZ:-}" ] ; then
  echo "*** SKIP_BASE_TGZ is set, not using building/using /var/cache/pbuilder/base-${distribution}-${architecture}.tgz ***"
else
  create_base_tgz
  basetgz="--basetgz=/var/cache/pbuilder/base-${distribution}-${architecture}.tgz"
fi

# option not available with piuparts 0.38
if piuparts --help 2>/dev/null | grep -q -- '--warn-on-leftovers-after-purge' ; then
  warn_on_leftovers_after_purge_option="--warn-on-leftovers-after-purge"
fi

# logrotate test is kind of useless until http://bugs.debian.org/582630 is solved
if piuparts --help 2>/dev/null | grep -q -- '--skip-logrotatefiles-test' ; then
  skip_logrotatefiles_test_option="--skip-logrotatefiles-test"
fi

piuparts_version=$(piuparts --version 2>/dev/null | awk '{print $2}')
if dpkg --compare-versions $piuparts_version lt 0.43 ; then
  echo "*************************************************************************"
  echo "*** WARNING - piuparts version $piuparts_version is not recent enough ***"
  echo "*** You might run into problems, please consider upgrading piuparts   ***"
  echo "*************************************************************************"
fi

piuparts \
  -d "${distribution}" \
  ${warn_on_leftovers_after_purge_option:-} \
  ${skip_logrotatefiles_test_option:-} \
  --log-file='piuparts.txt' \
  ${scriptsdir:+--scriptsdir "$scriptsdir"} \
  ${piuparts_tmpdir:+--tmpdir="$piuparts_tmpdir"} \
  ${basetgz:-} \
  "$@"