FreeBSD Bugzilla – Attachment 239248 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.46 KB, created by
Yuri Victorovich
on 2023-01-04 08:33:56 UTC
(
hide
)
Description:
add-port-to-category-makefile.sh.patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2023-01-04 08:33:56 UTC
Size:
1.46 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..947b54fa5db2 >--- /dev/null >+++ b/Tools/scripts/add-port-to-category-makefile.sh >@@ -0,0 +1,47 @@ >+#!/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 >+! [ -f Makefile ] && echo "no Makefile found, are you in the ports tree?" && exit 1 >+! grep "^ SUBDIR += " Makefile >/dev/null && echo "this command can only be run from the category directory" && exit 1 >+! grep "^\\.include <bsd\\.port\\.subdir\\.mk>$" Makefile >/dev/null && echo "this command can only be run from the category directory" && exit 1 >+[ -z "$PORT" ] && echo "this command requires the <port> argument" && exit 1 >+! [ -d "$PORT" ] && echo "the '$PORT' directory is missing" && exit 1 >+! [ -f "$PORT/Makefile" ] && echo "'$PORT/Makefile' is missing" && exit 1 >+grep "^ SUBDIR += $PORT$" Makefile >/dev/null && 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