From 856bfc8ef48db38b6134af50272493a117779b71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Thu, 17 Oct 2019 15:14:20 +0200
Subject: [PATCH] bumped plugin version, renamed plugin, fixed paths in plugin
 code

---
 PLUGIN-INF/metadata_ppa_plugin.xml |  4 ++--
 plugin/ppa_plugin.sh               | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/PLUGIN-INF/metadata_ppa_plugin.xml b/PLUGIN-INF/metadata_ppa_plugin.xml
index 3678c98..f166090 100644
--- a/PLUGIN-INF/metadata_ppa_plugin.xml
+++ b/PLUGIN-INF/metadata_ppa_plugin.xml
@@ -1,10 +1,10 @@
 <!-- Documentation: https://developers.exlibrisgroup.com/rosetta/integrations/plugins/ -->
 <pl:metadata-config xmlns:pl="http://www.exlibrisgroup.com/Plugins/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 	<pl:pluginTypeName>MigrationToolPlugin</pl:pluginTypeName>
-	<pl:deployName>Migration DUMMY Plugin</pl:deployName>
+	<pl:deployName>Migration Plugin DUMMY</pl:deployName>
 	<pl:description>Dummy for a MigrationPlugin that just copies original file to new file</pl:description>
 	<pl:module>Preservation</pl:module>
-	<pl:version>0.2</pl:version>
+	<pl:version>0.3</pl:version>
 	<pl:materialType>DIGITAL</pl:materialType>
 	<pl:generalType>TASK</pl:generalType>
 	<pl:implType>script</pl:implType>
diff --git a/plugin/ppa_plugin.sh b/plugin/ppa_plugin.sh
index a6150aa..eb36f52 100755
--- a/plugin/ppa_plugin.sh
+++ b/plugin/ppa_plugin.sh
@@ -3,18 +3,20 @@
 #########
 # Documentation: https://developers.exlibrisgroup.com/rosetta/integrations/plugins/migrationtool/
 # shamelessly copied and slightly modified from: https://developers.exlibrisgroup.com/blog/Creating-a-Migration-Tool-Split-Plug-in/
+# with modifications as suggested by SupportCase 00712430
 # by: Jörg Sachse, Joerg.Sachse@slub-dresden.de
-# at: 2019-07-29
-# last shellcheck run: 2019-07-29 13:06
+# created at: 2019-07-29
+# last shellcheck run: 2019-10-17 15:10
 #########
 
 # wrap all but the last two parameters
 for (( i=1; i<$#-1; i=i+1 )); do
-    ARGS="$ARGS ${!i}"
+	ARGS="$ARGS ${!i}"
 done
 
-INPUT_FILE="${!i}"
-i=$(( i+1 ))
+INPUT_PATH="${!i}"
+INPUT_FILE="$( basename ${INPUT_PATH} )"
+(( i++ ))
 OUTPUT_DIR="${!i}"
 
 if [[ ! -e "${OUTPUT_DIR}" ]]; then
@@ -22,6 +24,6 @@ if [[ ! -e "${OUTPUT_DIR}" ]]; then
 fi
 
 # cp "$INPUT_FILE" "$ARGS" "$OUTPUT_DIR/$INPUT_FILE"
-cp "$INPUT_FILE" "$OUTPUT_DIR/$INPUT_FILE"
+cp "$INPUT_PATH" "$OUTPUT_DIR/$INPUT_FILE"
  
 exit $?
-- 
GitLab