|
@@ -148,11 +148,11 @@ fi
|
|
|
#----------------
|
|
|
|
|
|
initDebStructure() {
|
|
|
- rm -rf deb
|
|
|
+ sudo rm -rf deb
|
|
|
mkdir -p deb/DEBIAN
|
|
|
- rm -rf deb-doc
|
|
|
+ sudo rm -rf deb-doc
|
|
|
mkdir -p deb-doc/DEBIAN
|
|
|
- rm -rf deb-dev
|
|
|
+ sudo rm -rf deb-dev
|
|
|
mkdir -p deb-dev/DEBIAN
|
|
|
}
|
|
|
|
|
@@ -296,7 +296,7 @@ fixSystem() {
|
|
|
echo ' strcpy(foundpath, binaryname);' >> "$FILE"
|
|
|
echo ' return foundpath;' >> "$FILE"
|
|
|
echo ' } else {' >> "$FILE"
|
|
|
- echo ' return NULL' >> "$FILE"
|
|
|
+ echo ' return NULL;' >> "$FILE"
|
|
|
echo ' }' >> "$FILE"
|
|
|
echo ' }' >> "$FILE"
|
|
|
echo ' ' >> "$FILE"
|
|
@@ -320,17 +320,17 @@ fixSystem() {
|
|
|
echo ' return NULL;' >> "$FILE"
|
|
|
echo '}' >> "$FILE"
|
|
|
echo '' >> "$FILE"
|
|
|
- echo 'static bool isShellScript(const char *path){' >> "$FILE"
|
|
|
+ echo 'static int isShellScript(const char *path){' >> "$FILE"
|
|
|
echo ' FILE *file = fopen(path, "r");' >> "$FILE"
|
|
|
echo ' uint8_t header[2];' >> "$FILE"
|
|
|
echo ' if (fread(header, sizeof(uint8_t), 2, file) == 2){' >> "$FILE"
|
|
|
echo " if (header[0] == '#' && header[1] == '!'){" >> "$FILE"
|
|
|
echo ' fclose(file);' >> "$FILE"
|
|
|
- echo ' return true;' >> "$FILE"
|
|
|
+ echo ' return 1;' >> "$FILE"
|
|
|
echo ' }' >> "$FILE"
|
|
|
echo ' }' >> "$FILE"
|
|
|
echo ' fclose(file);' >> "$FILE"
|
|
|
- echo ' return false;' >> "$FILE"
|
|
|
+ echo ' return -1;' >> "$FILE"
|
|
|
echo '}' >> "$FILE"
|
|
|
echo '' >> "$FILE"
|
|
|
echo 'static char *getInterpreter(char *path){' >> "$FILE"
|
|
@@ -365,8 +365,8 @@ fixSystem() {
|
|
|
echo ' ' >> "$FILE"
|
|
|
echo ' char *abs_path = searchpath(cmd);' >> "$FILE"
|
|
|
echo ' if (abs_path){' >> "$FILE"
|
|
|
- echo ' bool isScript = isShellScript(abs_path);' >> "$FILE"
|
|
|
- echo ' if (isScript){' >> "$FILE"
|
|
|
+ echo ' int isScript = isShellScript(abs_path);' >> "$FILE"
|
|
|
+ echo ' if (isScript == 1){' >> "$FILE"
|
|
|
echo ' char *interpreter = getInterpreter(abs_path);' >> "$FILE"
|
|
|
echo ' ' >> "$FILE"
|
|
|
echo ' uint8_t commandSize = strlen(interpreter) + 1 + strlen(abs_path);' >> "$FILE"
|
|
@@ -448,7 +448,7 @@ downloadReadline() {
|
|
|
else
|
|
|
echo "Using existing readline"
|
|
|
fi
|
|
|
- rm -rf readline-7.0
|
|
|
+ sudo rm -rf readline-7.0
|
|
|
tar xzvf readline-7.0.tar.gz
|
|
|
WORKING_DIR="readline-7.0"
|
|
|
PKG_NAME="readline"
|
|
@@ -529,7 +529,7 @@ downloadNcurses() {
|
|
|
else
|
|
|
echo "Using existing ncurses-6.0"
|
|
|
fi
|
|
|
- rm -rf ncurses-6.0
|
|
|
+ sudo rm -rf ncurses-6.0
|
|
|
tar xzvf ncurses-6.0.tar.gz
|
|
|
WORKING_DIR="ncurses-6.0"
|
|
|
PKG_NAME="ncurses"
|
|
@@ -644,7 +644,7 @@ downloadBash() {
|
|
|
else
|
|
|
echo "Using existing bash"
|
|
|
fi
|
|
|
- rm -rf bash-4.4.12
|
|
|
+ sudo rm -rf bash-4.4.12
|
|
|
tar xzvf bash-4.4.12.tar.gz
|
|
|
WORKING_DIR="bash-4.4.12"
|
|
|
PKG_NAME="bash"
|
|
@@ -813,7 +813,7 @@ downloadSed() {
|
|
|
else
|
|
|
echo "Using existing sed"
|
|
|
fi
|
|
|
- rm -rf sed-4.4/
|
|
|
+ sudo rm -rf sed-4.4/
|
|
|
tar xJvf sed-4.4.tar.xz
|
|
|
WORKING_DIR="sed-4.4"
|
|
|
PKG_NAME="sed"
|
|
@@ -880,7 +880,7 @@ downloadGrep() {
|
|
|
else
|
|
|
echo "Using existing grep"
|
|
|
fi
|
|
|
- rm -rf grep-3.0/
|
|
|
+ sudo rm -rf grep-3.0/
|
|
|
tar xJvf grep-3.0.tar.xz
|
|
|
|
|
|
WORKING_DIR="grep-3.0"
|
|
@@ -951,7 +951,7 @@ downloadCoreutils() {
|
|
|
else
|
|
|
echo "Using existing coreutils"
|
|
|
fi
|
|
|
- rm -rf coreutils-8.9
|
|
|
+ sudo rm -rf coreutils-8.9
|
|
|
tar xJvf coreutils-8.9.tar.xz
|
|
|
|
|
|
WORKING_DIR="coreutils-8.9"
|
|
@@ -1247,7 +1247,7 @@ downloadFindUtils() {
|
|
|
else
|
|
|
echo "Using existing findutils"
|
|
|
fi
|
|
|
- rm -rf findutils-4.6.0
|
|
|
+ sudo rm -rf findutils-4.6.0
|
|
|
tar xzvf findutils-4.6.0.tar.gz
|
|
|
|
|
|
WORKING_DIR="findutils-4.6.0"
|
|
@@ -1325,7 +1325,7 @@ downloadDiffUtils() {
|
|
|
else
|
|
|
echo "Using existing diffutils"
|
|
|
fi
|
|
|
- rm -rf diffutils-3.6
|
|
|
+ sudo rm -rf diffutils-3.6
|
|
|
tar xJvf diffutils-3.6.tar.xz
|
|
|
|
|
|
WORKING_DIR="diffutils-3.6"
|
|
@@ -1562,7 +1562,7 @@ downloadZLib() {
|
|
|
PKG_VERSION="1.2.11-1"
|
|
|
cd "$WORKING_DIR"
|
|
|
git checkout tags/v1.2.11
|
|
|
- rm -rf build
|
|
|
+ sudo rm -rf build
|
|
|
mkdir build
|
|
|
cd build
|
|
|
WORKING_DIR="$WORKING_DIR/build"
|
|
@@ -1632,7 +1632,7 @@ downloadXZ() {
|
|
|
else
|
|
|
echo "Using xz-5.2.3.tar.gz"
|
|
|
fi
|
|
|
- rm -rf xz-5.2.3
|
|
|
+ sudo rm -rf xz-5.2.3
|
|
|
tar xzvf xz-5.2.3.tar.gz
|
|
|
|
|
|
WORKING_DIR="xz-5.2.3"
|
|
@@ -1733,7 +1733,7 @@ downloadBZip2() {
|
|
|
else
|
|
|
echo "Using bzip2-1.0.6.tar.gz"
|
|
|
fi
|
|
|
- rm -rf bzip2-1.0.6
|
|
|
+ sudo rm -rf bzip2-1.0.6
|
|
|
tar xzvf bzip2-1.0.6.tar.gz
|
|
|
WORKING_DIR="bzip2-1.0.6"
|
|
|
PKG_NAME="bzip2"
|
|
@@ -1827,7 +1827,7 @@ downloadLZ4() {
|
|
|
else
|
|
|
echo "Using existing lz4"
|
|
|
fi
|
|
|
- rm -rf lz4-1.7.5/
|
|
|
+ sudo rm -rf lz4-1.7.5/
|
|
|
tar xzvf lz4-v1.7.5.tar.gz
|
|
|
|
|
|
WORKING_DIR="lz4-1.7.5/contrib/cmake_unofficial/"
|
|
@@ -1992,7 +1992,7 @@ downloadCurl() {
|
|
|
echo "Using curl-7.50.1.tar.gz"
|
|
|
fi
|
|
|
|
|
|
- rm -rf curl-7.50.1
|
|
|
+ sudo rm -rf curl-7.50.1
|
|
|
echo "Unpacking curl"
|
|
|
tar xzvf "curl-7.50.1.tar.gz"
|
|
|
|
|
@@ -2099,7 +2099,7 @@ downloadBerkeleyDB() {
|
|
|
else
|
|
|
echo "Using existing db-6.2.23"
|
|
|
fi
|
|
|
- rm -rf db-6.2.23
|
|
|
+ sudo rm -rf db-6.2.23
|
|
|
tar xzvf db-6.2.23.tar.gz
|
|
|
WORKING_DIR="db-6.2.23/build_unix/"
|
|
|
PKG_NAME="berkeleydb"
|
|
@@ -2117,6 +2117,7 @@ patchBerkeleyDB() {
|
|
|
echo "#include <stdlib.h>" >> shell.patched.c
|
|
|
echo "#include <spawn.h>" >> shell.patched.c
|
|
|
echo "#include <sys/wait.h>" >> shell.patched.c
|
|
|
+ echo "#include <sys/stat.h>" >> shell.patched.c
|
|
|
echo "" >> shell.patched.c
|
|
|
echo "extern char **environ;" >> shell.patched.c
|
|
|
echo "" >> shell.patched.c
|
|
@@ -2238,7 +2239,7 @@ downloadTar() {
|
|
|
else
|
|
|
echo "Using existing tar"
|
|
|
fi
|
|
|
- rm -rf tar-1.30
|
|
|
+ sudo rm -rf tar-1.30
|
|
|
tar xJvf tar-1.30.tar.xz
|
|
|
|
|
|
WORKING_DIR="tar-1.30"
|
|
@@ -2457,7 +2458,7 @@ downloadGpgError() {
|
|
|
else
|
|
|
echo "Using existing libgpg-error"
|
|
|
fi
|
|
|
- rm -rf libgpg-error-1.27
|
|
|
+ sudo rm -rf libgpg-error-1.27
|
|
|
tar xjvf libgpg-error-1.27.tar.bz2
|
|
|
|
|
|
WORKING_DIR="libgpg-error-1.27"
|
|
@@ -2555,7 +2556,7 @@ downloadGcrypt() {
|
|
|
else
|
|
|
echo "Using existing gcrypt"
|
|
|
fi
|
|
|
- rm -rf libgcrypt-1.8.2
|
|
|
+ sudo rm -rf libgcrypt-1.8.2
|
|
|
tar xjvf libgcrypt-1.8.2.tar.bz2
|
|
|
|
|
|
WORKING_DIR="libgcrypt-1.8.2"
|
|
@@ -2573,6 +2574,7 @@ patchGcrypt() {
|
|
|
echo "#include <stdlib.h>" >> random.patched.c
|
|
|
echo "#include <spawn.h>" >> random.patched.c
|
|
|
echo "#include <sys/wait.h>" >> random.patched.c
|
|
|
+ echo "#include <sys/stat.h>" >> random.patched.c
|
|
|
echo "" >> random.patched.c
|
|
|
echo "extern char **environ;" >> random.patched.c
|
|
|
echo "" >> random.patched.c
|
|
@@ -2667,7 +2669,7 @@ downloadKSBA() {
|
|
|
else
|
|
|
echo "Using existing libksba"
|
|
|
fi
|
|
|
- rm -rf libksba-1.3.5
|
|
|
+ sudo rm -rf libksba-1.3.5
|
|
|
tar xjvf libksba-1.3.5.tar.bz2
|
|
|
|
|
|
WORKING_DIR="libksba-1.3.5"
|
|
@@ -2753,7 +2755,7 @@ downloadNpth() {
|
|
|
else
|
|
|
echo "Using existing npth"
|
|
|
fi
|
|
|
- rm -rf npth-1.5
|
|
|
+ sudo rm -rf npth-1.5
|
|
|
tar xjvf npth-1.5.tar.bz2
|
|
|
|
|
|
WORKING_DIR="npth-1.5"
|
|
@@ -2852,7 +2854,7 @@ downloadAssuan() {
|
|
|
else
|
|
|
echo "Using existing libassuan"
|
|
|
fi
|
|
|
- rm -rf libassuan-2.5.1
|
|
|
+ sudo rm -rf libassuan-2.5.1
|
|
|
tar xjvf libassuan-2.5.1.tar.bz2
|
|
|
|
|
|
WORKING_DIR="libassuan-2.5.1"
|
|
@@ -2941,7 +2943,7 @@ downloadNtbtls() {
|
|
|
else
|
|
|
echo "Using existing ntbtls"
|
|
|
fi
|
|
|
- rm -rf ntbtls-0.1.2
|
|
|
+ sudo rm -rf ntbtls-0.1.2
|
|
|
tar xjvf ntbtls-0.1.2.tar.bz2
|
|
|
|
|
|
WORKING_DIR="ntbtls-0.1.2"
|
|
@@ -3027,7 +3029,7 @@ downloadGpg() {
|
|
|
else
|
|
|
echo "Using existing gpg"
|
|
|
fi
|
|
|
- rm -rf gnupg-2.2.3
|
|
|
+ sudo rm -rf gnupg-2.2.3
|
|
|
tar xjvf gnupg-2.2.3.tar.bz2
|
|
|
|
|
|
WORKING_DIR="gnupg-2.2.3"
|
|
@@ -3159,7 +3161,7 @@ downloadApt() {
|
|
|
PKG_NAME="apt7"
|
|
|
PKG_VERSION="0.7.25.3-1"
|
|
|
cd "$WORKING_DIR"
|
|
|
- rm -rf build
|
|
|
+ sudo rm -rf build
|
|
|
mkdir build
|
|
|
cd build
|
|
|
WORKING_DIR="$WORKING_DIR/build"
|