This file is indexed.

/usr/bin/remove-reprepro-codename 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
#!/bin/bash

if [ -z ${JENKINS_DEBIAN_GLUE_QUIET:-} ]; then
  set -x
fi
set -e

# backwards compatibility, see PR#94
if [ -z "${REPOSITORY:-}" ] ; then
  repository_is_missing_in_env=true
else
  repository_is_missing_in_env=false
fi

if [ -r /etc/jenkins/debian_glue ] ; then
  . /etc/jenkins/debian_glue
fi

# backwards compatibility, see PR#94
if [ -n "${REPOSITORY:-}" ] && $repository_is_missing_in_env ; then
  echo "*** WARNING: 'REPOSITORY' set in /etc/jenkins/debian_glue but should be DEFAULT_REPOSITORY ***"
  echo "*** WARNING: Setting DEFAULT_REPOSITORY to $REPOSITORY for backwards compatibility ***"
  echo "*** WARNING: Please replace REPOSITORY=... in /etc/jenkins/debian_glue with DEFAULT_REPOSITORY=... ***"
  DEFAULT_REPOSITORY="${REPOSITORY}"
fi

if [ -z "${DEFAULT_REPOSITORY:-}" ] ; then
  echo "*** Repository variable DEFAULT_REPOSITORY is unset, using default [$DEFAULT_REPOSITORY] ***"
  DEFAULT_REPOSITORY='/srv/repository'
fi

# REPOSITORY can overwrite DEFAULT_REPOSITORY, so define only if unset
if [ -z "${REPOSITORY:-}" ] ; then
  REPOSITORY="${DEFAULT_REPOSITORY}"
  echo "*** Repository variable REPOSITORY is unset, using default [$REPOSITORY] ***"
fi

# support usage of a reprepro wrapper
REPREPRO_CMD="${REPREPRO_CMD:-reprepro}"

if [ -z "${REPREPRO_OPTS:-}" ]  ; then
  REPREPRO_OPTS='--waitforlock 1000 -v'
fi

if [ "$#" -lt 1 ] ; then
  echo "Usage: $0 <codename>" >&2
  exit 1
fi

codename="$1"

if ! [ -r "${REPOSITORY}/conf/distributions" ] ; then
  echo "*** Error: could not read ${REPOSITORY}/conf/distributions" >&2
  exit 1
fi

if ! grep -q "^\(Codename\|Suite\): ${codename}$" "${REPOSITORY}/conf/distributions" ; then
  echo "*** Codename $codename does not exist in ${REPOSITORY}/conf/distributions - nothing to do."
  exit 0
fi

echo "*** Removing codename $codename from reprepro configuration in $REPOSITORY ***"
perl -i -00 -pe "if (!\$done && m|$codename|) { \$_=q(); \$done++}" "${REPOSITORY}/conf/distributions"

echo "*** Removing vanished data from reprepro ***"
${REPREPRO_CMD} $REPREPRO_OPTS -b "$REPOSITORY" --delete clearvanished

# vim:foldmethod=marker ts=2 ft=sh ai expandtab sw=2