This file is indexed.

/var/lib/pcp/testsuite/223 is in pcp-testsuite 3.9.10.

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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
#! /bin/sh
# PCP QA Test No. 223
# Exercise the new pmns/Rebuild
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

[ $PCP_PLATFORM = irix ] || _notrun "tests the IRIX Rebuild script"

_copy_Rebuild()
{
    scr_src=$PCP_VAR_DIR/pmns/
    cp $scr_src/Rebuild $1
    if [ -f $scr_src/Xlate-irix-names ]
    then
	cp $scr_src/Xlate-irix-names $1
    fi
}

_filter ()
{
    sed \
	-e "s/\/$$/\/PID/g" \
	-e 's/^\*\*\*.*[^*]$/*** old file/' \
	-e 's/^---.*[^-]$/--- new file/'
}

_setup() {
    PMNS_OLD=$tmp/old
    PMNS_NEW=$tmp/new
    export PMNS_OLD PMNS_NEW
    rm -rf $PMNS_OLD $PMNS_NEW
    mkdir -p $PMNS_NEW
    mkdir -p $PMNS_OLD
    echo >$PMNS_NEW/root 'root {
    foo
}
foo {
    one	0:0:1
}'
}

_setup_wxy()
{
    echo >$PMNS_NEW/root '
root {
    extra
}
extra {
    xxx
    yyy
}
#include "xxx"
#include "yyy"'

    echo >$PMNS_NEW/www.orphan '
extra.www {
    two 0:0:2
}'

    echo >$PMNS_NEW/xxx '
extra.xxx {
    two 0:0:3
}'

    echo '/* new */' >$PMNS_NEW/xxx.N
    cat $PMNS_NEW/xxx >>$PMNS_NEW/xxx.N

    echo >$PMNS_NEW/yyy '
extra.yyy {
    two 0:0:4
}'

    echo '/* old */' >$PMNS_NEW/yyy.O
    cat $PMNS_NEW/yyy >>$PMNS_NEW/yyy.O
}

_check()
{
    echo "Exit status: $1"
    type=unknown
    [ -d $PMNS_OLD ] && type=directory
    [ -f $PMNS_OLD ] && type=file
    [ -L $PMNS_OLD ] && type=symlink
    echo "PMNS_OLD pathname is: $type"
    echo "PMNS_NEW contents:"
    ls $PMNS_NEW
    $DO_VALIDATE && _validate
}

_validate()
{
    ( cd $PMNS_NEW; pmnscomp -f -n root root.bin )
    echo "pminfo:"
    pminfo -m -n $PMNS_NEW/root >$tmp.out 2>&1
    status=$?
    _filter <$tmp.out
    if [ $status != 0 ]
    then
	for file in $PMNS_NEW/*
	do
	    echo "=========================="
	    echo "new/`basename $file`"
	    echo "=========================="
	    cat $file
	done
    fi
}

_remove_rebuild()
{
    rm -f $1/Rebuild 
    if [ -f $1/Xlate-irix-names ]
    then
	rm -f $1/Xlate-irix-names
    fi
}

# get standard filters
. ./common.filter

tmp=/tmp/$$
status=0
DO_VALIDATE=true
trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15

# real QA test starts here

echo "=== PMNS_OLD does not exist ==="
_setup
rm -rf $PMNS_OLD
echo "=== PMNS_OLD does not exist ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== PMNS_OLD is empty ==="
_setup
echo "=== PMNS_OLD is empty ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== PMNS_OLD contains scripts that can safely be nuked ==="
_setup
touch $PMNS_OLD/Brand $PMNS_OLD/Makefile $PMNS_OLD/Rebuild
echo "=== PMNS_OLD contains scripts that can safely be nuked ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== PMNS_OLD contains files not in conflict with PMNS_NEW, copy them ==="
_setup
touch $PMNS_OLD/root.N $PMNS_OLD/urk $PMNS_OLD/urk.O
echo >$PMNS_OLD/xxx '
extra.xxx {
    two 0:0:3
}'
echo "=== PMNS_OLD contains files not in conflict with PMNS_NEW, copy them ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== files in PMNS_OLD and PMNS_NEW are identical ==="
_setup
_setup_wxy
rm $PMNS_NEW/www*
cp $PMNS_NEW/* $PMNS_OLD
echo "=== files in PMNS_OLD and PMNS_NEW are identical ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== salvage useful stuff from PMNS_OLD ==="
_setup
_setup_wxy
rm $PMNS_NEW/www*
mv $PMNS_NEW/xxx* $PMNS_OLD
DO_VALIDATE=false
_check N/A
DO_VALIDATE=true
echo "=== salvage useful stuff from PMNS_OLD ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== hard cases ==="
_setup
_setup_wxy
rm $PMNS_NEW/www*
sed -e 's/two/three/' <$PMNS_NEW/xxx.N >$PMNS_OLD/xxx
sed -e 's/two/three/' <$PMNS_NEW/yyy.O >$PMNS_OLD/yyy
_check N/A
echo "=== hard cases ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== PMNS_OLD is a file (error) ==="
_setup
rm -rf $PMNS_OLD
touch $PMNS_OLD
echo "=== PMNS_OLD is a file (error) ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== www.orphan, xxx.N and yyy.O in both places, waste the ones from PMNS_OLD ==="
_setup
_setup_wxy
touch $PMNS_OLD/www.orphan $PMNS_OLD/xxx.N $PMNS_OLD/yyy.O
_check N/A
echo "=== www.orphan, xxx.N and yyy.O in both places, waste the ones from PMNS_OLD ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== orphan (saveme) in PMNS_OLD ==="
_setup
touch $PMNS_OLD/saveme
echo "=== orphan (saveme) in PMNS_OLD ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

echo
echo "=== nested decls, a la DBMS PMDAS ==="
_setup
    echo >$PMNS_NEW/root '
root {
    extra
}
#include "extra"'

    echo >$PMNS_NEW/extra '
extra {
    xxx
    yyy
}
#include "xxx"
#include "yyy"'

    echo >$PMNS_NEW/xxx '
#define CLUST 1
#define ID xxx
extra.xxx {
#include "dummy"
#undef CLUST
#undef ID'

    echo >$PMNS_NEW/yyy '
#define CLUST 2
#define ID yyy
extra.yyy {
#include "dummy"
#undef CLUST
#undef ID'

    echo >$PMNS_NEW/dummy '
    one		0:CLUST:1
    special
}

extra.ID.special {
    two		0:CLUST:2
    three	0:CLUST:3
}
'

echo "=== nested decls, a la DBMS PMDAS ===" >>$seq.full
ls -lR $PMNS_OLD $PMNS_NEW >>$seq.full 2>&1
_copy_Rebuild $PMNS_NEW
$sudo "cd $PMNS_NEW; ./Rebuild -uv" >$tmp.err
chk=$?
_remove_rebuild $PMNS_NEW
_filter <$tmp.err
_check $chk

# all done
exit