diff --git a/Tools/scripts/README b/Tools/scripts/README index 1b7d2b838270..aa9b32f612e4 100644 --- a/Tools/scripts/README +++ b/Tools/scripts/README @@ -1,130 +1,133 @@ NOTE: These scripts need work and are *NOT* safe to use unless you know what they do. Use at your own risk. Patches would be great, but it is preferred they pass through the maintainer of each particular script. MOVEDlint.awk - checks MOVED for common errors ardiff - compare two archives easily addport - replacement for easy-import bad-pkgdescrs.sh - locate identical pkg descriptions bump_revision.pl - Small script to bump the PORTREVISION variable of ports which are depending on a port with a changed shared lib version. checkcats.py - verify that master categories in all ports are correct and report any problems. Beware that the full check takes quite some time. checknewvers - checks for availability for a newest version of distfiles on MASTER_SITES (ftp only). checksum - allows checking of ports to see if their checksums match, and if they don't, give a diff against the older version to help discover why the checksum didn't match. chkorigin.sh - checks all ports in the tree for a wrong PKGORIGIN. Run this tool after every repocopy. doportlint - run portlint on every port and return the results distclean - compare md5 sums of distfiles in ports/distfiles with currently installed ports collection in ports/* and prompt to remove unmatched entries getpatch - downloads patch attachments from a Bug Tracking Systems getpatch.sh - downloads patch attachments from a Bug Tracking Systems (plain shell script) gnomedepends - Analyse pkg/PLIST and give an advice as to which GNOME ports should be listes in {RUN,LIB}_DEPENDS for this port mark_safe.pl - utility to set subsets of ports to MAKE_JOBS_(UN)SAFE=yes neededlibs.sh - Extract direct library dependencies from binaries. portsearch - A utility for searching the ports tree. It allows more detailed search criteria than ``make search key='' and accepts all perl(1) regular expressions. search_lib_depends_and_bump.sh - Give it a port that has changed and it will bump all ports having a LIB_DEPENDS on this port splitpatch.pl - A small script to convert multi-file patches to several appropriately named single-file patches. tindex - script used to build INDEXes for supported FreeBSD branches, which are the source of the 'make fetchindex' INDEXes, and the build failure reports on ports@FreeBSD.org update-patches - generates updated patches. +update_crates - script used to generate an updated Makefile using make cargo-crates + output + ---------------------------------------------------------------------- gnomedepends is a script, which analyses pkg/PLIST and gives an advice as to which GNOME ports should be listes in {RUN,LIB}_DEPENDS for the port to ensure correct removal of GNOME shared directories. Usage is simple: % cd /usr/ports/CATEGORY/PORT % gnomedepends.py According to the contents of PLIST the port depends on the following GNOME port(s): /usr/ports/audio/gnomeaudio, for directories: share/gnome/sounds /usr/ports/sysutils/gnomecontrolcenter, for directories: share/gnome/apps /usr/ports/x11/gnomecore, for directories: share/gnome/apps/Games /usr/ports/x11/gnomelibs, for directories: etc/sound/events etc/sound share/gnome/games share/gnome/pixmaps share/gnome The example above means that you need to have ${PORTSDIR}/audio/gnomeaudio, ${PORTSDIR}/sysutils/gnomecontrolcenter, ${PORTSDIR}/x11/gnomecore and ${PORTSDIR}/x11/gnomelibs listed in {RUN,LIB}_DEPENDS for this port. Please be warned, that the this only means that the ports listed by the script required for correct removal of GNOME shared directories, not for the port functionality, so actual {RUN,LIB}_DEPENDS may have more entries. ---------------------------------------------------------------------- portsearch - A utility for searching the ports tree. portsearch is a utility to for searching of the ports tree. It permits much more detailed searches to be performed than ``make search key='' by allowing you to specify which field(s) to search. It also supports all valid perl(1) regular expressions for pattern matching. portsearch displays matching ports in the same format as ``make search'' and also displays the number of matching ports found. The following command line options are supported: -h Prints a multi-line help message and exits -n name Search for name in the name field -p path Search for path in the path field -i info Search for info in the comments field -m maint Search for maint in the Maintainer field -x index Search for index in the category field -b b_deps Search for b_deps in the build-depends field -r r_deps Search for r_deps in the run-depends field -d deps Search for deps in the both the build and run dependency fields. This option behaves differently to the other op- tions, see the EXAMPLES section -f file Use the index file instead of /usr/ports/INDEX All searches are case-insensitive See the file README.portsearch for further information. ---------------------------------------------------------------------- The update-patches script looks for files in $WRKSRC (if unset, this defaults to the work/ subdirectory of the current directory) which have a matching .orig file. It also looks in $PATCHDIR (if unset, this defaults to the files/ subdirectory of the current directory) for patches that correspond to the first set. If the changes in an existing patch do not reflect the changes in the files in $WRKSRC, the script renames the existing patch by adding the suffix .orig and generates a new patch in its place. If no patch existed, the new one is created with a name that contains the path and filename of the file being patched, except that "/" separators and "." characters are replaced by underscores: for example, a new patch to $WRKSRC/foo/bar.c would be created as $PATCHDIR/patch-foo_bar_c. If you save a .orig backup of a file, but don't change the file, update-patches will generate an empty patch. diff --git a/Tools/scripts/update_crates b/Tools/scripts/update_crates new file mode 100755 index 000000000000..c95b4bbec6af --- /dev/null +++ b/Tools/scripts/update_crates @@ -0,0 +1,62 @@ +#!/bin/sh +# Copyright (c) 2021 Rodrigo Osorio +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# MAINTAINER= rodrigo@FreeBSD.org +# + +usage() { + echo "usage: update_crates " + echo + exit 1 +} + +if [ "$#" -ne 1 ]; then + usage + exit 1 +fi + +newcrates() { + while IFS= read -r nline + do + echo "$nline" + done < "/dev/stdin" +} + +infile=$1 +incrates=0 +while IFS= read -r line <&3 +do + match=$(echo "${line}" | grep "^CARGO_CRATES=") + [ -n "${match}" ] && incrates=1 + if [ "${incrates}" -eq 1 ]; then + if [ -z "$line" ]; then + incrates=0 + newcrates + echo "$line" + fi + else + echo "${line}" + fi +done 3< "$infile"