From 085f68a6fcf46e28828bdc20f710cbb1cb4f554f Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Fri, 18 Aug 2023 13:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4debian/postinst.template?= =?UTF-8?q?=E4=B8=AD=E8=AE=BE=E7=BD=AE=E7=9A=84apt=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/linux/code-url-handler.desktop | 2 +- resources/linux/code.appdata.xml | 4 +- resources/linux/code.desktop | 2 +- resources/linux/debian/postinst.template | 57 ------------------------ resources/linux/rpm/code.spec.template | 5 +-- 5 files changed, 6 insertions(+), 64 deletions(-) diff --git a/resources/linux/code-url-handler.desktop b/resources/linux/code-url-handler.desktop index 089202c9..56a20b78 100644 --- a/resources/linux/code-url-handler.desktop +++ b/resources/linux/code-url-handler.desktop @@ -9,4 +9,4 @@ NoDisplay=true StartupNotify=true Categories=Utility;TextEditor;Development;IDE; MimeType=x-scheme-handler/@@URLPROTOCOL@@; -Keywords=kylin-code; +Keywords=@@NAME_LONG@@; diff --git a/resources/linux/code.appdata.xml b/resources/linux/code.appdata.xml index 8a9f03a2..758cff14 100644 --- a/resources/linux/code.appdata.xml +++ b/resources/linux/code.appdata.xml @@ -11,8 +11,8 @@ - https://code.visualstudio.com/home/home-screenshot-linux-lg.png - Editing TypeScript and searching for extensions + https://gitee.com/chriswang521/kylin-ide/raw/master/resources/home/home-screenshot-linux-lg.png + Editing C++ and searching for extensions diff --git a/resources/linux/code.desktop b/resources/linux/code.desktop index 72488b67..fd265d27 100755 --- a/resources/linux/code.desktop +++ b/resources/linux/code.desktop @@ -10,7 +10,7 @@ StartupWMClass=@@NAME_SHORT@@ Categories=TextEditor;Development;IDE; MimeType=text/plain;inode/directory;application/x-@@NAME@@-workspace; Actions=new-empty-window; -Keywords=vscode; +Keywords=@@NAME_LONG@@; [Desktop Action new-empty-window] Name=New Empty Window diff --git a/resources/linux/debian/postinst.template b/resources/linux/debian/postinst.template index e5521aed..2267c7af 100755 --- a/resources/linux/debian/postinst.template +++ b/resources/linux/debian/postinst.template @@ -21,60 +21,3 @@ fi if hash update-mime-database 2>/dev/null; then update-mime-database /usr/share/mime fi - -if [ "@@NAME@@" != "kylin-code" ]; then - # Remove the legacy bin command if this is the stable build - if [ "@@NAME@@" = "code" ]; then - rm -f /usr/local/bin/code - fi - - # Register apt repository - eval $(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d) - CODE_SOURCE_PART=${APT_SOURCE_PARTS}vscode.list - - eval $(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d) - CODE_TRUSTED_PART=${APT_TRUSTED_PARTS}microsoft.gpg - - # Install repository source list - WRITE_SOURCE=0 - if [ ! -f $CODE_SOURCE_PART ] && [ ! -f /etc/rpi-issue ]; then - # Write source list if it does not exist and we're not running on Raspberry Pi OS - WRITE_SOURCE=1 - elif grep -Eq "http:\/\/packages\.microsoft\.com\/repos\/vscode" $CODE_SOURCE_PART; then - # Migrate from old repository - WRITE_SOURCE=1 - elif grep -q "# disabled on upgrade to" $CODE_SOURCE_PART; then - # Write source list if it was disabled by OS upgrade - WRITE_SOURCE=1 - fi - - if [ "$WRITE_SOURCE" -eq "1" ]; then - echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ### -# You may comment out this entry, but any other modifications may be lost. -deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main" > $CODE_SOURCE_PART - - # Sourced from https://packages.microsoft.com/keys/microsoft.asc - if [ ! -f $CODE_TRUSTED_PART ]; then - echo "-----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.7 (GNU/Linux) - -mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT -LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV -7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag -OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j -H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr -M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs -ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATUEEwEC -AB8FAlYxWIwCGwMGCwkIBwMCBBUCCAMDFgIBAh4BAheAAAoJEOs+lK2+EinPGpsH -/32vKy29Hg51H9dfFJMx0/a/F+5vKeCeVqimvyTM04C+XENNuSbYZ3eRPHGHFLqe -MNGxsfb7C7ZxEeW7J/vSzRgHxm7ZvESisUYRFq2sgkJ+HFERNrqfci45bdhmrUsy -7SWw9ybxdFOkuQoyKD3tBmiGfONQMlBaOMWdAsic965rvJsd5zYaZZFI1UwTkFXV -KJt3bp3Ngn1vEYXwijGTa+FXz6GLHueJwF0I7ug34DgUkAFvAs8Hacr2DRYxL5RJ -XdNgj4Jd2/g6T9InmWT0hASljur+dJnzNiNCkbn9KbX7J/qK1IbR8y560yRmFsU+ -NdCFTW7wY0Fb1fWJ+/KTsC4= -=J6gs ------END PGP PUBLIC KEY BLOCK----- -" | gpg --dearmor > $CODE_TRUSTED_PART - fi - fi -fi diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index c71f787e..a1cf1f64 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -15,7 +15,6 @@ AutoReq: 0 Kylin Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ. # Don't generate build_id links to prevent conflicts when installing multiple -# versions of VS Code alongside each other (e.g. `code` and `code-insiders`) %define _build_id_links none %install @@ -35,8 +34,8 @@ cp usr/share/zsh/site-functions/_@@NAME@@ %{buildroot}/usr/share/zsh/site-functi %post # Remove the legacy bin command if this is the stable build -if [ "@@NAME@@" = "code" ]; then - rm -f /usr/local/bin/code +if [ "@@NAME@@" = "kylin-code" ]; then + rm -f /usr/local/bin/kylin-code fi # Symlink bin command to /usr/bin