testsuite: add file system test suite test_symlinks.sh

This commit is contained in:
Markus F.X.J. Oberhumer
2023-09-06 00:09:44 +02:00
parent 38d6cb090c
commit 92dfb9c83c
8 changed files with 438 additions and 34 deletions
+5 -3
View File
@@ -187,13 +187,15 @@ typedef upx_int64_t upx_off_t;
#undef small
#undef tos
#undef unix
#if defined(__linux__) && !defined(__unix__)
#if (ACC_OS_POSIX) && !defined(__unix__)
# define __unix__ 1
#endif
#if (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
# undef __unix
# undef __unix__
#endif
#if (ACC_OS_DOS32) && defined(__DJGPP__)
# undef sopen
# undef __unix
# undef __unix__
#endif
#if defined(HAVE_DUP) && (HAVE_DUP + 0 == 0)
+1 -1
View File
@@ -225,7 +225,7 @@ void show_help(int verbose) {
fg = con_fg(f, fg);
con_fprintf(f,
" --force-overwrite force overwrite of output files\n"
#if defined(__unix__) && !defined(__MSYS2__)
#if defined(__unix__)
" --link preserve hard links (Unix only) [USE WITH CARE]\n"
" --no-link do not preserve hard links but rename files [default]\n"
#endif
+2 -1
View File
@@ -201,7 +201,8 @@ static void check_and_update_options(int i, int argc) {
check_not_both(opt->force_overwrite, opt->preserve_link, "--force-overwrite", "--link");
check_not_both(opt->to_stdout, opt->preserve_link, "--stdout", "--link");
#if defined(__unix__) && !defined(__MSYS2__)
#if defined(__unix__)
static_assert(HAVE_LSTAT);
#else
// preserve_link is currently silently ignored on non-Unix platforms
// (we may revisit this decision later if there is some actual use-case)
+1 -1
View File
@@ -72,7 +72,7 @@ tribool PackUnix::canPack()
if (exetype == 0)
return false;
#if defined(__unix__) && !defined(__MSYS2__)
#if defined(__unix__)
// must be executable by owner
if ((fi->st.st_mode & S_IXUSR) == 0)
throwCantPack("file not executable; try 'chmod +x'");