FreeBSD Bugzilla – Attachment 239292 Details for
Bug 268737
Add Mk/Scripts/add-port-to-category-makefile.sh, command that adds port to category's Makefile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
add-port-to-category-makefile.sh.patch
add-port-to-category-makefile.sh.patch (text/plain), 1.54 KB, created by
Yuri Victorovich
on 2023-01-06 02:01:42 UTC
(
hide
)
Description:
add-port-to-category-makefile.sh.patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2023-01-06 02:01:42 UTC
Size:
1.54 KB
patch
obsolete
>diff --git a/Tools/scripts/add-port-to-category-makefile.sh b/Tools/scripts/add-port-to-category-makefile.sh >new file mode 100755 >index 000000000000..dc846bcf1f3c >--- /dev/null >+++ b/Tools/scripts/add-port-to-category-makefile.sh >@@ -0,0 +1,48 @@ >+#!/bin/sh >+# >+# MAINTAINER: yuri@FreeBSD.org >+ >+set -e >+set -o pipefail >+ >+## >+## add-port-to-category-makefile.sh: adds a new port to {category}/Makefile >+## >+ >+PORT="$1" >+ >+ >+# sanity checks >+[ -z "$PORT" ] && echo "this command requires the <port> argument" && exit 1 >+(echo "$PORT" | grep -q "/") && echo "port's name can't contain slash" && exit 1 >+! [ -f Makefile ] && echo "no Makefile found, are you in the ports tree?" && exit 1 >+! grep -q "^ SUBDIR += " Makefile && echo "this command can only be run from the ports tree category directory" && exit 1 >+! grep -q "^\\.include <bsd\\.port\\.subdir\\.mk>$" Makefile && echo "this command can only be run from the ports tree category directory" && exit 1 >+! [ -d "$PORT" ] && echo "the '$PORT' directory is missing" && exit 1 >+! [ -f "$PORT/Makefile" ] && echo "'$PORT/Makefile' is missing" && exit 1 >+grep -q "^ SUBDIR += $PORT$" Makefile && echo "port '$PORT' is already added" && exit 1 >+ >+ >+# add port to Makefile >+/usr/bin/awk ' >+BEGIN { >+ done = 0 >+ seen = 0 >+ str = " SUBDIR += '$PORT'" >+} >+/^ SUBDIR \+= / { >+ if (!done && str < $0) { >+ print str >+ done = 1 >+ } >+ print $0; >+ seen = seen + 1 >+} >+!/^ SUBDIR \+= / { >+ if (seen > 0 && !done) { >+ print str >+ done = 1 >+ } >+ print $0 >+}' < Makefile > Makefile.new && >+/bin/mv Makefile.new Makefile
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 268737
:
239237
|
239248
|
239292
|
239293