Skip to content

Commit 9d646a6

Browse files
committed
sdk-installer: do not clutter root directory
We can just as easily use the same trick as portable/release.sh to create a second (fake) root directory and add it to the .7z archive by passing an absolute path (7za.exe will strip the directory from absolute paths). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b9cd985 commit 9d646a6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
/portable/root/bin/
1515
/portable/root/cmd/
1616
/portable/root/etc/
17+
/sdk-installer/root/

sdk-installer/release.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,20 @@ esac
2828
GIT_BRANCH="${2:-master}"
2929
GIT_CLONE_URL=https://github.com/git-for-windows/git
3030

31+
FAKEROOTDIR="$(cd "$(dirname "$0")" && pwd)/root"
3132
TARGET="$HOME"/git-sdk-installer-"$1"-$BITNESS.7z.exe
3233
OPTS7="-m0=lzma -mx=9 -md=64M"
3334
TMPPACK=/tmp.7z
3435
SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd)"
3536

37+
mkdir -p "$FAKEROOTDIR" ||
38+
die "Could not create fake root directory"
39+
3640
sed -e "s|@@ARCH@@|$ARCH|g" \
3741
-e "s|@@BITNESS@@|$BITNESS|g" \
3842
-e "s|@@GIT_BRANCH@@|$GIT_BRANCH|g" \
3943
-e "s|@@GIT_CLONE_URL@@|$GIT_CLONE_URL|g" \
40-
< "$SCRIPT_PATH"/setup-git-sdk.bat > /setup-git-sdk.bat ||
44+
<"$SCRIPT_PATH"/setup-git-sdk.bat >"$FAKEROOTDIR"/setup-git-sdk.bat ||
4145
die "Could not generate setup script"
4246

4347
fileList="$(cd / && echo \
@@ -49,8 +53,8 @@ fileList="$(cd / && echo \
4953
usr/bin/msys-crypto-*.dll \
5054
usr/bin/msys-ssl-*.dll \
5155
usr/ssl/certs/ca-bundle.crt \
52-
var/lib/pacman \
53-
setup-git-sdk.bat)"
56+
var/lib/pacman)
57+
$FAKEROOTDIR/setup-git-sdk.bat"
5458

5559
type 7za ||
5660
pacman -Sy --noconfirm p7zip ||

0 commit comments

Comments
 (0)