diff --git a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php index 89e157c88..f43e416f7 100644 --- a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php @@ -9,14 +9,12 @@ require_once(dirname(__FILE__).'/../../include/AirtimeIni.php'); require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php'); - /** * This function creates the /etc/airtime configuration folder * and copies the default config files to it. */ function CreateIniFiles() { - global $AIRTIME_SRC; global $AIRTIME_PYTHON_APPS; if (!file_exists("/etc/airtime/")){ @@ -26,7 +24,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf.170", CONF_FILE_AIRTIME)){ + if (!copy("airtime.conf.170", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/airtime_mvc/build/airtime.conf.170 b/install_minimal/upgrades/airtime-1.7.0/airtime.conf.170 similarity index 100% rename from airtime_mvc/build/airtime.conf.170 rename to install_minimal/upgrades/airtime-1.7.0/airtime.conf.170 diff --git a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php index b38f0dde6..897555da6 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -59,7 +59,6 @@ foreach ($configFiles as $conf) { */ function CreateIniFiles() { - global $AIRTIME_SRC; global $AIRTIME_PYTHON_APPS; if (!file_exists("/etc/airtime/")){ @@ -69,7 +68,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf.180", CONF_FILE_AIRTIME)){ + if (!copy("airtime.conf.180", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/airtime_mvc/build/airtime.conf.180 b/install_minimal/upgrades/airtime-1.8.0/airtime.conf.180 similarity index 100% rename from airtime_mvc/build/airtime.conf.180 rename to install_minimal/upgrades/airtime-1.8.0/airtime.conf.180 diff --git a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php index 46b8f7ebd..dad5f18d1 100644 --- a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php @@ -112,7 +112,6 @@ function LoadConfig($CC_CONFIG) { */ function CreateIniFiles() { - global $AIRTIME_SRC; global $AIRTIME_PYTHON_APPS; if (!file_exists("/etc/airtime/")){ @@ -122,7 +121,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf.181", CONF_FILE_AIRTIME)){ + if (!copy("airtime.conf.181", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/airtime_mvc/build/airtime.conf.181 b/install_minimal/upgrades/airtime-1.8.1/airtime.conf.181 similarity index 100% rename from airtime_mvc/build/airtime.conf.181 rename to install_minimal/upgrades/airtime-1.8.1/airtime.conf.181 diff --git a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php index a19aee382..29d799669 100644 --- a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php @@ -112,7 +112,6 @@ function LoadConfig($CC_CONFIG) { */ function CreateIniFiles() { - global $AIRTIME_SRC; global $AIRTIME_PYTHON_APPS; if (!file_exists("/etc/airtime/")){ @@ -122,7 +121,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf.182", CONF_FILE_AIRTIME)){ + if (!copy("airtime.conf.182", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/airtime_mvc/build/airtime.conf.182 b/install_minimal/upgrades/airtime-1.8.2/airtime.conf.182 similarity index 100% rename from airtime_mvc/build/airtime.conf.182 rename to install_minimal/upgrades/airtime-1.8.2/airtime.conf.182 diff --git a/utils/airtime-import/airtime-import b/utils/airtime-import/airtime-import index 135b19252..ed62c8a72 100755 --- a/utils/airtime-import/airtime-import +++ b/utils/airtime-import/airtime-import @@ -3,6 +3,8 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/" . ${virtualenv_bin}activate +invokePwd=$PWD + airtime_import_path="/usr/lib/airtime/utils/airtime-import/" airtime_import_script="airtime-import.py" @@ -14,6 +16,6 @@ exec 2>&1 export PYTHONPATH=${api_client_path} # Note the -u when calling python! we need it to get unbuffered binary stdout and stderr -exec python -u ${airtime_import_path}${airtime_import_script} "$@" +exec python -u ${airtime_import_path}${airtime_import_script} --dir "$invokePwd" "$@" # EOF diff --git a/utils/airtime-import/airtime-import.py b/utils/airtime-import/airtime-import.py index bf369bc51..5d00a8f1d 100644 --- a/utils/airtime-import/airtime-import.py +++ b/utils/airtime-import/airtime-import.py @@ -33,6 +33,10 @@ api_client = api_client.api_client_factory(config) # flag should be 'copy' or 'move' def copy_or_move_files_to(paths, dest, flag): for path in paths: + if (path[0] == "/" or path[0] == "~"): + path = os.path.realpath(path) + else: + path = currentDir+path if(os.path.exists(path)): if(os.path.isdir(path)): path = format_dir_string(path) @@ -73,7 +77,7 @@ def helper_get_stor_dir(): def checkOtherOption(args): for i in args: - if('-' in i): + if(i[0] == '-'): return True def errorIfMultipleOption(args, msg=''): @@ -243,6 +247,11 @@ parser.add_option('--storage-dir-set', action='callback', callback=StorageSetAct parser.add_option('--storage-dir-get', action='callback', callback=StorageGetAction, help='Show the current storage dir.') parser.add_option('-h', '--help', dest='help', action='store_true', help='show this help message and exit') +# pop "--dir" +sys.argv.pop(1) +# pop "invoked pwd" +currentDir = sys.argv.pop(1)+'/' + if('-l' in sys.argv or '--link' in sys.argv): print "\nThe [-l][--link] option is deprecated. Please use the --watch-add option.\nTry 'airtime-import -h' for more detail.\n" sys.exit()