# duck(1) - man - phpMan

[DUCK(1)](https://www.chedong.com/phpMan.php/man/DUCK/1/markdown)                                General Commands Manual                               [DUCK(1)](https://www.chedong.com/phpMan.php/man/DUCK/1/markdown)



## NAME
       duck - the Debian Url ChecKer

## SYNOPSIS
        **duck**  [ _OPTION_ ]... [_-f_ _file_] [_-u_ _file_] [_-c_ _file_] [_URL_]

## DESCRIPTION
       **duck** extracts links, email address domains and VCS-* entries from the following files:

       o      _debian/control_

       o      _debian/upstream,_ _debian/upstream-metadata.yaml_ and _debian/upstream/metadata_

       o      _debian/copyright_

       o      DEP-3 patch files in every directory a _series_ file is found

       o      systemd.unit  files  (_*.socket_,  _*.device_,  _*.mount_,  _*.automount_,  _*.swap_,  _*.target_,
              _*.path_, _*.time_, _*.snapshot_, _*.slice_, _*.scope_)

       o      Appstream files (_*.appdata_)

       If an _URL_ is supplied, duck uses **dget** to download the specified URL and processes  the  down‐
       loaded source package (*.dsc file) instead of working on the current directory.

       It  tries  to  access  those  VCS-*  entries  and URLs using the appropriate tool to find out
       whether the given URLs or entries are broken or working. If errors are  detected,  the  file‐
       name, fieldname and URL/email of the broken entry are displayed.

       **duck**  will search for the default files (see above) and skip them silently, if they cannot be
       found.  If specific filenames for options **-c**, **-f** or **-u** are given, and one of those files can‐
       not be found, **duck** exits with exit code **2**.

       Email  address  domains  are  checked for existing _MX_ records, _A_ records, or _AAAA_ records, in
       this order. If none of these 3 are found for a given domain, it is considered broken.

       Checks results are displayed with 3 different error levels


       **O:**     (OK) Indicates that the given check did not result in an error. Only shown  if  _-n_  is
              used.

       **I:**     (Information)  Indicates informational warnings, suchs as missing helper tools as well
              as failing checks based on searches in unstructured text files, which  sometimes  lead
              to false positives.

       **E:**     (Error)  Indicates  failing  checks based on data from well-defined fields (e.g. Home‐
              page: entry in _debian/control_).

       and 3 different certainty-levels


### certain
              Data taken from well defined fields. As the format of this field  is  specified  (e.g.
              Debian  Policy,  etc.), it can be checked by the appropriate tools. If this check then
              fails, the data in the field is certainly erroneous.

### possible
              Data extracted using regular expressions (e.g. email addresses, URLs). This might lead
              to false positives, so the check result is possibly a false positive.

### wild-guess
              Data extracted from websites, by using regular expressions. This is still experimental
              and probably buggy, hence the "wild-guess".

## OPTIONS
### -n

### -q

### -v

       **--modules-dir=**DIRECTORY
              specify modules directory. Mostly useful for developing new checks. If this  parameter
              is  specified,  only  modules defined in this directory are used. You have to copy all
              _*.pm_ files from _/usr/share/duck/lib/checks_ to the directory specified.

       **--color=**[WHEN]
              Specify when to emit escape sequences to the output. Available options are:

                      **auto** Emit color escape codes on STDOUT/STDERR, no color if output is piped  to
                      a file or the current terminal is not capable of displaying colors.




                      **always** Always emit color escape codes.




                      **never** Never emit color escape codes.




       **--no-https**     do not try to find matching https URLs to http URLs. See also the _DUCK_NOHTTPS_
                      environment variable.

### --no-check-certificate
                      do not check if SSL certificates autenticity. **This** **is** **highly** **discouraged!**

### --missing-helpers
                      display list of missing external helper tools and exits.

       **--version**      display copyright and version information

### -f

### -F

### -u
                      _bian/upstream,_ _debian/upstream-metadata.yaml_ and _debian/upstream/metadata_.

### -U

### -c

### -C

### -P

### -A

### -S

### -l
                      fied. Specify one entry per line. This also disables all other  check  modules
                      searching for entries in various files.


### --disable-urlfix=<fix1,...>
                      disables the specified url fix(es). An urlfix tries to remove leading/trailing
                      characters from extracted URLs, like trailing dots or parentheses. Using  this
                      parameter **enables** **all** urlfixes minus the specified ones.


### --enable-urlfix=<fix1,...>
                      enables  the specified url fix(es). Using this parameter **disabled** **all** urlfixes
                      minus the specified ones.


                      The following urlfixes are available:

                      **TRAILING**___**COLON** Removes trailing colon ":" character.



                      **TRAILING**___**PAREN**___**DOT** Removes the string "**).**" from the end of the URL.


                      **TRAILING**___**PUNCTUATION** Removes trailing "**.**" and "**,**" characters.


                      **TRAILING**___**QUOTES** Removes trailing single quotes "**'**"  characters.  Note:  Double
                      quotes (**"**) are already correctly handled by the used perl regex matchers.


                      **TRAILING**___**SLASH**___**DOT**  Removes  the string "**/.**" (without the quotes) from the end
                      of the URL.


                      **TRAILING**___**SLASH**___**PAREN** Removes the string "**/)**" (without the quotes) from the end
                      of the URL.


### --tasks=[number]
                      Specify  the number of checks allowed to run in parallel. Default value is 24.
                      This value must be an integer value >0.


       All urlfixes are **enabled** **by** **default**.





## ENVIRONMENT VARIABLES
       _DUCK_NOHTTPS_
              If this variable is set, do not try to find matching https URLs to http URLs.

       _XDG_CONFIG_HOME_
              if this variable is set, use the config file (if  any)  _$XDG_HOME/duck/duck.conf_.  The
              default value is _$HOME/.config/duck/duck.conf_ .

       _XDG_CONFIG_DIRS_
              defines  the  preference-ordered  set  of base directories to search for configuration
              files in addition to the **XDG**___**CONFIG**___**HOME** base directory. The directories  in  **XDG**___**CON**‐‐
              **FIG**___**DIRS** should be separated with a colon '**:**'.




## EXAMPLE
       To run duck, change your working directory to an extracted Debian source package and run:
### duck

## EXIT STATUS
       **0**      Success, no errors

       **1**      Error(s) detected

       **2**      User-specified file not found


## FILES
       _debian/duck-overrides_
              Overrides-file  in  the  Debian package source tree. This files contains a list of URL
              regexs which should not be reported as down/broken. This might  be  useful  in  cases,
              where  URLs  are  extracted  from  old/outdated copyright-files or patches, which will
              never ever be working, and which will then lead to false positives. Please see an  ex‐
              ample in _/usr/share/doc/duck/examples_.

       _duck.conf_
              Config  file  which  contains  the  regular expressions used to detect parked domains,
              redirected websites and The default file is in _/etc/duck/duck.conf_. duck  also  honors
              the  XDG  Base  Directory Specification, see the section **ENVIRONMENT** **VARIABLES** for de‐
              tails.  Search order for _duck.conf_ is:

              _$XDG_CONFIG_HOME/duck/duck.conf_ (default: $HOME/.config/duck/duck.conf)

              _/etc/duck/duck.conf_

              _/$XDG_CONFIG_DIRS_ (default: /etc/xdg/duck/duck.conf)

              Please see the  **XDG**  **Base**  **Directory**  **Specification**  (_<https://specifications.freedesk__>‐
              _top.org/basedir-spec/basedir-spec-latest.html_) for more details.


## SEE ALSO
       Please  see _<http://duck.debian.net/_> for additional information as well as an overview of duck
       checks run on all source packages in _Debian/unstable_.



                                             2017-08-10                                      [DUCK(1)](https://www.chedong.com/phpMan.php/man/DUCK/1/markdown)
