How do I add a local patch to a port?
I have generated a patch that I want to apply to a port. I don't know how to tell the port to use it though. Just putting it in the files directory didn't seem to do the trick. What else do I need to do to? -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
Shaun T. Erickson wrote: I have generated a patch that I want to apply to a port. I don't know how to tell the port to use it though. Just putting it in the files directory didn't seem to do the trick. What else do I need to do to? I looked at the porter's handbook, and it says that simply dropping the patch into the files directory should get it automatically applied, but it's not. The patch is named patch-aa and is relative to the WRKSRC directory. Suggestions? -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
At 13:04 09.03.2004 -0500, Shaun T. Erickson wrote: Shaun T. Erickson wrote: ... I looked at the porter's handbook, and it says that simply dropping the patch into the files directory should get it automatically applied, but it's not. The patch is named patch-aa and is relative to the WRKSRC directory. Suggestions? Patching the wrong file? Patching an already patched file? Patching in wrong direction: old --- new exchanged by accident? directory for patch ok? shouldn't it be relative to extracted sources dir within WRKSRC? Just what came in my mind... Alexander ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
Alexander Haderer wrote: At 13:04 09.03.2004 -0500, Shaun T. Erickson wrote: Shaun T. Erickson wrote: ... I looked at the porter's handbook, and it says that simply dropping the patch into the files directory should get it automatically applied, but it's not. The patch is named patch-aa and is relative to the WRKSRC directory. Suggestions? Patching the wrong file? Patching an already patched file? Patching in wrong direction: old --- new exchanged by accident? directory for patch ok? shouldn't it be relative to extracted sources dir within WRKSRC? Well, cd'ing into the work directory and then into the source directory and saying: patch patchfile correctly patches the file ./dir/file2bepatched So, if patchfile is in the files directory, it ough to just work, yes? But it isn't. -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
At 13:41 09.03.2004 -0500, Shaun T. Erickson wrote: ... Well, cd'ing into the work directory and then into the source directory and saying: patch patchfile correctly patches the file ./dir/file2bepatched So, if patchfile is in the files directory, it ough to just work, yes? But it isn't. Just another guess: Probably it makes a difference if the patchfile patches ./dir/tobepatched and dir/tobepatched. A brief look into other ports shows me that the latter is used. I don't know if it have to be this way or not. Alexander ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
Alexander Haderer wrote: Just another guess: Probably it makes a difference if the patchfile patches ./dir/tobepatched and dir/tobepatched. A brief look into other ports shows me that the latter is used. I don't know if it have to be this way or not. Ok. I'm trying to patch /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17/saslauthd/auth_pam.c. The patchfile is named patch-aa and is located in /usr/ports/security/cyrus-sasl2-saslauthd/files. Here is the contents of the patchfile that works manually, when I cd to /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17 and run patch /usr/ports/security/cyrus-sasl2-saslauthd/files/patch-aa: Index: saslauthd/auth_pam.c diff -u saslauthd/auth_pam.c.orig saslauthd/auth_pam.c --- saslauthd/auth_pam.c.orig Sat May 31 13:00:24 2003 +++ saslauthd/auth_pam.cTue Mar 9 11:53:44 2004 @@ -178,7 +178,7 @@ const char *login, /* I: plaintext authenticator */ const char *password,/* I: plaintext password */ const char *service, /* I: service name */ - const char *realm __attribute__((unused)) + const char *realm /* END PARAMETERS */ ) { @@ -186,17 +186,25 @@ pam_appdata my_appdata;/* application specific data */ struct pam_conv my_conv; /* pam conversion data */ pam_handle_t *pamh;/* pointer to PAM handle */ +char user[256]; int rc;/* return code holder */ /* END VARIABLES */ -my_appdata.login = login; +strlcpy(user, login, 256); + +if (realm) { +strlcat(user, @, 256); +strlcat(user, realm, 256); +} + +my_appdata.login = user; my_appdata.password = password; my_appdata.pamh = NULL; my_conv.conv = saslauthd_pam_conv; my_conv.appdata_ptr = my_appdata; -rc = pam_start(service, login, my_conv, pamh); +rc = pam_start(service, user, my_conv, pamh); if (rc != PAM_SUCCESS) { syslog(LOG_DEBUG, DEBUG: auth_pam: pam_start failed: %s, pam_strerror(pamh, rc)); It all looks right to me, but when I do a make clean follwed by a make, the file does not get patched. What am I doing wrong? -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
On Tue, Mar 09, 2004 at 02:44:26PM -0500, Shaun T. Erickson wrote: Date: Tue, 09 Mar 2004 14:44:26 -0500 From: Shaun T. Erickson [EMAIL PROTECTED] To: Alexander Haderer [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: How do I add a local patch to a port? Alexander Haderer wrote: Just another guess: Probably it makes a difference if the patchfile patches ./dir/tobepatched and dir/tobepatched. A brief look into other ports shows me that the latter is used. I don't know if it have to be this way or not. Ok. I'm trying to patch /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17/saslauthd/auth_pam.c. The patchfile is named patch-aa and is located in /usr/ports/security/cyrus-sasl2-saslauthd/files. Here is the contents of the patchfile that works manually, when I cd to /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17 and run patch /usr/ports/security/cyrus-sasl2-saslauthd/files/patch-aa: Index: saslauthd/auth_pam.c diff -u saslauthd/auth_pam.c.orig saslauthd/auth_pam.c --- saslauthd/auth_pam.c.orig Sat May 31 13:00:24 2003 +++ saslauthd/auth_pam.cTue Mar 9 11:53:44 2004 @@ -178,7 +178,7 @@ const char *login, /* I: plaintext authenticator */ const char *password,/* I: plaintext password */ const char *service, /* I: service name */ - const char *realm __attribute__((unused)) + const char *realm /* END PARAMETERS */ ) { @@ -186,17 +186,25 @@ pam_appdata my_appdata;/* application specific data */ struct pam_conv my_conv; /* pam conversion data */ pam_handle_t *pamh;/* pointer to PAM handle */ +char user[256]; int rc;/* return code holder */ /* END VARIABLES */ -my_appdata.login = login; +strlcpy(user, login, 256); + +if (realm) { +strlcat(user, @, 256); +strlcat(user, realm, 256); +} + +my_appdata.login = user; my_appdata.password = password; my_appdata.pamh = NULL; my_conv.conv = saslauthd_pam_conv; my_conv.appdata_ptr = my_appdata; -rc = pam_start(service, login, my_conv, pamh); +rc = pam_start(service, user, my_conv, pamh); if (rc != PAM_SUCCESS) { syslog(LOG_DEBUG, DEBUG: auth_pam: pam_start failed: %s, pam_strerror(pamh, rc)); It all looks right to me, but when I do a make clean follwed by a make, the file does not get patched. What am I doing wrong? Put the patch in security/cyrus-sasl2/files directory. Take a look in port's Makefile where ${PATCHDIR} is set to different location. -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Dancho Penev GnuGP public key: http://www.mnet.bg/~dpenev/gnupg.key Key fingerprint: E88D 8B7B 3EF6 E9C8 C5D2 7554 2AA8 C347 71A1 4277 pgp0.pgp Description: PGP signature
Re: How do I add a local patch to a port?
Dancho Penev wrote: Put the patch in security/cyrus-sasl2/files directory. Take a look in port's Makefile where ${PATCHDIR} is set to different location. Aha! That solved it. Thanks. -ste ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How do I add a local patch to a port?
Hi, although your question has already been answered: I have attached a script that will create the patches for you (yes, it's very bad perl code, I know, but it creates nice patches of the from patch-dir1::dir2::filename ;-) Simply remember to copy the source files to filename.orig before editing them. Once you are done, cd to ${WRKSRC}, run the script and copy the _relevant_ patches to the files directory. Please note that it will also create patch files for those modifications, that came from a `make patch' run. Simon pgp0.pgp Description: PGP signature
Re: How do I add a local patch to a port?
Argh the mailing list software stripped the attachment, so here it is: #!/usr/bin/perl -w use strict; my $origfile; my $file; my $patch; my @files = `find . -name *.orig`; foreach $origfile (@files) { chomp ($origfile); $origfile =~ s/^\.\///; $file = $origfile; $file =~ s/\.orig$//; $patch = $file; $patch =~ s/\//::/g; $patch = patch- . $patch; system (diff -u $origfile $file $patch\n); } pgp0.pgp Description: PGP signature