* bug#30547: Hurd patch for `patch` does not apply to latest release
@ 2018-02-20 12:20 Leo Famulari
2018-02-20 15:31 ` Manolis Ragkousis
0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2018-02-20 12:20 UTC (permalink / raw)
To: 30547
[-- Attachment #1: Type: text/plain, Size: 289 bytes --]
There is a new version of GNU Patch, 2.7.6:
https://ftp.gnu.org/gnu/patch/
I noticed that our patch, 'patch-hurd-path-max.patch', doesn't apply. I
have an idea of how to adapt the patch, but I don't really have a way to
test it.
Manolis, are you able to adapt the patch to Patch 2.7.6?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#30547: Hurd patch for `patch` does not apply to latest release
2018-02-20 12:20 bug#30547: Hurd patch for `patch` does not apply to latest release Leo Famulari
@ 2018-02-20 15:31 ` Manolis Ragkousis
2019-02-26 1:40 ` Leo Famulari
0 siblings, 1 reply; 3+ messages in thread
From: Manolis Ragkousis @ 2018-02-20 15:31 UTC (permalink / raw)
To: leo, 30547
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
Hello Leo,
On 02/20/18 14:20, Leo Famulari wrote:
> There is a new version of GNU Patch, 2.7.6:
>
> https://ftp.gnu.org/gnu/patch/
>
> I noticed that our patch, 'patch-hurd-path-max.patch', doesn't apply. I
> have an idea of how to adapt the patch, but I don't really have a way to
> test it.
>
> Manolis, are you able to adapt the patch to Patch 2.7.6?
>
I rebased the patch on the latest patch master. The only thing I am not
sure is why the old patch was changing PATH_MAX with tost->st_size + 1.
I can't remember for the life of me. Also I can't remember why this
patch isn't part of patch upstream yet.
The old diff
- char *buffer = xmalloc (PATH_MAX);
+ char *buffer = xmalloc (tost->st_size + 1);
while now I made it:
- char *buffer = xmalloc (PATH_MAX + 1);
+ char *buffer = xmalloc (tost->st_size + 2);
Anyhow it should work now, can you try it?
Thank you!
Manolis
[-- Attachment #2: patch-hurd-path-max.patch --]
[-- Type: text/x-patch, Size: 1229 bytes --]
diff --git a/src/util.c b/src/util.c
index 1cc08ba..eee8514 100644
--- a/src/util.c
+++ b/src/util.c
@@ -460,12 +460,12 @@ move_file (char const *from, bool *from_needs_removal,
/* FROM contains the contents of the symlink we have patched; need
to convert that back into a symlink. */
- char *buffer = xmalloc (PATH_MAX);
+ char *buffer = xmalloc (fromst->st_size + 1);
int fd, size = 0, i;
if ((fd = safe_open (from, O_RDONLY | O_BINARY, 0)) < 0)
pfatal ("Can't reopen file %s", quotearg (from));
- while ((i = read (fd, buffer + size, PATH_MAX - size)) > 0)
+ while ((i = read (fd, buffer + size, fromst->st_size - size)) > 0)
size += i;
if (i != 0 || close (fd) != 0)
read_fatal ();
@@ -610,10 +610,10 @@ copy_file (char const *from, char const *to, struct stat *tost,
if (S_ISLNK (mode))
{
- char *buffer = xmalloc (PATH_MAX + 1);
+ char *buffer = xmalloc (tost->st_size + 2);
ssize_t r;
- if ((r = safe_readlink (from, buffer, PATH_MAX)) < 0)
+ if ((r = safe_readlink (from, buffer, tost->st_size)) < 0)
pfatal ("Can't read %s %s", "symbolic link", from);
buffer[r] = '\0';
if (safe_symlink (buffer, to) != 0)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#30547: Hurd patch for `patch` does not apply to latest release
2018-02-20 15:31 ` Manolis Ragkousis
@ 2019-02-26 1:40 ` Leo Famulari
0 siblings, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2019-02-26 1:40 UTC (permalink / raw)
To: 30547-done
[-- Attachment #1: Type: text/plain, Size: 87 bytes --]
The Hurd `patch` patch was adjusted in commit
ec07ba1ff73d6317470517ccf530a4a89b216f23
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-26 1:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-20 12:20 bug#30547: Hurd patch for `patch` does not apply to latest release Leo Famulari
2018-02-20 15:31 ` Manolis Ragkousis
2019-02-26 1:40 ` Leo Famulari
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).