Skip to content

Commit 17fa1cb

Browse files
committed
Merge .deb postinst and postinst.oss
1 parent 7596078 commit 17fa1cb

File tree

3 files changed

+25
-41
lines changed

3 files changed

+25
-41
lines changed

build/gulpfile.vscode.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -292,23 +292,14 @@ function prepareDebPackage(arch) {
292292
.pipe(replace('@@NAME@@', product.applicationName))
293293
.pipe(rename('DEBIAN/prerm'))
294294

295-
var all = es.merge(control, prerm, desktop, icon, shortcut, code);
296-
297-
// Register an apt repository if this is an official build
298-
if (product.updateUrl && product.quality) {
299-
var postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' })
300-
.pipe(replace('@@NAME@@', product.applicationName))
301-
.pipe(replace('@@UPDATEURL@@', product.updateUrl))
302-
.pipe(replace('@@QUALITY@@', product.quality))
303-
.pipe(replace('@@ARCHITECTURE@@', debArch))
304-
.pipe(rename('DEBIAN/postinst'))
305-
all = es.merge(all, postinst);
306-
} else {
307-
var postinst = gulp.src('resources/linux/debian/postinst.oss.template', { base: '.' })
308-
.pipe(replace('@@NAME@@', product.applicationName))
309-
.pipe(rename('DEBIAN/postinst'))
310-
all = es.merge(all, postinst);
311-
}
295+
var postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' })
296+
.pipe(replace('@@NAME@@', product.applicationName))
297+
.pipe(replace('@@ARCHITECTURE@@', debArch))
298+
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
299+
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
300+
.pipe(rename('DEBIAN/postinst'))
301+
302+
var all = es.merge(control, postinst, prerm, desktop, icon, shortcut, code);
312303

313304
return all.pipe(symdest(destination));
314305
};

resources/linux/debian/postinst.oss.template

Lines changed: 0 additions & 9 deletions
This file was deleted.

resources/linux/debian/postinst.template

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@
88
# developers would prefer a terminal editor as the default.
99
update-alternatives --install /usr/bin/editor editor /usr/bin/@@NAME@@ 0
1010

11-
# Remove the legacy bin command if this is the stable build
12-
if [ "@@NAME@@" = "code" ]; then
13-
rm -f /usr/local/bin/code
14-
fi
11+
if [ "@@NAME@@" != "code-oss" ]; then
12+
# Remove the legacy bin command if this is the stable build
13+
if [ "@@NAME@@" = "code" ]; then
14+
rm -f /usr/local/bin/code
15+
fi
1516

16-
# Register repository as an apt source
17-
get_apt_config_value() {
18-
echo $(apt-config dump | grep "$1 " | sed -e "s/$1 \"//" -e "s/\";$//")
19-
}
17+
# Register apt repository
18+
get_apt_config_value() {
19+
echo $(apt-config dump | grep "$1 " | sed -e "s/$1 \"//" -e "s/\";$//")
20+
}
2021

21-
APT_DIR=$(get_apt_config_value Dir)
22-
APT_ETC=$APT_DIR$(get_apt_config_value Dir::Etc)
23-
APT_SOURCE_PARTS=$APT_ETC$(get_apt_config_value Dir::Etc::sourceparts)
24-
CODE_SOURCE_LIST=$APT_SOURCE_PARTS/visual-studio-@@NAME@@.list
22+
APT_DIR=$(get_apt_config_value Dir)
23+
APT_ETC=$APT_DIR$(get_apt_config_value Dir::Etc)
24+
APT_SOURCE_PARTS=$APT_ETC$(get_apt_config_value Dir::Etc::sourceparts)
25+
CODE_SOURCE_LIST=$APT_SOURCE_PARTS/visual-studio-@@NAME@@.list
2526

26-
rm -f $CODE_SOURCE_LIST
27-
# TODO: #2973: Enable once the apt repository is signed
28-
#echo "deb @@UPDATEURL@@/api/deb/@@QUALITY@@/@@ARCHITECTURE@@/ /" > $CODE_SOURCE_LIST
27+
rm -f $CODE_SOURCE_LIST
28+
# TODO: #2973: Enable once the apt repository is signed
29+
#echo "deb @@UPDATEURL@@/api/deb/@@QUALITY@@/@@ARCHITECTURE@@/ /" > $CODE_SOURCE_LIST
30+
fi

0 commit comments

Comments
 (0)