You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "oyarzun (via GitHub)" <gi...@apache.org> on 2025/09/21 17:08:08 UTC
[PR] Add embedded tar script packager [netbeans-nbpackage]
oyarzun opened a new pull request, #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115
Adds an embedded tar script packager.
- Installer run as normal user it defaults to `~/.local/appdir`
- Installer run with sudo it defaults to `/usr/local/appdir`
- Install desktop file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3761094761
@neilcsmith-net no problem. I agree with your thinking release 1.0.0 first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "ebarboni (via GitHub)" <gi...@apache.org>.
ebarboni commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3759884522
> Thanks @ebarboni but I don't agree with you that the version can be decided later. If we want the next release to be 1.0.0 then we need to do that _before_ this is merged.
for me this is only if we don't want this PR for 1.0.0
but we can go for a vote thread to have current nbpackage released as 1.0.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387145561
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
I think this should be removed. It should be unnecessary. The API should give you the option to leave unmatched tokens in place already.
##########
src/main/resources/org/apache/netbeans/nbpackage/shell/shell.script.template:
##########
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+APP_DIR=${APP_DIR}
+
+if ! [ $(id -u) = 0 ]; then
+ DEFAULT_INSTALL_PREFIX=$HOME/.local
+ DESKTOP_FILE_INSTALL_DIR=$HOME/.local/share/applications
+else
+ DEFAULT_INSTALL_PREFIX=/usr/local
+ DESKTOP_FILE_INSTALL_DIR=/usr/local/share/applications
+fi
+
+read -p "Enter ${APP_NAME} Install Prefix [${{DEFAULT_INSTALL_PREFIX}}]/${{APP_DIR}}: " INSTALL_PREFIX
Review Comment:
Move to `${DEFAULT_INSTALL_PREFIX}` pattern.
Also, mixing up `${{APP_DIR}}` and `${APP_DIR}`.
##########
src/main/resources/org/apache/netbeans/nbpackage/shell/shell.desktop.template:
##########
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=${package.name}
+Exec=${{LAUNCHER}}
Review Comment:
Just use `${LAUNCHER}`. Or as it's replaced from script, a different token delimiter.
##########
src/main/java/org/apache/netbeans/nbpackage/shell/TarScriptPackager.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.netbeans.nbpackage.shell;
+
+import org.apache.netbeans.nbpackage.ExecutionContext;
+import org.apache.netbeans.nbpackage.Option;
+import org.apache.netbeans.nbpackage.Packager;
+import org.apache.netbeans.nbpackage.Template;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.ResourceBundle;
+import java.util.stream.Stream;
+
+/**
+ * Packager for Linux embedded tar in script installer.
+ */
+public class TarScriptPackager implements Packager {
+
+ static final ResourceBundle MESSAGES
+ = ResourceBundle.getBundle(TarScriptPackager.class.getPackageName() + ".Messages");
+
+ /**
+ * Path to png icon (48x48) as required by AppDir / XDG specification.
+ * Defaults to Apache NetBeans icon.
+ */
+ static final Option<Path> ICON_PATH
+ = Option.ofPath("package.shell.icon",
Review Comment:
Might be better to have all the options prefixed with `tar` instead of `shell` for consistency? eg. `package.tar.icon` here.
##########
src/main/java/org/apache/netbeans/nbpackage/NBPackage.java:
##########
@@ -132,7 +133,8 @@ public final class NBPackage {
new RpmPackager(),
new InnoSetupPackager(),
new PkgPackager(),
- new ZipPackager()
+ new ZipPackager(),
+ new TarScriptPackager()
Review Comment:
Keep zip last - move tar below rpm to keep Linux options together.
##########
src/main/resources/org/apache/netbeans/nbpackage/shell/Messages.properties:
##########
@@ -0,0 +1,37 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Option file help comments
+option.icon.help=Path to 48x48 png icon as required by xdg specification. Defaults to Apache NetBeans logo.
+option.svg.help=Path to SVG icon. Will only be used if package.shell.icon also set. Defaults to Apache NetBeans logo.
+option.wmclass.help=StartupWMClass to set in .desktop file. Should match the WMClass of the main application window.
+option.category.help=Application category (or categories) to use in the .desktop file.
+option.desktopfilename.help=Optional name for .desktop file (without suffix). Defaults to sanitized package name.
+option.desktop_template.help=Optional path to custom .desktop file template.
+option.launcher_template.help=Optional path to custom launcher script template.
+option.template.help=Optional path to an alternative shell script (*.sh) file template.
+
+# Option defaults
+option.wmclass.default=${package.name}
+option.category.default=Development;Java;IDE;
+
+# Messages
+message.missingdebtools=The sed, tar, which commands must be installed.
Review Comment:
`message.missingtartools`?
Although it's not used by the packager anyway?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387792583
##########
src/main/java/org/apache/netbeans/nbpackage/NBPackage.java:
##########
@@ -132,7 +133,8 @@ public final class NBPackage {
new RpmPackager(),
new InnoSetupPackager(),
new PkgPackager(),
- new ZipPackager()
+ new ZipPackager(),
+ new TarScriptPackager()
Review Comment:
Makes sense, will do.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387841568
##########
src/main/java/org/apache/netbeans/nbpackage/shell/TarScriptPackager.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.netbeans.nbpackage.shell;
+
+import org.apache.netbeans.nbpackage.ExecutionContext;
+import org.apache.netbeans.nbpackage.Option;
+import org.apache.netbeans.nbpackage.Packager;
+import org.apache.netbeans.nbpackage.Template;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.ResourceBundle;
+import java.util.stream.Stream;
+
+/**
+ * Packager for Linux embedded tar in script installer.
+ */
+public class TarScriptPackager implements Packager {
+
+ static final ResourceBundle MESSAGES
+ = ResourceBundle.getBundle(TarScriptPackager.class.getPackageName() + ".Messages");
+
+ /**
+ * Path to png icon (48x48) as required by AppDir / XDG specification.
+ * Defaults to Apache NetBeans icon.
+ */
+ static final Option<Path> ICON_PATH
+ = Option.ofPath("package.shell.icon",
Review Comment:
Sounds good, I was having trouble deciding what to call the package.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387911974
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
Sure, I understand what you're trying to do, but that should happen anyway without this extra code as long as the token is not present during packaging - eg. see the test at https://github.com/apache/netbeans-nbpackage/blob/51e9d3db6a3438f85f141817d4cd9a97de9b3cc4/src/test/java/org/apache/netbeans/nbpackage/ExecutionContextTest.java#L77-L79
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5646382103
@neilcsmith-net @mbien Thanks for reviewing the PR. I've rebased the code and addressed @mbien comments:
1. Use `realpath` to resolve the absolute install path used in the desktop file (e.g. the icon path)
2. Update the readme with the new package type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387842454
##########
src/main/resources/org/apache/netbeans/nbpackage/shell/Messages.properties:
##########
@@ -0,0 +1,37 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Option file help comments
+option.icon.help=Path to 48x48 png icon as required by xdg specification. Defaults to Apache NetBeans logo.
+option.svg.help=Path to SVG icon. Will only be used if package.shell.icon also set. Defaults to Apache NetBeans logo.
+option.wmclass.help=StartupWMClass to set in .desktop file. Should match the WMClass of the main application window.
+option.category.help=Application category (or categories) to use in the .desktop file.
+option.desktopfilename.help=Optional name for .desktop file (without suffix). Defaults to sanitized package name.
+option.desktop_template.help=Optional path to custom .desktop file template.
+option.launcher_template.help=Optional path to custom launcher script template.
+option.template.help=Optional path to an alternative shell script (*.sh) file template.
+
+# Option defaults
+option.wmclass.default=${package.name}
+option.category.default=Development;Java;IDE;
+
+# Messages
+message.missingdebtools=The sed, tar, which commands must be installed.
Review Comment:
Will do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387986627
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
Yes, there's `StringUtils::replaceTokens` where you want to leave any unmatched tokens as they are, and `StringUtils::replaceTokensOrFail` for where all tokens must be pre-defined. It was done like this to allow shell scripts and other contexts where the same `${...}` is needed.
Ideally, think about the naming in the script templates to make it clear which are replaced at build time though if you need both. Maybe the additional tokens like `APP_DIR` should be lower case in this one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3715570805
@neilcsmith-net Happy New Year!
Any more thoughts on this PR? Does it need more changes? It it worthwhile to be merged?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387934294
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
My mistake, I did not realize only a preset list of tokens are replaced. I'll remove it and update the templates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "ebarboni (via GitHub)" <gi...@apache.org>.
ebarboni commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3739506973
Hi, I think it could be merged beta7 or 1.0.0 is a decision that can be done for release later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3739829794
Thanks @ebarboni but I don't agree with you that the version can be decided later. If we want the next release to be 1.0.0 then we need to do that _before_ this is merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387837497
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
This is still needed to avoid replacing bash variables that are used when the end user is using the installer script to install the software. Since the user is allowed to choose where to install the software some variables need to be interpreted as bash variables at runtime. e.g.
`LAUNCHER=${{INSTALL_PATH}}/launcher/${APP_DIR}` gets replaced with `LAUNCHER=${INSTALL_PATH}/launcher/app_dir` in the installer script.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3715726739
@oyarzun Happy New Year to you too!
Apologies for delays in getting this in. I've been mostly out of the NetBeans loop for the last few months, and was hoping someone else might take a look at this as well in that time.
I think this would be nice to get in, but I'm not sure whether we should concentrate on releasing the existing master in non-beta form before merging new packagers? @mbien @ebarboni any thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5652156758
right I had the same thought. What I also haven't tested is what happens when the folder is non-empty, the script will merge the content without warning I believe. Script should probably also fail when someone passes arguments to it, e.g "I am an interactive installer, no arguments expected.". But those things could be followups I suppose, no need to delay this PR even further.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5648459823
> works, thanks! There would be still the question of how to uninstall it again, but I think this should probably be fine as initial implementation.
I suppose the install script could create an uninstall script that deletes the directory and the desktop file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5652291206
features would also have the potential to build on top of each other. E.g if the folder is non empty it could check for the uninstaller and run it first. If there is none, it would refuse installing. That way it could upgrade in place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-3760182918
> for me this is only if we don't want this PR for 1.0.0
>
> but we can go for a vote thread to have current nbpackage released as 1.0.0
Yes, I don't think we should merge this for 1.0.0 unless we plan on having more beta releases first (and personally I don't think we should do that). We had originally talked about stabilising the existing features and releasing 1.0.0. That needs a tidy up PR first to remove a few deprecated things. I will look at that next week, and aim to get a release vote started after that. Then we can merge this for the next release.
@oyarzun sorry for the delay and tangential discussion there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-4156180640
I'll do some further testing soon, and see if we can merge now that 1.0 is released. Would still appreciate another set of eyes on this - maybe @mbien or @homberghp have some thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2393183588
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
Agreed. I've switch to lowercase for local bash variables, used `package.tar.*` for tokens, and `_var_` for sed regex replacements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "oyarzun (via GitHub)" <gi...@apache.org>.
oyarzun commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387854301
##########
src/main/resources/org/apache/netbeans/nbpackage/shell/shell.script.template:
##########
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+APP_DIR=${APP_DIR}
+
+if ! [ $(id -u) = 0 ]; then
+ DEFAULT_INSTALL_PREFIX=$HOME/.local
+ DESKTOP_FILE_INSTALL_DIR=$HOME/.local/share/applications
+else
+ DEFAULT_INSTALL_PREFIX=/usr/local
+ DESKTOP_FILE_INSTALL_DIR=/usr/local/share/applications
+fi
+
+read -p "Enter ${APP_NAME} Install Prefix [${{DEFAULT_INSTALL_PREFIX}}]/${{APP_DIR}}: " INSTALL_PREFIX
Review Comment:
Right `${{APP_DIR}}` can be changed to `${APP_DIR}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#discussion_r2387986627
##########
src/main/java/org/apache/netbeans/nbpackage/StringUtils.java:
##########
@@ -30,11 +30,31 @@
public class StringUtils {
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
+ private static final Pattern SCRIPT_VAR_PATTERN = Pattern.compile("\\$\\{\\{(.+?)\\}\\}");
private StringUtils() {
// static utilities
}
+ /**
+ * Unescapes the bash variables in the script template
+ *
+ * @param template script template
+ * @return script with unescaped variables
+ */
+ public static String unescapeScriptVars(String script)
Review Comment:
Yes, there's `StringUtils::replaceTokens` where you want to leave any unmatched tokens as they are, and `StringUtils::replaceTokensOrFail` for where all tokens must be pre-defined. It was done like this to allow shell scripts and other contexts where the same `${...}` is needed.
Ideally, think about the naming in the script templates to make it clear which are replaced at build time though if you need both. Maybe the additional tokens like `APP_DIR` should be lower case in this one? Or make sure they all start with `APP_`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5492612023
Thanks for looking @mbien The desktop file spec says icons must be absolute paths or the name to look up. Given that this script already handles desktop file installation into `/usr/local/share` or `$HOME/.local/share` it might be good to copy the png and svg icons to the correct places instead?
Given no review from Pieter still, cc'ing @geertjanw instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5652334533
> That way it could upgrade in place.
That's a point - all existing packagers are designed to allow upgrade in place.
> no need to delay this PR even further.
I would like to see some input from FoAN people here before this is merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Add embedded tar script packager [netbeans-nbpackage]
Posted by "geertjanw (via GitHub)" <gi...@apache.org>.
geertjanw commented on PR #115:
URL: https://github.com/apache/netbeans-nbpackage/pull/115#issuecomment-5929035489
Thanks @oyarzun, and thanks for the ping @neilcsmith-net. From the FoAN side this looks useful: a distro-neutral installer with a desktop entry covers a real (or potential) gap for Linux users. Upgrade in place and an uninstaller would be useful, but those could come as follow-ups. No objection to merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists