]> source.dussan.org Git - archiva.git/commitdiff
Adding patch for bash script
authorMartin Stockhammer <martin_s@apache.org>
Fri, 17 Dec 2021 21:06:21 +0000 (22:06 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Fri, 17 Dec 2021 21:06:21 +0000 (22:06 +0100)
archiva-jetty/pom.xml
archiva-jetty/src/main/patches/archiva.patch [new file with mode: 0644]

index 17250f7191317e53aa951e66928817c97af5e9f6..20ed18998fe7a30b0453bb98598849293709c056 100644 (file)
             <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>
           <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 (file)
index 0000000..61797f1
--- /dev/null
@@ -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