Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
fhdk committed May 2, 2017
1 parent 902c736 commit 6b6869a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.1.2] 2017-05-02
- Fix: Issue where values from configuration was not parsed correct.

## [4.1.1] 2017-05-01
- Added `-u` / `--update` option
* Run `pacman -Syy` after mirrorlist generation
Expand Down
6 changes: 5 additions & 1 deletion docs/index.md
Expand Up @@ -72,13 +72,17 @@ Make pacman-mirrors silent.
`-u`, `update`
Run `pacman -Syy` after mirrorlist generation

`-a`, `--api` [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]]
Do api tasks before generating mirrorlist.

`-a`, `--api` [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]]

- `--prefix` for pacman-mirrors file-handling eg. /mnt/install or $mnt.
- `--get-branch` returns branch from config in prefix`config_file`.
* Ignored if `--branch` is supplied.
- `--set-branch` writes branch specified in `--branch` to prefix`config_file`.
* Ignored if `--branch` is not supplied.
- `--protocols` write the specified protocols to prefix`pacman-mirrors.conf`.
- `-u`, `--no-mirrorlist` exit when api tasks finish

## Content of pacman-mirrors.conf

Expand Down
14 changes: 10 additions & 4 deletions pacman_mirrors/configfn.py
Expand Up @@ -40,7 +40,7 @@ def api_write_branch(branch, filename):
filename), delete=False) as tmp:
replaced = False
for line in cnf:
if "Branch = " in line:
if "Branch =" in line:
tmp.write(branch)
replaced = True
else:
Expand Down Expand Up @@ -70,7 +70,7 @@ def api_write_protocols(protocols, filename):
filename), delete=False) as tmp:
replaced = False
for line in cnf:
if "Protocols = " in line:
if "Protocols =" in line:
tmp.write(protocols)
replaced = True
else:
Expand Down Expand Up @@ -132,7 +132,10 @@ def build_config():
config["branch"] = value
elif key == "OnlyCountry":
custom = True
config["only_country"] = value.split(",")
if "," in value:
config["only_country"] = value.split(",")
else:
config["only_country"] = value.split(" ")
elif key == "MirrorlistsDir":
config["work_dir"] = value
elif key == "OutputMirrorlist":
Expand All @@ -143,7 +146,10 @@ def build_config():
if value == "False":
config["ssl_verify"] = False
elif key == "Protocols":
config["protocols"] = value.split(",")
if "," in value:
config["protocols"] = value.split(",")
else:
config["protocols"] = value.split(" ")
except (PermissionError, OSError) as err:
print(".: {} {}: {}: {}".format(txt.ERR_CLR,
txt.CANNOT_READ_FILE,
Expand Down
20 changes: 12 additions & 8 deletions site/index.html
Expand Up @@ -149,13 +149,17 @@ <h2 id="commands">Commands</h2>
Make pacman-mirrors silent.</p>
<p><code>-u</code>, <code>update</code>
Run <code>pacman -Syy</code> after mirrorlist generation</p>
<p><code>-a</code>, <code>--api</code> [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]]
- <code>--prefix</code> for pacman-mirrors file-handling eg. /mnt/install or $mnt.
- <code>--get-branch</code> returns branch from config in prefix<code>config_file</code>.
* Ignored if <code>--branch</code> is supplied.
- <code>--set-branch</code> writes branch specified in <code>--branch</code> to prefix<code>config_file</code>.
* Ignored if <code>--branch</code> is not supplied.
- <code>--protocols</code> write the specified protocols to prefix<code>pacman-mirrors.conf</code>.</p>
<p>Do api tasks before generating mirrorlist.</p>
<p><code>-a</code>, <code>--api</code> [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]]</p>
<ul>
<li><code>--prefix</code> for pacman-mirrors file-handling eg. /mnt/install or $mnt.</li>
<li><code>--get-branch</code> returns branch from config in prefix<code>config_file</code>. </li>
<li>Ignored if <code>--branch</code> is supplied.</li>
<li><code>--set-branch</code> writes branch specified in <code>--branch</code> to prefix<code>config_file</code>.</li>
<li>Ignored if <code>--branch</code> is not supplied.</li>
<li><code>--protocols</code> write the specified protocols to prefix<code>pacman-mirrors.conf</code>.</li>
<li><code>-u</code>, <code>--no-mirrorlist</code> exit when api tasks finish </li>
</ul>
<h2 id="content-of-pacman-mirrorsconf">Content of pacman-mirrors.conf</h2>
<pre><code>##
## /etc/pacman-mirrors.conf
Expand Down Expand Up @@ -241,5 +245,5 @@ <h4 class="modal-title" id="exampleModalLabel">Search</h4>

