This file is indexed.

/usr/lib/fai/get-config-dir-hg is in fai-client 5.0.3ubuntu1.

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

# (c) 2002-2006 Henning Glawe <glaweh@debian.org>
# (c) 2007 Holger Levsen <holger@layer-acht.org> for the modifications to use git
# (c) 2009 Darshaka Pathirana <dpat@syn-net.org> for the modifications to use hg

### BEGIN SUBROUTINE INFO
# Provides-Var:
# Requires-Var:    $FAI_CONFIG_SRC $FAI $LOGDIR
# Suggests-Var:
# Short-Description: get $FAI from a mercurial (hg) repository.
### END SUBROUTINE INFO

# matched string: "hg://hgpath"
protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
hgpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')

case $protocol in
        hg+http)
                echo hg+http
                hgurl="http://$hgpath"
                ;;
        hg+https)
                echo hg+https
                hgurl="https://$hgpath"
                ;;
        *)
                echo "get-config-dir-hg: protocol $protocol not implemented"
                exit 1
                ;;
esac

if [ -d "$FAI/.hg" ] ; then
   #TODO: check whether the checkout is from $hgurl
   echo "Updating hg copy in $FAI"
   cd $FAI
   hg pull -u
   task_error 881 $?
else
   echo "Checking out from hg"
   # cloning into an existing directory is not allowed
   if [ -d $FAI ]; then rmdir $FAI; fi
   hg clone $hgurl $FAI
   task_error 882 $?
fi