You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2021/12/17 21:06:25 UTC

[archiva] branch archiva-2.x updated: Adding patch for bash script

This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch archiva-2.x
in repository https://gitbox.apache.org/repos/asf/archiva.git


The following commit(s) were added to refs/heads/archiva-2.x by this push:
     new bd08703  Adding patch for bash script
bd08703 is described below

commit bd087030423e35d4bf252f48fe37839e4a976ee0
Author: Martin Stockhammer <ma...@apache.org>
AuthorDate: Fri Dec 17 22:06:21 2021 +0100

    Adding patch for bash script
---
 archiva-jetty/pom.xml                        |  2 ++
 archiva-jetty/src/main/patches/archiva.patch | 41 ++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/archiva-jetty/pom.xml b/archiva-jetty/pom.xml
index 17250f7..20ed189 100644
--- a/archiva-jetty/pom.xml
+++ b/archiva-jetty/pom.xml
@@ -229,6 +229,7 @@
             <configuration>
               <tasks>
                 <replaceregexp file="target/generated-resources/appassembler/jsw/archiva/conf/wrapper.conf" match="set.ARCHIVA_BASE" replace="set.default.ARCHIVA_BASE" />
+                <patch failonerror="true" originalfile="target/generated-resources/appassembler/jsw/archiva/bin/archiva" patchfile="src/main/patches/archiva.patch" />
               </tasks>
             </configuration>
             <goals>
@@ -270,6 +271,7 @@
           <configuration>
             <excludes>
               <exclude>src/main/conf/**</exclude>
+              <exclude>src/main/patches/*.patch</exclude>
             </excludes>
           </configuration>
         </plugin>
diff --git a/archiva-jetty/src/main/patches/archiva.patch b/archiva-jetty/src/main/patches/archiva.patch
new file mode 100644
index 0000000..61797f1
--- /dev/null
+++ b/archiva-jetty/src/main/patches/archiva.patch
@@ -0,0 +1,41 @@
+--- target/generated-resources/appassembler/jsw/archiva/bin/archiva	2021-12-17 21:30:22.738291117 +0100
++++ target/generated-resources/appassembler/jsw/archiva/bin/archiva.new	2021-12-17 21:32:39.040022280 +0100
+@@ -40,20 +40,24 @@
+ APP_NAME="archiva"
+ APP_LONG_NAME="Apache Archiva"
+ 
+-# discover BASEDIR
+-BASEDIR=`dirname "$0"`/..
+-BASEDIR=`(cd "$BASEDIR"; pwd)`
+-ls -l "$0" | grep -e '->' > /dev/null 2>&1
+-if [ $? = 0 ]; then
+-  #this is softlink
+-  _PWD=`pwd`
+-  _EXEDIR=`dirname "$0"`
+-  cd "$_EXEDIR"
+-  _BASENAME=`basename "$0"`
+-  _REALFILE=`ls -l "$_BASENAME" | sed 's/.*->\ //g'`
+-   BASEDIR=`dirname "$_REALFILE"`/..
+-   BASEDIR=`(cd "$BASEDIR"; pwd)`
+-   cd "$_PWD"
++if [ -z "$ARCHIVA_BASE" ]; then
++  # discover BASEDIR
++  BASEDIR=`dirname "$0"`/..
++  BASEDIR=`(cd "$BASEDIR"; pwd)`
++  ls -l "$0" | grep -e '->' > /dev/null 2>&1
++  if [ $? = 0 ]; then
++    #this is softlink
++    _PWD=`pwd`
++    _EXEDIR=`dirname "$0"`
++    cd "$_EXEDIR"
++    _BASENAME=`basename "$0"`
++    _REALFILE=`ls -l "$_BASENAME" | sed 's/.*->\ //g'`
++     BASEDIR=`dirname "$_REALFILE"`/..
++     BASEDIR=`(cd "$BASEDIR"; pwd)`
++     cd "$_PWD"
++  fi
++else
++  BASEDIR="$ARCHIVA_BASE"
+ fi
+ 
+