<!--
MkDocs version : 0.16.1
Build Date UTC : 2017-05-01 14:09:22
Build Date UTC : 2017-05-02 05:30:34
-->
4 changes: 2 additions & 2 deletions site/mkdocs/search_index.json
Expand Up @@ -2,7 +2,7 @@
"docs": [
{
"location": "/",
"text": "Documentation of pacman-mirrors\n\n\nEnhanced pacman-mirrors for Manjaro Linux\n\n\nCommands\n\n\n-h\n, \n--help\n\nShow the help message.\n\n\n-g\n, \n--generate\n\nGenerate a new mirrorlist.\n\n\n-m [method]\n, \n--method [method]\n\nChoose the generation method:\n\n\n\n\nrank\n\n\nrandom\n\n\n\n\n-b [branch]\n, \n--branch [branch]\n\nChoose the branch to use:\n\n\n\n\nstable\n\n\ntesting\n\n\nunstable\n\n\n\n\n-c COUNTRY [COUNTRY ...]\n, \n--country COUNTRY [COUNTRY ...]\n\nSpecifiy country or list of countries separated by comma or space:\n\n\n\n\nFrance\n\n\nFrance, Germany, Austria\n\n\nFrance Germany Austria\n\n\n\n\nTo reset a custom mirror file\n\n\n\n\nall\n\n\n\n\n--geoip\n\nDetect country by using geolocation.\n\n\n-d\n, \n--mirror_dir\n\nChange directory of mirrors to use.\n\n\n-f [n]\n, \n--fasttrack [n]\n\nGenerates an updated and responsive mirrorlist of [n] mirrors.\n\n\n-l\n, \n--list\n\nLists available mirror countries\n\n\n-o\n, \n--output\n\nChange path of the output file.\n\n\n-t\n, \n--timeout\n\nChange the server maximum waiting time.\n\n\n--no-update\n\nDon't generate mirrorlist.\n\n\n-i\n, \n--interactive\n\nLaunch a graphical tool to select mirrors to generate a custom mirrorlist.\n\n\n--default\n\nUsed in conjunction with \n-i/--interactive\n ignores custom mirrorfile,\n\nloading the default mirrorfile, allowing to create a new custom mirrorfile \nand executes the ranking/randomizing process after the selection of mirrors.\n\n\n-v\n, \n--version\n\nShow the version of pacman-mirrors.\n\n\n--quiet\n\nMake pacman-mirrors silent.\n\n\n-u\n, \nupdate\n\nRun \npacman -Syy\n after mirrorlist generation\n\n\n-a\n, \n--api\n [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]] \n- \n--prefix\n for pacman-mirrors file-handling eg. /mnt/install or $mnt.\n- \n--get-branch\n returns branch from config in prefix\nconfig_file\n. \n * Ignored if \n--branch\n is supplied.\n- \n--set-branch\n writes branch specified in \n--branch\n to prefix\nconfig_file\n.\n * Ignored if \n--branch\n is not supplied.\n- \n--protocols\n write the specified protocols to prefix\npacman-mirrors.conf\n.\n\n\nContent of pacman-mirrors.conf\n\n\n##\n## /etc/pacman-mirrors.conf\n##\n\n## Branch Pacman should use (stable, testing, unstable)\n# Branch = stable\n\n## Generation method\n## 1) rank - rank mirrors depending on their access time\n## 2) random - randomly generate the output mirrorlist\n# Method = rank\n\n## Define protocols and priority\n## separated by comma 'https,http' or 'http,https'\n## or space 'https http' or 'http https'\n## ATM available protocols are: http, https, ftp\n## Not specifying a protocol will ban the protocol from being used\n## Empty means all in reversed alphabetic order\n## If a mirror has more than one protocol defined \n## only the first is written to the mirrorlist\n# Protocols =\n\n## Specify to use only mirrors from a specific country.\n## Can add multiple countries\n## separated by comma 'Germany,France,Belgium'\n## or space 'Germany France Belgium'\n## Get a list of all available counties with 'pacman-mirrors -l'\n## Empty means all\n# OnlyCountry =\n\n## Mirrors directory\n# MirrorlistsDir = /var/lib/pacman-mirrors\n\n## Output file\n# OutputMirrorlist = /etc/pacman.d/mirrorlist\n\n## When set to True prevents the regeneration of the mirrorlist if\n## pacman-mirrors is invoked with the --no-update argument.\n## Useful if you don't want the mirrorlist regenerated after a\n## pacman-mirrors package upgrade.\n# NoUpdate = False\n\n## When set to False - all certificates are accepted.\n## Use only if you fully trust all ssl-enabled mirrors.\n# SSLVerify = True",
"text": "Documentation of pacman-mirrors\n\n\nEnhanced pacman-mirrors for Manjaro Linux\n\n\nCommands\n\n\n-h\n, \n--help\n\nShow the help message.\n\n\n-g\n, \n--generate\n\nGenerate a new mirrorlist.\n\n\n-m [method]\n, \n--method [method]\n\nChoose the generation method:\n\n\n\n\nrank\n\n\nrandom\n\n\n\n\n-b [branch]\n, \n--branch [branch]\n\nChoose the branch to use:\n\n\n\n\nstable\n\n\ntesting\n\n\nunstable\n\n\n\n\n-c COUNTRY [COUNTRY ...]\n, \n--country COUNTRY [COUNTRY ...]\n\nSpecifiy country or list of countries separated by comma or space:\n\n\n\n\nFrance\n\n\nFrance, Germany, Austria\n\n\nFrance Germany Austria\n\n\n\n\nTo reset a custom mirror file\n\n\n\n\nall\n\n\n\n\n--geoip\n\nDetect country by using geolocation.\n\n\n-d\n, \n--mirror_dir\n\nChange directory of mirrors to use.\n\n\n-f [n]\n, \n--fasttrack [n]\n\nGenerates an updated and responsive mirrorlist of [n] mirrors.\n\n\n-l\n, \n--list\n\nLists available mirror countries\n\n\n-o\n, \n--output\n\nChange path of the output file.\n\n\n-t\n, \n--timeout\n\nChange the server maximum waiting time.\n\n\n--no-update\n\nDon't generate mirrorlist.\n\n\n-i\n, \n--interactive\n\nLaunch a graphical tool to select mirrors to generate a custom mirrorlist.\n\n\n--default\n\nUsed in conjunction with \n-i/--interactive\n ignores custom mirrorfile,\n\nloading the default mirrorfile, allowing to create a new custom mirrorfile \nand executes the ranking/randomizing process after the selection of mirrors.\n\n\n-v\n, \n--version\n\nShow the version of pacman-mirrors.\n\n\n--quiet\n\nMake pacman-mirrors silent.\n\n\n-u\n, \nupdate\n\nRun \npacman -Syy\n after mirrorlist generation\n\n\nDo api tasks before generating mirrorlist.\n\n\n-a\n, \n--api\n [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]]\n\n\n\n\n--prefix\n for pacman-mirrors file-handling eg. /mnt/install or $mnt.\n\n\n--get-branch\n returns branch from config in prefix\nconfig_file\n. \n\n\nIgnored if \n--branch\n is supplied.\n\n\n--set-branch\n writes branch specified in \n--branch\n to prefix\nconfig_file\n.\n\n\nIgnored if \n--branch\n is not supplied.\n\n\n--protocols\n write the specified protocols to prefix\npacman-mirrors.conf\n.\n\n\n-u\n, \n--no-mirrorlist\n exit when api tasks finish \n\n\n\n\nContent of pacman-mirrors.conf\n\n\n##\n## /etc/pacman-mirrors.conf\n##\n\n## Branch Pacman should use (stable, testing, unstable)\n# Branch = stable\n\n## Generation method\n## 1) rank - rank mirrors depending on their access time\n## 2) random - randomly generate the output mirrorlist\n# Method = rank\n\n## Define protocols and priority\n## separated by comma 'https,http' or 'http,https'\n## or space 'https http' or 'http https'\n## ATM available protocols are: http, https, ftp\n## Not specifying a protocol will ban the protocol from being used\n## Empty means all in reversed alphabetic order\n## If a mirror has more than one protocol defined \n## only the first is written to the mirrorlist\n# Protocols =\n\n## Specify to use only mirrors from a specific country.\n## Can add multiple countries\n## separated by comma 'Germany,France,Belgium'\n## or space 'Germany France Belgium'\n## Get a list of all available counties with 'pacman-mirrors -l'\n## Empty means all\n# OnlyCountry =\n\n## Mirrors directory\n# MirrorlistsDir = /var/lib/pacman-mirrors\n\n## Output file\n# OutputMirrorlist = /etc/pacman.d/mirrorlist\n\n## When set to True prevents the regeneration of the mirrorlist if\n## pacman-mirrors is invoked with the --no-update argument.\n## Useful if you don't want the mirrorlist regenerated after a\n## pacman-mirrors package upgrade.\n# NoUpdate = False\n\n## When set to False - all certificates are accepted.\n## Use only if you fully trust all ssl-enabled mirrors.\n# SSLVerify = True",
"title": "Home"
},
{
Expand All @@ -12,7 +12,7 @@
},
{
"location": "/#commands",
"text": "-h , --help \nShow the help message. -g , --generate \nGenerate a new mirrorlist. -m [method] , --method [method] \nChoose the generation method: rank random -b [branch] , --branch [branch] \nChoose the branch to use: stable testing unstable -c COUNTRY [COUNTRY ...] , --country COUNTRY [COUNTRY ...] \nSpecifiy country or list of countries separated by comma or space: France France, Germany, Austria France Germany Austria To reset a custom mirror file all --geoip \nDetect country by using geolocation. -d , --mirror_dir \nChange directory of mirrors to use. -f [n] , --fasttrack [n] \nGenerates an updated and responsive mirrorlist of [n] mirrors. -l , --list \nLists available mirror countries -o , --output \nChange path of the output file. -t , --timeout \nChange the server maximum waiting time. --no-update \nDon't generate mirrorlist. -i , --interactive \nLaunch a graphical tool to select mirrors to generate a custom mirrorlist. --default \nUsed in conjunction with -i/--interactive ignores custom mirrorfile, \nloading the default mirrorfile, allowing to create a new custom mirrorfile \nand executes the ranking/randomizing process after the selection of mirrors. -v , --version \nShow the version of pacman-mirrors. --quiet \nMake pacman-mirrors silent. -u , update \nRun pacman -Syy after mirrorlist generation -a , --api [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]] \n- --prefix for pacman-mirrors file-handling eg. /mnt/install or $mnt.\n- --get-branch returns branch from config in prefix config_file . \n * Ignored if --branch is supplied.\n- --set-branch writes branch specified in --branch to prefix config_file .\n * Ignored if --branch is not supplied.\n- --protocols write the specified protocols to prefix pacman-mirrors.conf .",
"text": "-h , --help \nShow the help message. -g , --generate \nGenerate a new mirrorlist. -m [method] , --method [method] \nChoose the generation method: rank random -b [branch] , --branch [branch] \nChoose the branch to use: stable testing unstable -c COUNTRY [COUNTRY ...] , --country COUNTRY [COUNTRY ...] \nSpecifiy country or list of countries separated by comma or space: France France, Germany, Austria France Germany Austria To reset a custom mirror file all --geoip \nDetect country by using geolocation. -d , --mirror_dir \nChange directory of mirrors to use. -f [n] , --fasttrack [n] \nGenerates an updated and responsive mirrorlist of [n] mirrors. -l , --list \nLists available mirror countries -o , --output \nChange path of the output file. -t , --timeout \nChange the server maximum waiting time. --no-update \nDon't generate mirrorlist. -i , --interactive \nLaunch a graphical tool to select mirrors to generate a custom mirrorlist. --default \nUsed in conjunction with -i/--interactive ignores custom mirrorfile, \nloading the default mirrorfile, allowing to create a new custom mirrorfile \nand executes the ranking/randomizing process after the selection of mirrors. -v , --version \nShow the version of pacman-mirrors. --quiet \nMake pacman-mirrors silent. -u , update \nRun pacman -Syy after mirrorlist generation Do api tasks before generating mirrorlist. -a , --api [--prefix] [{--get-branch | --set-branch}] [--protocols PROTO [PROTO ...]] --prefix for pacman-mirrors file-handling eg. /mnt/install or $mnt. --get-branch returns branch from config in prefix config_file . Ignored if --branch is supplied. --set-branch writes branch specified in --branch to prefix config_file . Ignored if --branch is not supplied. --protocols write the specified protocols to prefix pacman-mirrors.conf . -u , --no-mirrorlist exit when api tasks finish",
"title": "Commands"
},
{
Expand Down
6 changes: 3 additions & 3 deletions site/sitemap.xml
Expand Up @@ -4,23 +4,23 @@

<url>
<loc>/</loc>
<lastmod>2017-05-01</lastmod>
<lastmod>2017-05-02</lastmod>
<changefreq>daily</changefreq>
</url>



<url>
<loc>/installation/</loc>
<lastmod>2017-05-01</lastmod>
<lastmod>2017-05-02</lastmod>
<changefreq>daily</changefreq>
</url>



<url>
<loc>/usage/</loc>
<lastmod>2017-05-01</lastmod>
<lastmod>2017-05-02</lastmod>
<changefreq>daily</changefreq>
</url>

Expand Down

0 comments on commit 6b6869a

Please sign in to comment.