File: makefiles.sh

package info (click to toggle)
onedrive 2.5.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,252 kB
  • sloc: sh: 660; makefile: 167
file content (61 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (5)
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
#!/bin/bash
ONEDRIVEALT=~/OneDriveALT
if [ ! -d ${ONEDRIVEALT} ]; then
        mkdir -p ${ONEDRIVEALT}
else
        rm -rf ${ONEDRIVEALT}/*
fi

BADFILES=${ONEDRIVEALT}/bad_files
TESTFILES=${ONEDRIVEALT}/test_files
mkdir -p ${BADFILES}
mkdir -p ${TESTFILES}
dd if=/dev/urandom of=${TESTFILES}/large_file1.txt count=15 bs=1572864
dd if=/dev/urandom of=${TESTFILES}/large_file2.txt count=20 bs=1572864

# Create bad files that should be skipped
touch "${BADFILES}/ leading_white_space"
touch "${BADFILES}/trailing_white_space "
touch "${BADFILES}/trailing_dot."
touch "${BADFILES}/includes < in the filename"
touch "${BADFILES}/includes > in the filename"
touch "${BADFILES}/includes : in the filename"
touch "${BADFILES}/includes \" in the filename"
touch "${BADFILES}/includes | in the filename"
touch "${BADFILES}/includes ? in the filename"
touch "${BADFILES}/includes * in the filename"
touch "${BADFILES}/includes \\ in the filename"
touch "${BADFILES}/includes \\\\ in the filename"
touch "${BADFILES}/CON"
touch "${BADFILES}/CON.text"
touch "${BADFILES}/PRN"
touch "${BADFILES}/AUX"
touch "${BADFILES}/NUL"
touch "${BADFILES}/COM0"
touch "${BADFILES}/COM1"
touch "${BADFILES}/COM2"
touch "${BADFILES}/COM3"
touch "${BADFILES}/COM4"
touch "${BADFILES}/COM5"
touch "${BADFILES}/COM6"
touch "${BADFILES}/COM7"
touch "${BADFILES}/COM8"
touch "${BADFILES}/COM9"
touch "${BADFILES}/LPT0"
touch "${BADFILES}/LPT1"
touch "${BADFILES}/LPT2"
touch "${BADFILES}/LPT3"
touch "${BADFILES}/LPT4"
touch "${BADFILES}/LPT5"
touch "${BADFILES}/LPT6"
touch "${BADFILES}/LPT7"
touch "${BADFILES}/LPT8"
touch "${BADFILES}/LPT9"

# Test files from cases
# File contains invalid whitespace characters
tar xf ./bad-file-name.tar.xz -C ${BADFILES}/

# HelloCOM2.rar should be allowed
dd if=/dev/urandom of=${TESTFILES}/HelloCOM2.rar count=5 bs=1572864