|
|
|
|
@ -128,7 +128,7 @@ void on_load(){
|
|
|
|
|
else if (strstr(p,"Depends On")) packdepends = yon_char_new(steer);
|
|
|
|
|
}
|
|
|
|
|
gtk_tree_store_append(main_config.tree_store,&packIter,&iter);
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,path,3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,yon_char_unite(path,"/pool/overlay/",parameter_string,NULL),3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
for (int j=0;j<packsize;j++){
|
|
|
|
|
@ -145,12 +145,11 @@ void on_load(){
|
|
|
|
|
else if (strstr(p,"Depends On")) packdepends = yon_char_new(steer);
|
|
|
|
|
}
|
|
|
|
|
gtk_tree_store_append(main_config.tree_store,&packIter,&iter);
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,path,3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,yon_char_unite(path,"/pool/overlay/",parameter_string,NULL),3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_save(){
|
|
|
|
|
@ -217,23 +216,29 @@ void on_save(){
|
|
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&childIter,1,&pack_name,2,&pack_path,3,&pack_status,4,&pack_old_repo,5,&pack_new_repo,6,&moved,9,&pack_code_name,10,&pack_version,11,&pack_arch,12,&pack_depends,13,&pack_sign,14,&pack_signed,-1);
|
|
|
|
|
if (!pack_path) continue;
|
|
|
|
|
if (pack_status==1)
|
|
|
|
|
packnames = yon_char_unite(packnames ? yon_char_append(packnames," "):"",pack_code_name,NULL);
|
|
|
|
|
|
|
|
|
|
char *pack_sign_paths;
|
|
|
|
|
// if (pack_status==1){
|
|
|
|
|
pack_sign_paths = yon_char_new(pack_path);
|
|
|
|
|
yon_char_divide(pack_sign_paths,yon_char_find_last(pack_sign_paths,'/'));
|
|
|
|
|
packnames = yon_char_unite(packnames ? yon_char_append(packnames," "):"",pack_sign_paths,NULL);
|
|
|
|
|
// }
|
|
|
|
|
if (pack_sign&&pack_signed==1){
|
|
|
|
|
yon_char_divide_search(pack_sign,"<",-1);
|
|
|
|
|
pack_sign=yon_char_divide_search(pack_sign,">",-1);
|
|
|
|
|
if (!pack_groups||!(yon_dictionary_get(&pack_groups,pack_sign))){
|
|
|
|
|
dictionary *dict = yon_dictionary_new();
|
|
|
|
|
dict->key = pack_status == 1 ? pack_path : yon_char_unite("-f -d ",origin_flagged," -r ",name_flagged," --sign_pkg ", pack_sign," -p $(find ",origin_flagged,"/pool/overlay -name *", pack_code_name,".pkg.tar* -not -name *.sig)");
|
|
|
|
|
dict->key = pack_sign_paths;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(pack_groups,yon_char_new(pack_sign),dict);
|
|
|
|
|
} else {
|
|
|
|
|
dictionary *dict = yon_dictionary_new();
|
|
|
|
|
dict->key=pack_code_name;
|
|
|
|
|
dict->key = pack_sign_paths;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(pack_groups->data,yon_char_new(pack_sign),dict);
|
|
|
|
|
}
|
|
|
|
|
} else if (pack_status==1){
|
|
|
|
|
add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_code_name,NULL);
|
|
|
|
|
}
|
|
|
|
|
if (pack_status==1){
|
|
|
|
|
add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_path,NULL);
|
|
|
|
|
pack_path = yon_char_unite(origin_flagged,"/pool/overlay/",yon_char_divide(pack_path,yon_char_find_last(pack_path,'/')));
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&childIter,2,pack_path,-1);
|
|
|
|
|
} else if (pack_status==-1){
|
|
|
|
|
remove_packages = yon_char_unite(remove_packages ? yon_char_append(remove_packages,",") : "",pack_code_name,NULL);
|
|
|
|
|
}
|
|
|
|
|
@ -257,20 +262,6 @@ void on_save(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (origin_flagged&&name_flagged){
|
|
|
|
|
if (pack_groups){
|
|
|
|
|
dictionary *dct;
|
|
|
|
|
for_dictionaries(dct,pack_groups){
|
|
|
|
|
char *signed_packs=NULL;
|
|
|
|
|
dictionary *pck;
|
|
|
|
|
for_dictionaries(pck,yon_dictionary_get_data(dct,dictionary*)){
|
|
|
|
|
signed_packs=yon_char_unite(signed_packs ? yon_char_append(signed_packs,","): "" ,pck->key,NULL);
|
|
|
|
|
} char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL;
|
|
|
|
|
repo_sign_flagged=NULL;
|
|
|
|
|
char *sign_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged, sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" , " --sign-pkg ", dct->key, " -p ", signed_packs,NULL);
|
|
|
|
|
system(sign_command);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (add_packages){
|
|
|
|
|
char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL;
|
|
|
|
|
repo_sign_flagged=NULL;
|
|
|
|
|
@ -289,6 +280,21 @@ void on_save(){
|
|
|
|
|
if (add_signed_command){/*printf("%s\n",add_signed_command);*/ system(add_signed_command);}
|
|
|
|
|
if (add_command) {/*printf("%s\n",add_command);*/system(add_command);}
|
|
|
|
|
if (remove_command) {/*printf("%s\n",remove_command);*/system(remove_command);}
|
|
|
|
|
if (pack_groups){
|
|
|
|
|
dictionary *dct;
|
|
|
|
|
for_dictionaries(dct,pack_groups){
|
|
|
|
|
char *signed_packs=NULL;
|
|
|
|
|
dictionary *pck;
|
|
|
|
|
for_dictionaries(pck,yon_dictionary_get_data(dct,dictionary*)){
|
|
|
|
|
signed_packs=yon_char_unite(signed_packs ? yon_char_append(signed_packs,","): "" ,pck->key,NULL);
|
|
|
|
|
} char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL;
|
|
|
|
|
repo_sign_flagged=NULL;
|
|
|
|
|
char *sign_command = yon_char_unite(command, " add -f -d ",origin_flagged," -r ",name_flagged," --sign-pkg ", dct->key," -p $(find ",origin_flagged,"/pool/overlay -name ", signed_packs,")",NULL);
|
|
|
|
|
printf("%s\n",sign_command);
|
|
|
|
|
system(sign_command);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -419,7 +425,8 @@ void on_sign_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
repo_sign_window *window = yon_dictionary_get_data(dict->first->next,repo_sign_window*);
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store);
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&model,&iter)){
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&iter,13,(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->KeysCombo)),14,1,-1);
|
|
|
|
|
char *key = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->KeysCombo));
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,&iter,13,key,14,1,-1);
|
|
|
|
|
}
|
|
|
|
|
on_tree_selection_changed(self,widgets);
|
|
|
|
|
on_close_subwindow(self);
|
|
|
|
|
@ -434,20 +441,29 @@ void on_repo_sign(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
window->SaveButton = yon_gtk_builder_get_widget(builder,"repoSignSaveButton");
|
|
|
|
|
window->CloseButton = yon_gtk_builder_get_widget(builder,"repoSignCancelButton");
|
|
|
|
|
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str ret = yon_config_load(get_gpg_keys_command,&size);
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
ret[i] = yon_char_divide_search(ret[i],"\n",-1);
|
|
|
|
|
if (!strstr(ret[i],"]")&&!strstr(ret[i],"["))
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->KeysCombo),ret[i]);
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&model,&iter)){
|
|
|
|
|
if (gtk_tree_store_iter_depth(main_config.tree_store,&iter)==1)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL( window->HeaderLabel),yon_char_unite(DIGITAL_SIGNATURE_LABEL," - ",PACKAGE_LABEL,NULL));
|
|
|
|
|
else
|
|
|
|
|
gtk_label_set_text(GTK_LABEL( window->HeaderLabel),yon_char_unite(DIGITAL_SIGNATURE_LABEL," - ",REPOSITORY_LABEL,NULL));
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str ret = yon_config_load(get_gpg_keys_command,&size);
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
ret[i] = yon_char_divide_search(ret[i],"\n",-1);
|
|
|
|
|
if (!strstr(ret[i],"]")&&!strstr(ret[i],"["))
|
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->KeysCombo),ret[i]);
|
|
|
|
|
}
|
|
|
|
|
dictionary *dict = yon_dictionary_new_with_data("",widgets);
|
|
|
|
|
dict = yon_dictionary_append_with_data(dict,"",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_sign_save),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CloseButton),"clicked", G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(SIGN_CHOOSE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
dictionary *dict = yon_dictionary_new_with_data("",widgets);
|
|
|
|
|
dict = yon_dictionary_append_with_data(dict,"",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_sign_save),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CloseButton),"clicked", G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repo_configure(GtkWidget *self, main_window *widgets){
|
|
|
|
|
@ -628,7 +644,7 @@ void yon_add_file(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
GtkTreeIter *iter = yon_repo_append(widgets,filename,YON_REPO_LINE_FILE_TYPE);
|
|
|
|
|
gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->RepoTree),gtk_tree_model_get_path(GTK_TREE_MODEL(main_config.tree_store),iter));
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,filename,9,packname,10,packver,11,packarch,12,packdepends,-1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
on_tree_selection_changed(NULL,widgets);
|
|
|
|
|
@ -870,6 +886,9 @@ int main(int argc, char *argv[]){
|
|
|
|
|
gtk_paned_set_position(GTK_PANED(widgets->MovePaned),400);
|
|
|
|
|
|
|
|
|
|
on_load();
|
|
|
|
|
GtkTreeIter *iter = g_malloc0(sizeof(GtkTreeIter));
|
|
|
|
|
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.tree_store),iter))
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),iter);
|
|
|
|
|
GtkCssProvider *css=gtk_css_provider_new();
|
|
|
|
|
gtk_css_provider_load_from_resource(css,CssPath);
|
|
|
|
|
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
|
|
|
|
|
|