Skip to content

Apache Lucene open-source search software

SOLR-830: Use perl regex to improve accuracy of finding latest snapshot in snappuller

William Au177f90034358
diff --git a/CHANGES.txt b/CHANGES.txt
index 979920b9a9a..7dfcd6395d6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -125,8 +125,6 @@ Bug Fixes
11. SOLR-872: Better error message for incorrect copyField destination (Noble Paul via shalin)
-12. SOLR-346: Use perl regex to improve accuracy of finding latest snapshot in snapinstaller (billa)
-
Other Changes
----------------------
@@ -169,6 +167,10 @@ Bug Fixes
1. SOLR-802: Fix a potential null pointer error in the distributed FacetComponent
(David Bowen via ryan)
+ 2. SOLR-346: Use perl regex to improve accuracy of finding latest snapshot in snapinstaller (billa)
+
+ 3. SOLR-830: Use perl regex to improve accuracy of finding latest snapshot in snappuller (billa)
+
================== Release 1.3.0 20080915 ==================
diff --git a/src/scripts/snappuller b/src/scripts/snappuller
index 14b75679142..4bc94fc96df 100755
--- a/src/scripts/snappuller
+++ b/src/scripts/snappuller
@@ -178,7 +178,7 @@ fi
# get directory name of latest snapshot if not specified on command line
if [[ -z ${snap_name} ]]
then
- snap_name=`ssh -o StrictHostKeyChecking=no ${master_host} "ls ${master_data_dir}|grep 'snapshot\.'|grep -v wip|sort -r|head -1"`
+ snap_name=`ssh -o StrictHostKeyChecking=no ${master_host} "perl -e 'chdir q|${master_data_dir}|; print ((sort grep {/^snapshot[.][1-9][0-9]{13}$/} <*>)[-1])'"`
fi
if [[ "${snap_name}" == "" ]]
then