Commit Graph

1245 Commits

Author SHA1 Message Date
Matthias Andree
3fe84e82d4 bump_revision.pl: fix typo in help text. 2020-08-23 09:16:29 +00:00
Mateusz Piotrowski
4bd3723c02 Make argument parsing a bit more robust
Currently, when running mfh with a flag like --help the user gets
a confusing error message from expr(1) like the following:

> expr: illegal option -- -
> expr: usage: expr [-e] expression
>
> revision "--help" should be a number

This is not helpful. Instead, make sure that any arguments specified by the
user are handled properly by expr(1). This results in a much cleaner error
message:

> revision "--help" should be a number

Reviewed by:	mat
Approved by:	portmgr (mat)
Differential Revision:	https://reviews.freebsd.org/D25958
2020-08-05 15:03:01 +00:00
Mathieu Arnold
466a092fb2 Move script to a more appropriate location. 2020-08-03 13:53:06 +00:00
Ryan Steinmetz
178b0490c2 - Update wording/style on REINPLACE_CMD checks 2020-08-03 13:46:11 +00:00
Matthias Andree
243562ce09 bump_revision.pl: svn.freebsd.org -> repo.freebsd.org
and while here, fix a typo in the tmpdir's name.
2020-07-16 15:00:59 +00:00
Rene Ladan
ec55b02c40 Tools/scripts/patchtool: adjust for Python 3
PR:		246414
Submitted by:	ashish
Event:		July 2020 Bugathon
2020-07-11 20:26:01 +00:00
Matthias Andree
e3be41ec11 Tools/scripts/psvn: filter out svn status comments such as moved from/to.
Avoids spurious but harmless warnings.
2020-06-11 18:12:55 +00:00
Matthias Andree
f0711b4f79 Tools/scripts/mfh: revert accidental tab expansion
Regression from r537876

Reported by:	tijl@
Approved by:	portmgr@ (implicit, whitespace-only edit to fix a regression)
2020-06-04 21:01:37 +00:00
Matthias Andree
b0b59f3278 Tools/scripts/mfh: check out entire port directory even if touching only files/
- remove unused clean() function, trap does it
- fix race around mktemp/setting up rm trap
- rename filelist to dirlist so it matches its purpose
- move defaults up front to the script
- misc. minor edits

