Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add man page for pkg-annotate
Matthew Seaman committed 13 years ago
commit e5381b14f9506aff98e742146412732347988470
parent c221e81
31 files changed +216 -13
modified pkg/fix-xrefs
@@ -14,11 +14,21 @@ MAIN:
    my @xrefs;
    my $see_also;

-
    @xrefs = map { (my $x = $_) =~ s/^(\S+)\.(\d)/.Xr $1 $2/; $x } @ARGV;
+
    @xrefs =
+
      map { ".Xr $_->[0] $_->[1]" }
+
      sort {
+
             ( $a->[1] <=> $b->[1] )
+
          || ( ( $b->[0] eq 'pkg' ) <=> ( $a->[0] eq 'pkg' ) )
+
          || ( $a->[0] cmp $b->[0] )
+
      }
+
      map {
+
        [m/^(\S+)\.(\d)$/]
+
      } @ARGV;

    eval {
-
        for my $man (@ARGV)
-
        {
+
        for my $man (@ARGV) {
+
            my ($match) = ( $man =~ m/^(\S+)\./ );
+

            open READ,  "<$man";
            open WRITE, ">$man.new";

@@ -28,7 +38,8 @@ MAIN:
                if (/^\.Sh SEE ALSO/) {
                    $see_also = 1;
                    print WRITE $_;
-
                    print WRITE join( " ,\n", grep { !/$man/ } @xrefs ), "\n";
+
                    print WRITE join( " ,\n", grep { !m/$match / } @xrefs ),
+
                      "\n";
                    next;
                }
                if ( $see_also && /^\.Xr/ ) {
@@ -39,7 +50,7 @@ MAIN:
            close READ;
            close WRITE;

-
	    rename "$man.new", $man;
+
            rename "$man.new", $man;
        }
    };
    given ($@) {
modified pkg/pkg-add.8
@@ -70,6 +70,7 @@ See
.Sh SEE ALSO
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-annotate.8
@@ -0,0 +1,156 @@
+
.\"
+
.\" FreeBSD pkg - a next generation package for the installation and maintenance
+
.\" of non-core utilities.
+
.\"
+
.\" 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.
+
.\"
+
.\"
+
.\"     @(#)pkg.8
+
.\" $FreeBSD$
+
.\"
+
.Dd April 6, 2013
+
.Dt PKG-ANNOTATE 8
+
.Os
+
.Sh NAME
+
.Nm "pkg annotate"
+
.Nd add, modify or delete arbitrary annotations from packages
+
.Sh SYNOPSIS
+
.Nm
+
.Op Fl giqxy
+
.Fl A|M
+
.Ar <pkg-name>
+
.Ar <tag>
+
.Op Ar <value> 
+
.Nm
+
.Op Fl giqxy
+
.Fl D
+
.Ar <pkg-name>
+
.Ar <tag>
+
.Nm 
+
.Op Fl qy
+
.Fl a
+
.Fl A|M
+
.Ar <tag>
+
.Op Ar <value>
+
.Nm
+
.Op Fl qy
+
.Fl a
+
.Fl D
+
.Ar <tag>
+
.Sh DESCRIPTION
+
.Nm
+
is used to add, modify or delete package annotations.
+
These are freeform tag-value pairs which may contain any arbitrary text.
+
.Ar Tags
+
must be unique per package, but there is no restriction on what
+
text
+
.Ar values
+
may be attached to them.
+
.Pp
+
The
+
.Ar tag
+
is always specified on the command line, but when adding or modifying
+
an annotation, the
+
.Ar value
+
may be supplied either on the command line or as a text stream on stdin. 
+
.Sh OPTIONS
+
The following options are supported by
+
.Nm :
+
.Bl -tag -width F1
+
.It Fl a
+
Annotate all installed packages.
+
.It Fl A
+
The operation is to add a new annotation.
+
Attempting to add an annotation with a
+
.Ar <tag>
+
that already applies to that package is an error, but this will not
+
cause
+
.Nm
+
to exit before attempting to apply the annotation to all remaining
+
matched packages.
+
.It Fl D
+
The operation is to delete an annotation.
+
Only the
+
.Ar <tag>
+
needs to be specified.
+
Attempting to delete an annotation which does not exist on a package
+
is an error, but this will not prevent
+
.Nm
+
carrying on to delete the annotation from all matched packages.
+
.It Fl g
+
Treat
+
.Ar <pkg-name>
+
as a shell glob pattern.
+
.It Fl i
+
Make the default or the regular expression
+
.Fl ( x )
+
.Ar pkg-name
+
matching case insensitive.
+
.It Fl M
+
The operation is to modify a previously existing annotation.
+
Functionally, this behaves similarly to
+
.Fl A
+
except that it will succeed irrespective of whether the tag already
+
applies to all the matched packages.
+
.It Fl q
+
Operate quietly: do not output anything other than confirmatory questions.
+
.It Fl x
+
Treat
+
.Ar <pkg-name>
+
as a regular expression according to the "modern" or "extended" syntax
+
of
+
.Xr re_format 7 .
+
.It Fl y
+
Assume "yes" as the answer to all questions.
+
.El
+
.Sh ENVIRONMENT
+
The following environment variables affect the execution of
+
.Nm .
+
See
+
.Xr pkg.conf 5
+
for further description.
+
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
+
.It Ev PKG_DBDIR
+
.It Ev ASSUME_ALWAYS_YES
+
.El
+
.Sh FILES
+
See
+
.Xr pkg.conf 5 .
+
.Sh SEE ALSO
+
.Xr pkg.conf 5 ,
+
.Xr pkg 8 ,
+
.Xr pkg-add 8 ,
+
.Xr pkg-audit 8 ,
+
.Xr pkg-autoremove 8 ,
+
.Xr pkg-backup 8 ,
+
.Xr pkg-check 8 ,
+
.Xr pkg-clean 8 ,
+
.Xr pkg-convert 8 ,
+
.Xr pkg-create 8 ,
+
.Xr pkg-delete 8 ,
+
.Xr pkg-fetch 8 ,
+
.Xr pkg-info 8 ,
+
.Xr pkg-install 8 ,
+
.Xr pkg-lock 8 ,
+
.Xr pkg-query 8 ,
+
.Xr pkg-register 8 ,
+
.Xr pkg-repo 8 ,
+
.Xr pkg-rquery 8 ,
+
.Xr pkg-search 8 ,
+
.Xr pkg-set 8 ,
+
.Xr pkg-shell 8 ,
+
.Xr pkg-shlib 8 ,
+
.Xr pkg-stats 8 ,
+
.Xr pkg-update 8 ,
+
.Xr pkg-updating 8 ,
+
.Xr pkg-upgrade 8 ,
+
.Xr pkg-version 8 ,
+
.Xr pkg-which 8
+

modified pkg/pkg-audit.8
@@ -78,6 +78,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
.Xr pkg-check 8 ,
modified pkg/pkg-autoremove.8
@@ -59,6 +59,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-backup 8 ,
.Xr pkg-check 8 ,
modified pkg/pkg-backup.8
@@ -65,6 +65,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-check 8 ,
modified pkg/pkg-check.8
@@ -90,6 +90,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-clean.8
@@ -70,6 +70,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-convert.8
@@ -53,6 +53,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-create.8
@@ -278,6 +278,7 @@ Create package file for pkg:
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-delete.8
@@ -104,6 +104,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-fetch.8
@@ -108,6 +108,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-info.8
@@ -142,6 +142,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-install.8
@@ -184,6 +184,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-lock.8
@@ -106,8 +106,10 @@ for further description.
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
+
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
@@ -117,7 +119,7 @@ See
.Xr pkg-create 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
-
.Xr pkg-info 8,
+
.Xr pkg-info 8 ,
.Xr pkg-install 8 ,
.Xr pkg-query 8 ,
.Xr pkg-register 8 ,
@@ -132,5 +134,4 @@ See
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
-
.Xr pkg-which 8 ,
-
.Xr pkg.conf 5
+
.Xr pkg-which 8
modified pkg/pkg-query.8
@@ -296,6 +296,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-register.8
@@ -68,6 +68,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-repo.8
@@ -88,6 +88,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-rquery.8
@@ -245,6 +245,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-search.8
@@ -411,6 +411,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-set.8
@@ -107,6 +107,7 @@ Move the origin libglut to freeglut, and then reinstall everything depending on
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-shell.8
@@ -54,6 +54,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-shlib.8
@@ -65,6 +65,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-stats.8
@@ -54,6 +54,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-update.8
@@ -79,6 +79,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-updating.8
@@ -78,6 +78,7 @@ installed ports:
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-upgrade.8
@@ -104,6 +104,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-version.8
@@ -190,6 +190,7 @@ The following command compares two package version strings:
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg-which.8
@@ -58,6 +58,7 @@ See
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
modified pkg/pkg.8
@@ -205,6 +205,7 @@ See
.Sh SEE ALSO
.Xr pkg.conf 5 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
@@ -241,11 +242,18 @@ command first appeared in
.Sh AUTHORS AND CONTRIBUTORS
.An Baptiste Daroussin Aq bapt@FreeBSD.org
.An Julien Laffaye Aq jlaffaye@FreeBSD.org
-
.An Philippe Pepiot Aq phil@philpep.org
-
.An Will Andrews Aq will@FreeBSD.org
-
.An Marin Atanasov Nikolov Aq dnaeon@gmail.com
-
.An Bryan Drewery Aq bdrewery@FreeBSD.org
-
.An Matthew Seaman Aq matthew@FreeBSD.org
+
.An Philippe Pepiot <phil@philpep.org>
+
.An Will Andrews <will@FreeBSD.org>
+
.An Marin Atanasov Nikolov <dnaeon@gmail.com>
+
.An Yuri Pankov <yuri.pankov@gmail.com>
+
.An Alberto Villa <avilla@FreeBSD.org>
+
.An Brad Davis <brd@FreeBSD.org>
+
.An Matthew Seaman <matthew@FreeBSD.org>
+
.An Bryan Drewery <bryan@shatow.net>
+
.An Eitan Adler <eadler@FreeBSD.org>
+
.An Romain Tarti\`ere <romain@FreeBSD.org>
+
.An Vsevolod Stakhov <vsevolod@FreeBSD.org>
+
.An Alexandre Perrin <alexandre.perrin@netoxygen.ch>
.\" ---------------------------------------------------------------------------
.Sh BUGS
See the issue tracker at
modified pkg/pkg.conf.5
@@ -162,6 +162,7 @@ file always overrides the value of an option set in the file.
.Sh SEE ALSO
.Xr pkg 8 ,
.Xr pkg-add 8 ,
+
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,