From 4dd533048a6c49c748d3bd03b46e5091b5907caa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 26 Sep 2021 20:25:38 +0200 Subject: [PATCH] scripts: move migration script away from control scripts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58f91648c0bc703dd0665c339cf68e2cc4ba4a6e Author: vanhofen Date: 2021-09-26 (Sun, 26 Sep 2021) Origin message was: ------------------ - scripts: move migration script away from control scripts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/control/Makefile.am | 4 ---- data/scripts/Makefile.am | 4 +++- data/{control => scripts}/migration.sh.in | 1 - src/global.h | 3 --- src/neutrino.cpp | 4 +++- 5 files changed, 6 insertions(+), 10 deletions(-) rename data/{control => scripts}/migration.sh.in (95%) diff --git a/data/control/Makefile.am b/data/control/Makefile.am index ee4ba16cb..dd09f4394 100644 --- a/data/control/Makefile.am +++ b/data/control/Makefile.am @@ -1,6 +1,3 @@ -EXTRA_DIST = \ - migration.sh migration.sh.in - installdir = $(CONTROLDIR) install_SCRIPTS = \ @@ -9,7 +6,6 @@ install_SCRIPTS = \ deepstandby.on \ deepstandby.off \ inactivity.on \ - migration.sh \ movieplayer.start \ movieplayer.end \ neutrino.start \ diff --git a/data/scripts/Makefile.am b/data/scripts/Makefile.am index c8d186930..8852a3a05 100644 --- a/data/scripts/Makefile.am +++ b/data/scripts/Makefile.am @@ -2,13 +2,15 @@ EXTRA_DIST = \ backup.sh backup.sh.in \ restore.sh restore.sh.in \ backup_flash.sh backup_flash.sh.in \ - restore_flash.sh restore_flash.sh.in + restore_flash.sh restore_flash.sh.in \ + migration.sh migration.sh.in installdir = $(bindir) install_SCRIPTS = \ backup.sh \ restore.sh \ + migration.sh \ wakeup.sh \ install.sh diff --git a/data/control/migration.sh.in b/data/scripts/migration.sh.in similarity index 95% rename from data/control/migration.sh.in rename to data/scripts/migration.sh.in index 3f546f266..a7059e19c 100644 --- a/data/control/migration.sh.in +++ b/data/scripts/migration.sh.in @@ -60,6 +60,5 @@ for controlscript in $controlscripts; do fi done -# these control scripts hasn't counterparts in @CONTROLDIR_VAR@ rm -f migration.sh rm -f flash.start diff --git a/src/global.h b/src/global.h index 9ae58da09..37fecaae3 100644 --- a/src/global.h +++ b/src/global.h @@ -46,9 +46,6 @@ #define NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT "deepstandby.off" #define NEUTRINO_APP_START_SCRIPT "neutrino.start" -// control scripts w/o counterparts in /var -#define NEUTRINO_CONF_MIGRATION_SCRIPT CONTROLDIR "/migration.sh" - #define COVERDIR_TMP "/tmp/.cover" #define LOGODIR_TMP "/tmp/.logo" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 5c7760fd1..fa056e385 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -365,7 +365,9 @@ int CNeutrinoApp::loadSetup(const char *fname) int erg = 0; // execute migration script before loading configfile - my_system(NEUTRINO_CONF_MIGRATION_SCRIPT); + std::string migration_sh = find_executable("migration.sh"); + if (!migration_sh.empty()) + my_system(migration_sh.c_str()); configfile.clear(); // load settings; setup defaults