PR:		246336
Approved by:	portmgr (mat@)
Differential Revision:	https://reviews.freebsd.org/D24789
2020-06-04 09:19:50 +00:00
Matthias Andree
6028208dff Tools/scripts/bump_revision.pl: Abort when invalid option given. 2020-05-08 01:18:16 +00:00
Matthias Andree
6560980dd3 Tools/scripts/sed_checked.sh: Revert accidental unapproved commit. 2020-05-08 01:11:02 +00:00
Matthias Andree
106ebbd24e Tools/scripts/bump_revision.pl: chase option rename for getopts(). 2020-05-08 01:10:16 +00:00
Matthias Andree
db9d6d4735 Tools/scripts/bump_revision.pl: rename options to avoid astonishment.
-n was more or less some "force" option, rename to -f
-c was a dry-run option that's often called -n, rename accordingly.
2020-05-08 01:09:15 +00:00
Matthias Andree
f94f54f0cd bump_revision.pl: minor usability improvements
- use env -S to split the shebang line (RhToad@#bsdports)
- launder -p PORTSDIR argument and chdir to it so it doesn't matter
  which cwd bump_revision.pl is executed from
- if INDEX not found, hint the user that also his -p option might be off,
  because the -i INDEX option defaults to a file relative to -p PORTSDIR.
2020-04-19 00:36:04 +00:00
Matthias Andree
1240f9c8de Tools/scripts/sed_checked.sh: reword sed warning
The original wording was misleading and might have mistaken for
identical file names, but what is meant is that the sed run did not
introduce changes to the file's __content__. Reword accordingly.
2020-01-12 12:06:52 +00:00
Steve Wills
0a82a7c091 Add QA warning about useless REINPLACE_CMD
Reviewed by:	mat, bdrewery, tobik
Approved by:	mat
Differential Revision:	https://reviews.freebsd.org/D22174
2020-01-09 13:01:45 +00:00
Matthias Andree
c11266721a Tools/scripts/bump_revision.pl: Fix a few issues
- When using a non-default ports tree (-p PATH),
  strip that from the requisite origins, too.
- Fix the counters when multiple ports are given on the command line,
  i. e. we are bumping depends if more requisites are updated at once.
2020-01-05 02:05:23 +00:00
Matthias Andree
58e5e2482e Tools/scripts/bump_revision.pl: Fix typo in comment 2020-01-05 01:35:58 +00:00
Baptiste Daroussin
70aef9747e Update supported version of FreeBSD 2019-09-13 12:47:03 +00:00
Baptiste Daroussin
8675fe333a Stop documenting scripts which no longer lives in the tree
PR:		226606
Submitted by:	Sergey Akhmatov <sergey@akhmatov.ru>
2019-09-05 14:18:46 +00:00
Matthias Andree
08c566cdbf Fix typos/grammar.
Thanks for the review, Mark.

Reported by:	linimon@
2019-07-12 16:40:14 +00:00
Matthias Andree
d89e773d86 Update bump_revision.pl.
Key features:
- updated for SVN (the old version expected CVS)
- shallow mode to only bump direct dependencies (option -l)

PR:		192706
Submitted by:	mandree@ (new maintainer)
2019-07-12 16:07:44 +00:00
Gerald Pfeifer
2e782655b8 Transfer maintainership of this script to mandree@ based on conversations
we've been having after I was planning to EOL it last year and a nice
revamp of this script he has prepared.

Thank you for taking this over, and good luck, Matthias!

PR:		192706
2019-07-12 12:20:34 +00:00
Luca Pizzamiglio
81826cc2ef Tools/script/addport: Fix usage with multiple directories
PR:		238379
Submitted by:	me
Approved by:	crees@
2019-06-10 13:54:40 +00:00
Matthias Fechner
7d3b225247 Do not search only in subfolder editors but in all.
I forgot to remove this before I commited it.
2019-05-18 10:28:00 +00:00
Matthias Fechner
d747a7be63 Added a script to bump PORTREVISION if a library has changed a version like libgit2.
Just execute it in the root of you ports with e.g.
Tools/scripts/search_lib_depends_and_bump.sh devel/libgit2

This will search over all existing ports, check if they need to be bumped.
After all ports are bumped it triggers a portlint for each modified port.
The portlint loop continues till all errors and warnings are fixed.
Feel free to break this loop using CTRL+C.
2019-03-28 17:01:17 +00:00
Rene Ladan
79f37cc7ae rmport: fix and speed up the find_expired() function.
find_expired() is used with -F (report on all expired ports using the
format "date category/port: reason") and -a (remove all expired ports).

Some speedups:
- only calculate the deprecation reason for -F
- use nested loops instead of nested recursion for traversing all ports.
  The nested recursion would also stop after finding the first port.

Approved by:	maintainer (crees) (implicit, fixit)
2019-03-05 22:54:34 +00:00
Rene Ladan
17094bb838 rmport: correctly deal with expired ports when the -a (find all expired) option.
Instead of grepping port Makefiles for EXPIRATION_DATE, evaluate this variable
using make. Also find ports by evaluating SUBDIR recursively instead of using
find on Makefile\*

Submitted by:   crees (maintainer)
Approved by:    crees (maintainer)
2019-02-26 21:51:44 +00:00
Tobias Kortkamp
76e803f2cf Make Tools/scripts/patchtool.py compatible with Python 3.x
PR:		233776
Submitted by:	sobomax
2019-01-29 14:44:12 +00:00
Chris Rees
0a32f395b7 Revert flavour support.
Submitted by:	rene
2018-12-17 15:09:13 +00:00
Chris Rees
814b0cc185 Support flavor_EXPIRATION_DATE
Correctly ignore commented dates (why would that exist?)

Handle more neatly when EXPIRATION_DATE is not in the main Makefile
2018-12-17 14:54:56 +00:00
Rene Ladan
c5292f38d2 Return a bunch of tools formerly maintained by sobomax@ to the pool. 2018-12-03 21:38:04 +00:00
Rene Ladan
10ad00012a rmport: if the user edited the commit message, ask again afterwards.
This is in line with asking for recreating the diffs and "fixes" the workflow.
2018-10-11 13:40:41 +00:00
Rene Ladan
88f198beed rmport: usability fixes:
- only write the message to edit the log once
- show the log itself instead of the temporary filename
2018-09-16 09:20:37 +00:00
Rene Ladan
00c81ca48c Tools/scrips/rmport: improve usability
- if svn is not found, look for svnlite
- improve workflow of removing ports

Submitted by:	blackend via email
Approved by:	maintainer (crees)
2018-09-02 11:30:20 +00:00
Gerald Pfeifer
4623a87843 Use 'make -C' instead of saving the current working directory and then
restoring that in the new code to add a safety belt that came in via
revision 477561.  This is quite a bit simpler and shorter.

Reported by:	adamw
PR:		226926
2018-08-20 00:39:32 +00:00
Gerald Pfeifer
8c7bf827a6 Add a stronger safety belt to this script by comparing the actual
PORTREVISION (using the Ports Collection framework, not just looking at
one Makefile individually at a time) before and after the bump.  If the
version after the bump isn't actually increased, flag that as an error.

As an example, before revision r464215 (cf. bug #226533) this script
would have wreaked wreak havoc on the multimedia/avidemux* ports.
This hardly can be blamed on bump-revision.sh, but with the additional
safety belt it does now detect such cases.

How to reproduce:

  % cd $PORTSDIR
  % svn up -r 464036 multimedia/
  % Tools/scripts/bump-revision.sh multimedia/avidemux*

With this patch we print:

  INFO: multimedia/avidemux PORTREVISION=	9 found, bumping it by 1.
  INFO: multimedia/avidemux-cli PORTREVISION not found, adding PORTREVISION= 1
  ERROR: multimedia/avidemux-cli PORTREVISION went backwards from 5 to 1!
  INFO: multimedia/avidemux-plugins PORTREVISION not found, adding PORTREVISION= 1
  ERROR: multimedia/avidemux-plugins PORTREVISION went backwards from 5 to 1!
  INFO: multimedia/avidemux-qt4 PORTREVISION not found, adding PORTREVISION= 1
  ERROR: multimedia/avidemux-qt4 PORTREVISION went backwards from 5 to 1!

The beauty of this approach is that it goes beyond a simple text search,
and leverages what the ports framework itself does.

PR:		226926, 226533
Approved by:	maintainer timeout (20+ weeks)
Reviewed by:	mandree, riggs
2018-08-19 09:17:56 +00:00
Eugene Grosbein
dfa53b2308 rmport: provide default for EDITOR varialble to prevent
an error "svnlog: not found" when EDITOR is undefined.

Reported by:	Matthias Fechner <idefix@fechner.net>
Approved by:	portmgr (crees)
2018-08-04 16:29:31 +00:00
Mathieu Arnold
5b4fcd0676 Also report the previous line when going backwards in time.
This is because half of the time, the previous line is the one that is
wrong, so you get redirected to line X, where X-1 has the error, and you
wonder because line X looks just fine.

Sponsored by:	Absolight
2018-07-02 16:19:50 +00:00
Mathieu Arnold
8543f37ef5 Remove an extra dot messing up copy and paste.
Sponsored by:	Absolight
2018-06-14 15:55:24 +00:00
Rene Ladan
376faa4991 Return Tools/scripts/portsvar.sh to the pool. 2018-06-01 20:25:45 +00:00
Eitan Adler
eac1d5f88c Tools: add LEGALlint
This checks 'LEGAL' for common errors, It is inspired by MOVEDLint.
2018-05-27 05:02:06 +00:00
Sofian Brabez
8c7b5028b3 - Do not download obsolete attachments
Submitted by:		gonzo
Approved by:		myself
Differential Revision:	https://reviews.freebsd.org/D14550
2018-05-21 18:57:34 +00:00
Rene Ladan
affecc3c06 Detect flavored dependencies in Tools/scripts/rmport and add myself to the copyright. 2018-03-26 16:55:52 +00:00
Bryan Drewery
d7b83ead05 Show errors for duplicate source entries. 2018-01-25 20:56:18 +00:00
Mathieu Arnold
fb30d2bf17 Run Tools/scripts/mfh through devel/hs-ShellCheck.
SC2068: Double quote array expansions to avoid re-splitting elements.
SC2034: revs appears unused. Verify it or export it.
SC2039: In POSIX sh, XXX is undefined.
    type     -> command -v
    echo -n  -> printf
    read -p  -> printf + read

SC2162: read without -r will mangle backslashes.
SC2086: Double quote to prevent globbing and word splitting.

Sponsored by:	Absolight
2018-01-23 15:53:56 +00:00
Mathieu Arnold
033977e70f Follow up on last commit and actually allow editing
the commit message again.

PR:		224634
Reported by:	yuri
Sponsored by:	Absolight
2017-12-29 13:20:47 +00:00
Mathieu Arnold
30c4ca5784 Generic FLAVORS work.
- Enable FLAVORS.
- Make make describe flavors aware.
- Add a qa check for unique package names amongst flavors.
- Make MOVEDlint understand flavors.
- Add a bit of sanity check to make sure FLAVORS stay lowercase.
- Various fixes.

Reviewed by:	portmgr
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D12577
2017-11-30 15:33:29 +00:00
Mathieu Arnold
c77bdeb9c9 Commit the actual patch I tested
Sponsored by:	Absolight
2017-11-10 12:01:33 +00:00
Mathieu Arnold
4bcdfb8685 Cleanup resurrected processing.
There is no need to have a resurrected array, it is only used once, so
move the resurrected printf where it belongs.

Sponsored by:	Absolight
2017-11-10 11:59:28 +00:00