From d087f89a40fc9f6ca3c13b98dc1e34ee6c72e105 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Fri, 31 May 2013 10:37:03 +0100 Subject: [PATCH] [c12586] Add delayed starting for mmap extraction to ExtractResources --- contrib/extractor_binary/ExtractResources.sh | 30 ++++++++++++++++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/contrib/extractor_binary/ExtractResources.sh b/contrib/extractor_binary/ExtractResources.sh index d746c36c9..40ad765ee 100644 --- a/contrib/extractor_binary/ExtractResources.sh +++ b/contrib/extractor_binary/ExtractResources.sh @@ -26,6 +26,7 @@ USE_AD="0" USE_VMAPS="0" USE_MMAPS="0" USE_MMAPS_OFFMESH="0" +USE_MMAPS_DELAY="" if [ "$1" = "a" ] then @@ -33,6 +34,7 @@ then USE_AD="1" USE_VMAPS="1" USE_MMAPS="1" + USE_MMAPS_DELAY="no" else ## do some questioning! echo @@ -58,7 +60,7 @@ else echo echo "Should mmaps be extracted? (y/n)" - echo "WARNING! This will take several hours!" + echo "WARNING! This will take several hours! (you can later tell to start delayed)" read line if [ "$line" = "y" ] then @@ -82,11 +84,13 @@ then exit 0 fi -## Obtain numbe ob processes +## MMap Extraction specific if [ "$USE_MMAPS" = "1" ] then + ## Obtain number of processes echo "How many CPUs should be used for extracting mmaps? (1-4)" read line + echo if [ "$line" -ge "1" -a "$line" -le "4" ] then NUM_CPU=$line @@ -94,10 +98,25 @@ then echo "Only number between 1 and 4 supported!" exit 1 fi + ## Extract MMaps delayed? + if [ "$USE_MMAPS_DELAY" != "no" ]; then + echo "MMap extraction can be started delayed" + echo "If you do _not_ want MMap Extraction to start delayed, just press return" + echo "Else enter number followed by s for seconds, m for minutes, h for hours" + echo "Example: \"3h\" - will start mmap extraction in 3 hours" + read -p"MMap Extraction Delay (leave blank for direct extraction): " USE_MMAPS_DELAY + echo + else + USE_MMAPS_DELAY="" + fi fi ## Give some status echo "Current Settings: Extract DBCs/maps: $USE_AD, Extract vmaps: $USE_VMAPS, Extract mmaps: $USE_MMAPS on $NUM_CPU processes" +if [ "$USE_MMAPS_DELAY" != "" ]; then + echo "MMap Extraction will be started delayed by $USE_MMAPS_DELAY" +fi +echo if [ "$1" != "a" ] then echo "If you don't like this settings, interrupt with CTRL+C" @@ -158,5 +177,10 @@ fi ## Extract mmaps if [ "$USE_MMAPS" = "1" ] then - MoveMapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE + if [ "$USE_MMAPS_DELAY" != "" ]; then + echo "Extracting of MMaps is set to be started delayed by $USE_MMAPS_DELAY" + echo "Current time: $(date)" + sleep $USE_MMAPS_DELAY + fi + sh MoveMapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE fi diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2b517d503..e1294a9d4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12585" + #define REVISION_NR "12586" #endif // __REVISION_NR_H__