/*private string FindRpmSpecManager () * { * string RpmSpecMan = "Not Found"; * if (Environment.OSVersion.Platform == PlatformID.Unix) { * RpmSpecMan = UnixShell.StartProcess("which","rpmspecmanager","/",true); * } * else { * RpmSpecMan = "rpmspecmanager.exe"; * } * return RpmSpecMan; * }*/ private void LblDownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { saveFileDialog1.FileName = LblFsName.Text; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { SourceProjectPackageFile.GetSourceProjectPackageFile(Package, LblFsName.Text, saveFileDialog1.FileName, 4096, FsByteSize); } }
private void EditShowAFs() { string TmpFs = VarGlobal.MonoOBSFrameworkTmpDir + LblFsName.Text; string RpmSpecMan = VarGlobale.RpmSpecMPath; if (RpmSpecMan.IndexOf("rpmspecmanager", StringComparison.InvariantCultureIgnoreCase) > -1 & LblFsName.Text.EndsWith(".spec") == true & File.Exists(VarGlobale.RpmSpecMPath) == true) { StringBuilder SpecCont = new StringBuilder(SourceProjectPackageFile.GetSourceProjectPackageFile(Package, LblFsName.Text).ToString()); //if(!VarGlobal.LessVerbose)Console.WriteLine(SpecCont.ToString()); File.WriteAllText(TmpFs, SpecCont.ToString()); System.Diagnostics.Process PSpec = new System.Diagnostics.Process(); PSpec.StartInfo.FileName = RpmSpecMan; PSpec.StartInfo.Arguments = (char)(34) + TmpFs + (char)(34); PSpec.Start(); //PSpec.WaitForExit(); while (PSpec.HasExited == false) { Application.DoEvents(); } } else { Forms.EditShowFile Editor = new MonoOSC.Forms.EditShowFile(); Editor.SetFsName = LblFsName.Text; Editor.SetText = "Downloading " + LblFsName.Text; Editor.SetText = SourceProjectPackageFile.GetSourceProjectPackageFile(Package, LblFsName.Text).ToString(); Cursor = Cursors.Default; Editor.ShowDialog(); string XmlTemplate = Editor.SetText; File.WriteAllText(TmpFs, XmlTemplate); } if (MessageBox.Show("Update file on the server ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (!string.IsNullOrEmpty(File.ReadAllText(TmpFs))) { try { MessageBox.Show(PutSourceProjectPackageFile.PutFile(Package, TmpFs).ToString(), "Result Info", MessageBoxButtons.OK, MessageBoxIcon.Information); File.Delete(TmpFs); } catch (Exception Ex) { if (!VarGlobal.LessVerbose) { Console.WriteLine(Ex.Message + Environment.NewLine + Ex.StackTrace); } } finally { File.Delete(TmpFs); } } } }