Improved user inputs in update pipelines

Change-Id: I2928ebcea77cc52434afbcb52b6e2f091c84ce0c
diff --git a/update-package.groovy b/update-package.groovy
index db5e99c..b17eb01 100644
--- a/update-package.groovy
+++ b/update-package.groovy
@@ -30,7 +30,7 @@
 
         if (TARGET_PACKAGES != "") {
             command = "pkg.install"
-            packages = TARGET_PACKAGES.split(' ')
+            packages = TARGET_PACKAGES.tokenize(' ')
         }
         else {
             command = "pkg.upgrade"
@@ -61,8 +61,20 @@
         }
 
         stage('Confirm live package upgrades on sample') {
-            timeout(time: 2, unit: 'HOURS') {
-               input message: "Approve live package upgrades on ${targetLiveSubset} nodes?"
+            if(TARGET_PACKAGES==""){
+                timeout(time: 2, unit: 'HOURS') {
+                    def userInput = input(
+                     id: 'userInput', message: 'Insert package names for update', parameters: [
+                     [$class: 'TextParameterDefinition', defaultValue: '', description: 'Package names (or *)', name: 'packages']
+                    ])
+                    if(userInput['packages'] != ""){
+                        packages = userInput['packages'].tokenize(" ")
+                    }
+                }
+            }else{
+                timeout(time: 2, unit: 'HOURS') {
+                   input message: "Approve live package upgrades on ${targetLiveSubset} nodes?"
+                }
             }
         }