Patch level :10.0 nuovo CD
Files correlati : Ricompilazione Demo : [ ] Commento :aggiunto il generatore dei txt per le patch git-svn-id: svn://10.65.10.50/trunk@16068 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7be186e709
commit
a8b4b2d1dc
110
ba/ba1600.cpp
110
ba/ba1600.cpp
@ -332,7 +332,7 @@ void TInstall_ini::export_module_paragraphs(const char* module, const char* summ
|
||||
}
|
||||
else
|
||||
{
|
||||
TFconv_ini fconv; //
|
||||
TFconv_ini fconv;
|
||||
path = inst.name().path();
|
||||
path.add(module); path << "fconv.ini";
|
||||
fconv.export_module(module, path);
|
||||
@ -440,31 +440,33 @@ void TInstall_ini::prices(const char* module, word users, real& full, real& assi
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void TFconv_ini::export_module(const char* module, const char* summary)
|
||||
{
|
||||
const word module_code = dongle().module_name2code(module);
|
||||
|
||||
TConfig sommario(summary);
|
||||
|
||||
{
|
||||
TString_array paragraphs;
|
||||
list_paragraphs(paragraphs);
|
||||
paragraphs.sort();
|
||||
|
||||
FOR_EACH_ARRAY_ROW(paragraphs, p, para)
|
||||
|
||||
if (paragraphs.items() > 0) //solo se c'e' qualcosa nel file conv deve creare XXfconv
|
||||
{
|
||||
TAssoc_array& variables = list_variables(*para);
|
||||
FOR_EACH_ASSOC_STRING(variables, obj, key, str)
|
||||
paragraphs.sort();
|
||||
|
||||
TConfig sommario(summary);
|
||||
const word module_code = dongle().module_name2code(module);
|
||||
FOR_EACH_ARRAY_ROW(paragraphs, p, para)
|
||||
{
|
||||
const char* parenthesis = strchr(key, '(');
|
||||
if (parenthesis)
|
||||
TAssoc_array& variables = list_variables(*para);
|
||||
FOR_EACH_ASSOC_STRING(variables, obj, key, str)
|
||||
{
|
||||
const int logic_num = atoi(parenthesis+1);
|
||||
if (logic_num > 0)
|
||||
const char* parenthesis = strchr(key, '(');
|
||||
if (parenthesis)
|
||||
{
|
||||
TDir dirinfo; dirinfo.get(logic_num);
|
||||
const long flags = dirinfo.flags() % 10000;
|
||||
if (flags == module_code)
|
||||
sommario.set(key, str, module);
|
||||
}
|
||||
const int logic_num = atoi(parenthesis+1);
|
||||
if (logic_num > 0)
|
||||
{
|
||||
TDir dirinfo; dirinfo.get(logic_num);
|
||||
const long flags = dirinfo.flags() % 10000;
|
||||
if (flags == module_code)
|
||||
sommario.set(key, str, module);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1431,13 +1433,15 @@ bool TCreadischi_mask::creazip_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
// creazione XXfconv.ini (esporta le info di conversione )
|
||||
TFilename fconv_path;
|
||||
TFconv_ini fconv; //
|
||||
fconv_path = fm.get(F_DISKPATH);
|
||||
fconv_path.add(module); fconv_path << "fconv.ini";
|
||||
fconv_path.add(module);
|
||||
fconv_path << "fconv.ini";
|
||||
|
||||
TFconv_ini fconv;
|
||||
fconv.export_module(module, fconv_path);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TCreadischi_mask::why_handler(TMask_field& f, KEY k)
|
||||
@ -1955,33 +1959,55 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
TString_array arr;
|
||||
TInstall_ini ini;
|
||||
|
||||
TFilename sommario; sommario.tempdir();
|
||||
TFilename sommario; //e' il file .ini con l'elenco dei files (XX@@@@a.ini)
|
||||
TFilename sommario_txt; //e' il file .txt con l'elenco dei files (XX@@@@.txt)
|
||||
|
||||
sommario.tempdir();
|
||||
sommario.add(main_module);
|
||||
|
||||
if (agg)
|
||||
{
|
||||
if (patch_level <= 0)
|
||||
return error_box(TR("Il numero di patch deve essere superiore a zero"));
|
||||
TString16 name;
|
||||
name.format("%04da.ini", patch_level);
|
||||
|
||||
//crea i nomi del file .ini e del .txt con l'elenco dei files (il .txt NON ci vuole in caso di pacco di..
|
||||
//..installazione completo tipo XXinst.ini)
|
||||
//File .ini
|
||||
TString16 name, name_txt;
|
||||
name.format("%04da.ini", patch_level); //.ini
|
||||
sommario << name; // Nome del file sommario aggiornamento
|
||||
}
|
||||
else
|
||||
sommario << "inst.ini"; // Nome del file sommario completo
|
||||
|
||||
//riempie arr, TString_array con i files da caricare (sono quelli elencati nel .ini e contenuti nel .zip)
|
||||
ini.build_complete_list(main_module, arr, sommario, agg);
|
||||
|
||||
//se non ci sono files lascia perdere
|
||||
if (arr.items() == 0)
|
||||
{
|
||||
::remove(sommario);
|
||||
return error_box(TR("Nessun file da compattare"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//e' il momento di compilare il .txt con l'elenco files per il prode testatore
|
||||
if (agg && !arr.empty())
|
||||
{
|
||||
//File .txt
|
||||
sommario_txt.format("%s%s%04d.txt",
|
||||
(const char*)sommario.path(), (const char*)main_module, patch_level);
|
||||
ofstream txt(sommario_txt);
|
||||
FOR_EACH_ARRAY_ROW(arr, r, row)
|
||||
txt << row->get(0) << endl;
|
||||
}
|
||||
|
||||
const TFilename path = get(F_DISKPATH);
|
||||
// *****************
|
||||
// creazione ZIP
|
||||
TFilename archivio(sommario);
|
||||
archivio.ext("zip"); // Nome del file archivio completo
|
||||
|
||||
bool aborted = FALSE;
|
||||
bool aborted = false;
|
||||
// ******************
|
||||
// compilazione lista e relativa firma dei files
|
||||
TString msg;
|
||||
@ -1993,12 +2019,12 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
TFilename filelist;
|
||||
filelist.temp("", main_module);
|
||||
struct _stat info;
|
||||
time_t lasttime=0;
|
||||
time_t lasttime = 0;
|
||||
|
||||
// blocco della prima Progind
|
||||
{
|
||||
ofstream fileh(filelist);
|
||||
TProgind pi(arr.items(), msg, TRUE, TRUE);
|
||||
TProgind pi(arr.items(), msg, true, true);
|
||||
TFilename cmd;
|
||||
|
||||
FOR_EACH_ARRAY_ROW_BACK(arr, i, row)
|
||||
@ -2006,7 +2032,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
pi.addstatus(1);
|
||||
if (pi.iscancelled())
|
||||
{
|
||||
aborted = TRUE;
|
||||
aborted = true;
|
||||
break;
|
||||
}
|
||||
cmd = row->get(0);
|
||||
@ -2021,7 +2047,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
set_version_info(cmd, ini, submod);
|
||||
}
|
||||
_stat((const char *)cmd,&info);
|
||||
lasttime = max(lasttime,info.st_mtime);
|
||||
lasttime = max(lasttime, info.st_mtime);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2030,7 +2056,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
msg << TR("Impossibile aprire il file ") << cmd << TR(". Interrompere?");
|
||||
if (yesno_box(msg))
|
||||
{
|
||||
aborted = TRUE;
|
||||
aborted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2042,8 +2068,9 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
if (path.blank())
|
||||
{
|
||||
message_box(TR("Nessun percorso specificato. Il pacchetto non verra' creato"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
TFilename zipfile = path;
|
||||
zipfile.add(archivio.name());
|
||||
zipfile.ext("");
|
||||
@ -2073,8 +2100,9 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
}
|
||||
if (aborted)
|
||||
{
|
||||
::remove(sommario);
|
||||
::remove(filelist); // elimina il file lista-file
|
||||
::remove(sommario); //elimina il .ini
|
||||
::remove(sommario_txt); //elimina il .txt
|
||||
::remove(filelist); //elimina il file lista-file
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2109,9 +2137,13 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
pi.addstatus(1);
|
||||
do_events();
|
||||
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (d == 1)
|
||||
{
|
||||
ok = move_file(sommario, path);
|
||||
if (sommario_txt.exist())
|
||||
move_file(sommario_txt, path);
|
||||
}
|
||||
if (ok)
|
||||
ok = move_file(src, path);
|
||||
aborted = !ok || pi.iscancelled();
|
||||
@ -2124,7 +2156,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
fcopy("install.ini",(const char *)archivio);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
TCreadischi_mask::TCreadischi_mask()
|
||||
|
@ -25,6 +25,7 @@
|
||||
#define S_CREATEZIP 151
|
||||
#define S_CREATEPATCH 152
|
||||
#define S_TESTPATCH 153
|
||||
#define S_CREATETXT 154
|
||||
#define S_IMPORT 160
|
||||
#define S_EXPORT 161
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user