File: 033_many_symlinks

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (53 lines) | stat: -rwxr-xr-x 1,093 bytes parent folder | download | duplicates (4)
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
#!/bin/bash

set -e 
$PREPARE_CLEAN > /dev/null
$INCLUDE_FUNCS
cd $WC

logfile=$LOGDIR/033.log


COUNT=1000
DIR=subdir

# We set some ulimit here, so that we know see whether RAM is eaten or not.
# 640k is enough for everyone! No, not here ...
limit=32768
# On 64bit the libraries need much more (virtual) memory; so we don't limit 
# that here.
ulimit -S -d $limit -m $limit -s $limit
ulimit -H -d $limit -m $limit -s $limit

mkdir $DIR
$BINq ci -m1

$INFO "Creating symlinks"
perl -e '
($nr, $dir)=@ARGV;
for(1 .. $nr) 
{
	symlink("./././././../$dir/../$dir/../$dir", 
			sprintf("%s/%05d", $dir,$_) ) || die $!; 
} ' $COUNT $DIR

$INFO "Looking for them."
# Generating is so fast that the directory might stay in the same second.
found=`$BINdflt st -o change_check=dir | wc -l`
# The directory gets reported, too.
if [[ $found -eq `echo $COUNT + 1 | bc` ]]
then
	$SUCCESS "fsvs found all $COUNT changed entries."
else
	$ERROR "fsvs found $found instead of $COUNT entries!"
fi


$INFO "Commit ..."
$BINq ci -m many

$INFO "Update ..."
$WC2_UP_ST_COMPARE

$INFO "sync-repos"
$BINq sync-repos