<pre style='margin:0'>
Ryan Carsten Schmidt (ryandesign) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/baf43ea76b241b71522cce544a8918d89cb76c17">https://github.com/macports/macports-ports/commit/baf43ea76b241b71522cce544a8918d89cb76c17</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new baf43ea76b2 util-linux: Fix rename command
</span>baf43ea76b2 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit baf43ea76b241b71522cce544a8918d89cb76c17
</span>Author: Ryan Carsten Schmidt <ryandesign@macports.org>
AuthorDate: Tue Jul 2 10:55:46 2024 -0500
<span style='display:block; white-space:pre;color:#404040;'> util-linux: Fix rename command
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/70186
</span>---
devel/util-linux/Portfile | 4 +-
devel/util-linux/files/ul_basename.patch | 110 +++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/util-linux/Portfile b/devel/util-linux/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index b555d3d5600..13152b1b9c6 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/util-linux/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/util-linux/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup github 1.0
</span> PortGroup legacysupport 1.0
github.setup karelzak util-linux 2.40.1 v
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span> set branch [join [lrange [split ${version} .] 0 1] .]
categories devel
maintainers {khindenburg @kurthindenburg} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -49,6 +49,8 @@ if { ${os.platform} eq "darwin" && ${os.major} < 9 } {
</span> depends_lib-append port:gettext \
port:ncurses
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append ul_basename.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # --disable-all-programs doesn't work as there's no way to enable what we want
configure.args --disable-agetty \
--disable-cramfs \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/util-linux/files/ul_basename.patch b/devel/util-linux/files/ul_basename.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..88335774b48
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/util-linux/files/ul_basename.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,110 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+add ul_basename() and use it in rename
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/util-linux/util-linux/issues/3071
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/util-linux/util-linux/commit/0bb52bae9132daffc8c918b40fa31d08680b356e
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/util-linux/util-linux/commit/503007991b8212203954c4febae7ad7f245d97c6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Makefile.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Makefile.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2754,8 +2754,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ am__rename_SOURCES_DIST = misc-utils/rename.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_RENAME_TRUE@am_rename_OBJECTS = misc-utils/rename.$(OBJEXT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rename_OBJECTS = $(am_rename_OBJECTS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-rename_LDADD = $(LDADD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-rename_DEPENDENCIES = $(am__DEPENDENCIES_1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@BUILD_RENAME_TRUE@rename_DEPENDENCIES = $(am__DEPENDENCIES_3) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@BUILD_RENAME_TRUE@ libcommon.la
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ am__renice_SOURCES_DIST = sys-utils/renice.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_RENICE_TRUE@am_renice_OBJECTS = sys-utils/renice.$(OBJEXT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ renice_OBJECTS = $(am_renice_OBJECTS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -7024,6 +7024,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_KILL_TRUE@kill_SOURCES = misc-utils/kill.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_KILL_TRUE@kill_LDADD = $(LDADD) libcommon.la
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_RENAME_TRUE@rename_SOURCES = misc-utils/rename.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@BUILD_RENAME_TRUE@rename_LDADD = $(LDADD) libcommon.la
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_GETOPT_TRUE@getopt_SOURCES = misc-utils/getopt.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_GETOPT_TRUE@getopt_LDADD = $(LDADD) libcommon.la
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @BUILD_GETOPT_TRUE@getoptexampledir = $(docdir)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- include/fileutils.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ include/fileutils.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -114,5 +114,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int ul_reopen(int fd, int flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern char *ul_basename(char *path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* UTIL_LINUX_FILEUTILS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib/fileutils.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib/fileutils.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -311,3 +311,35 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return open(buf, flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* This is a libc-independent version of basename(), which is necessary to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * maintain functionality across different libc implementations. It was
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * inspired by the behavior and implementation of glibc.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++char *ul_basename(char *path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ char *p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!path || !*path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (char *) "."; /* ugly, static string */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p = strrchr(path, '/');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return path; /* no '/', return original */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*(p + 1) != '\0')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return p + 1; /* begin of the name */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (p > path && *(p - 1) == '/')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ --p; /* remove tailing '/' */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (p > path) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *p-- = '\0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (p > path && *(p - 1) != '/')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ --p; /* move to the beginning of the name */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else while (*(p + 1) != '\0')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ++p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- meson.build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ meson.build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2994,6 +2994,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'rename',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rename_sources,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include_directories : includes,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ link_with : [lib_common],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install_dir : usrbin_exec_dir,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install : opt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build_by_default : opt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- misc-utils/rename.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ misc-utils/rename.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -28,7 +28,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <getopt.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <libgen.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <unistd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <termios.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -40,6 +39,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "closestream.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "optutils.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "rpmatch.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "fileutils.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define RENAME_EXIT_SOMEOK 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define RENAME_EXIT_NOTHING 4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -59,7 +59,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* We only want to search in the final path component. Don't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include the final '/' in that component; if `from` is empty,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ we want it to first match after the '/', not before. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- search_start = basename(orig);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ search_start = ul_basename(orig);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return strstr(search_start, from);
</span></pre><pre style='margin:0'>
</pre>