bss = test.workpath('build/SConscript')
-criterion = {
+criterion_hardlinks = {
'hard' : lambda nl, islink: nl == 2 and not islink,
'soft' : lambda nl, islink: nl == 1 and islink,
'copy' : lambda nl, islink: nl == 1 and not islink,
}
+criterion_no_hardlinks = {
+ 'hard' : lambda nl, islink: not islink,
+ 'soft' : lambda nl, islink: islink,
+ 'copy' : lambda nl, islink: not islink,
+}
+
+# On systems without hard linking, it doesn't make sense to check ST_NLINK
+if hard:
+ criterion = criterion_hardlinks
+else:
+ criterion = criterion_no_hardlinks
+
description = {
'hard' : 'a hard link',
'soft' : 'a soft link',