adding a patch to a port
David Banning
david at skytracker.ca
Fri Mar 28 17:54:49 PST 2003
I was given a patch for the dillo port which I don't quite
know how to configure. I wonder how I can take this format and
turn it into something I can use in the port. It seems that most
patches in the ports are separated as individual files while this one
has them in one file. Is there a simple way to reconfigure it
or is a test editor the only way?
A sample of the patch follows;
diff -pur dillo-0.7.1/dpi/bm_srv12.c dillo-0.7.1-mzz/dpi/bm_srv12.c
--- dillo-0.7.1/dpi/bm_srv12.c 2003-03-07 23:59:03.000000000 +0200
+++ dillo-0.7.1-mzz/dpi/bm_srv12.c 2003-03-29 03:17:52.000000000 +0200
@@ -855,6 +855,7 @@ int Bms_save()
BmSec *sec_node;
GSList *list, *list2;
GString *gstr = g_string_new("");
+ gchar *BmTmp;
struct stat BmStat;
/* make a safety backup */
@@ -864,8 +865,9 @@ int Bms_save()
g_free(BmFileBak);
}
+ BmTmp = g_strconcat(BmFile, ".tmp", NULL);
/* open bm file */
- if (!(BmTxt = fopen(BmFile, "w"))) {
+ if (!(BmTxt = fopen(BmTmp, "w"))) {
perror("[fopen]");
return 1;
}
@@ -895,6 +897,8 @@ int Bms_save()
g_string_free(gstr, TRUE);
fclose(BmTxt);
+ rename(BmTmp, BmFile);
+ g_free(BmTmp);
/* keep track of the timestamp */
stat(BmFile, &BmStat);
diff -pur dillo-0.7.1/src/IO/IO.c dillo-0.7.1-mzz/src/IO/IO.c
--- dillo-0.7.1/src/IO/IO.c 2003-03-09 17:25:53.000000000 +0200
+++ dillo-0.7.1-mzz/src/IO/IO.c 2003-03-29 03:17:52.000000000 +0200
@@ -572,7 +572,7 @@ void a_IO_ccc(int Op, int Branch, int Di
{
IOData_t *io = Data1;
- a_Chain_debug_msg("a_IO_ccc", Op, Branch, Dir);
+// a_Chain_debug_msg("a_IO_ccc", Op, Branch, Dir);
if (Branch == 1) {
if (Dir == BCK) {
diff -pur dillo-0.7.1/src/IO/Url.c dillo-0.7.1-mzz/src/IO/Url.c
--- dillo-0.7.1/src/IO/Url.c 2002-08-10 16:13:41.000000000 +0300
+++ dillo-0.7.1-mzz/src/IO/Url.c 2003-03-29 03:17:52.000000000 +0200
@@ -78,6 +78,7 @@ G_GNUC_UNUSED static gint Url_add_opener
ChainFunction_t a_Url_get_ccc_funct(const DilloUrl *Url)
{
static UrlMethod2_t cccList[] = { {"http" , a_Http_ccc},
+ {"https", a_Http_ccc},
{"file" , a_File_ccc},
{"about", a_About_ccc},
{"dpi" , a_Dpi_ccc} };
diff -pur dillo-0.7.1/src/IO/dpi.c dillo-0.7.1-mzz/src/IO/dpi.c
--- dillo-0.7.1/src/IO/dpi.c 2003-02-28 21:43:06.000000000 +0200
+++ dillo-0.7.1-mzz/src/IO/dpi.c 2003-03-29 03:17:52.000000000 +0200
@@ -253,6 +253,11 @@ static void Dpi_parse_token(conn_data_t
a_Chain_fcb(OpSend, conn->InfoRecv, msg, cmd);
More information about the freebsd-questions
mailing list