This file is indexed.

/usr/bin/acr-cat is in acr 1.2-1.

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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/sh
#
# acr is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# acr is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with acr; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
#===========================================================================
#
# ACR: AutoConf Replacement
#
# @license:  GPLv2
# @author:   pancake <pancake@nopcode.org>
# @homepage: http://www.nopcode.org/?t=acr
# @version:  @VERSION@
#
# acr-cat:
#   Recovery utility that allows the user to recover the original configure.acr
#   file from a generated acr-configure script.
#

S="\$"
CONFIGURE=""

get_value_of() {
	VAR=$1	
	echo `./${CONFIGURE} --report | awk -F : '/'${VAR}':/{print $2}'`
}

get_library_name() {
	VAR=$1
	echo ${VAR} | awk '{print (substr($1,4)); }'
}

if [ -z "$1" ]; then
	echo "usage $0 [configure-script]"
	exit 1
fi

if [ ! -f "$1" ]; then
	echo "error: target file '$1' does not exist." > /dev/stderr
	exit 1
fi

if [ ! -x "$1" ]; then
	echo "error: target file '$1' is not executable." > /dev/stderr
	exit 1
fi

VERSION="`./${1} --version 2>/dev/null`"
if [ -z "`echo ${VERSION} | grep ACR`" ]; then
	echo "error: this is not an acr generated configure script." > /dev/stderr
	exit 1
fi

CONFIGURE="$1"
## TODO: if configure does not starts with / or ., add  ./ at beginning


# XXX: this grep is done twice, wtf
EMBED="`grep '#ACR#' ${CONFIGURE}`"
if [ -n "${EMBED}" ]; then
	grep '#ACR#' ${CONFIGURE} | cut -c 7-
	exit 0
fi

REPORT=`./${CONFIGURE} --report | awk -F : '{print $1}' 2>/dev/null`
if [ ! "$?" = "0" ]; then
	echo "error: configure script returns invalid value $?."
	exit 1
fi

for A in ${REPORT}; do
	case ${A} in
	"PKGNAME")
		echo PKGNAME `get_value_of PKGNAME`
		;;
	"VERSION")
		echo VERSION `get_value_of VERSION`
		;;
	"LANGS")
		LANGS=`get_value_of LANGS`
		for B in ${LANGS}; do
			case ${B} in
			"c")
				echo LANG_C
				;;
			"c++")
				echo LANG_CXX
				;;
			"java")
				echo LANG_JAVA
			esac
		done
		;;
	"REQUIRED")
		REQ=`get_value_of REQUIRED`
		for B in ${REQ}; do
			case ${B} in
			lib*)
				echo CHKLIB! `get_library_name "${B}"`
				;;
			esac
		done
		;;
	"OPTIONAL")
		REQ=`get_value_of OPTIONAL`
		for B in ${REQ}; do
			case ${B} in
			lib*)
				echo CHKLIB `get_library_name "${B}"`
				;;
			esac
		done
		;;
	
	esac
done

CONTACT="`./${CONFIGURE} --help | grep 'Report bugs to:'|cut -c 16-`"
if [ -n "${CONTACT}" ]; then
	NAME="`echo ${CONTACT} | awk '{print $1}'`"
	MAIL="`echo ${CONTACT} | awk '{print substr($2,2,length($2)-2);}'`"
	echo "CONTACT ${NAME} ; ${MAIL}"
fi

ENDIAN=`grep BYTEORDER=1234 ${CONFIGURE}`
if [ -n "${ENDIAN}" ]; then
	echo "CHECK_ENDIAN"
fi

SD=""
SUBDIRS=`grep 'do # SUBDIRS' ${CONFIGURE} | cut -c 9-`
if [ -n "${SUBDIRS}" ]; then
	for A in $SUBDIRS ; do
		if [ "${A}" = ";" ]; then break; fi
		SD="${SD} ${A}"
	done
	echo "SUBDIRS $SD ;"
fi

SD=""
SUBDIRS=`grep 'do # SUBST_FILES' ${CONFIGURE} | cut -c 9-`
if [ -n "${SUBDIRS}" ]; then
	for A in $SUBDIRS ; do
		[ "${A}" = ";" ] && break
		SD="${SD} ${A}"
	done
	echo "SUBST_FILES $SD ;"
fi

SD=""
SUBDIRS=`grep 'do # REPORT' ${CONFIGURE} | cut -c 9-`
if [ -n "${SUBDIRS}" ]; then
	for A in $SUBDIRS ; do
		[ "${A}" = ";" ] && break
		SD="${SD} ${A}"
	done
	echo "REPORT $SD ;"
fi