mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 11:59:15 +00:00
update doc and tests for link
This commit is contained in:
@@ -72,7 +72,7 @@ set -l f -s f -l force -d "Do not ask user confirmation for anything."
|
|||||||
set -l G -s G -l grepable -d "Grepable output."
|
set -l G -s G -l grepable -d "Grepable output."
|
||||||
set -l i -s i -l ignore -d "Pattern to ignore."
|
set -l i -s i -l ignore -d "Pattern to ignore."
|
||||||
set -l k -s k -l key -d "Treat <path> as a dotfile key."
|
set -l k -s k -l key -d "Treat <path> as a dotfile key."
|
||||||
set -l l -s l -l link -d "Link option (nolink|link|link_children)."
|
set -l l -s l -l link -d "Link option (nolink|absolute|relative|link_children)."
|
||||||
set -l L -s L -l file-only -d "Do not show diff but only the files that differ."
|
set -l L -s L -l file-only -d "Do not show diff but only the files that differ."
|
||||||
set -l m -s m -l preserve-mode -d "Insert a chmod entry in the dotfile with its mode."
|
set -l m -s m -l preserve-mode -d "Insert a chmod entry in the dotfile with its mode."
|
||||||
set -l n -s n -l nodiff -d "Do not diff when installing."
|
set -l n -s n -l nodiff -d "Do not diff when installing."
|
||||||
@@ -91,7 +91,7 @@ set -l h -s h -l help -d "Show this screen."
|
|||||||
set -al c -rF
|
set -al c -rF
|
||||||
set -al C -rF
|
set -al C -rF
|
||||||
set -al i -x
|
set -al i -x
|
||||||
set -al l -x -a "nolink link link_children"
|
set -al l -x -a "nolink absolute relative link_children"
|
||||||
set -al p -x -a "(__fish_dotdrop_list_profiles)"
|
set -al p -x -a "(__fish_dotdrop_list_profiles)"
|
||||||
set -al s -rF
|
set -al s -rF
|
||||||
set -al w -x
|
set -al w -x
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ Entry | Description | Default
|
|||||||
`keepdot` | Preserve leading dot when importing hidden file in the `dotpath` | false
|
`keepdot` | Preserve leading dot when importing hidden file in the `dotpath` | false
|
||||||
`key_prefix` | Prefix dotfile key on `import` with `f<key_separator>` for file and `d<key_separator>` for directory | true
|
`key_prefix` | Prefix dotfile key on `import` with `f<key_separator>` for file and `d<key_separator>` for directory | true
|
||||||
`key_separator` | Separator to use on dotfile key generation on `import` | `_`
|
`key_separator` | Separator to use on dotfile key generation on `import` | `_`
|
||||||
`link_dotfile_default` | Set a dotfile's `link` attribute to this value when undefined. Possible values: *nolink*, *link* (See [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) | `nolink`
|
`link_dotfile_default` | Set a dotfile's `link` attribute to this value when undefined. Possible values: *nolink*, *absolute*, *relative* (See [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) | `nolink`
|
||||||
`link_on_import` | Set a dotfile's `link` attribute to this value when importing. Possible values: *nolink*, *link* [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) | `nolink`
|
`link_on_import` | Set a dotfile's `link` attribute to this value when importing. Possible values: *nolink*, *absolute*, *relative* [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) | `nolink`
|
||||||
`longkey` | Use long keys for dotfiles when importing (See [Import dotfiles](usage.md#import-dotfiles)) | false
|
`longkey` | Use long keys for dotfiles when importing (See [Import dotfiles](usage.md#import-dotfiles)) | false
|
||||||
`minversion` | (*for internal use, do not modify*) Provides the minimal dotdrop version to use | -
|
`minversion` | (*for internal use, do not modify*) Provides the minimal dotdrop version to use | -
|
||||||
`showdiff` | On install, show a diff before asking to overwrite (See `--showdiff`) | false
|
`showdiff` | On install, show a diff before asking to overwrite (See `--showdiff`) | false
|
||||||
`template_dotfile_default` | Disable templating on all dotfiles when set to false | true
|
`template_dotfile_default` | Disable templating on all dotfiles when set to false | true
|
||||||
`upignore` | List of patterns to ignore when updating, appled to all dotfiles (enclose in quotes when using wildcards; see [ignore patterns](config-file.md#ignore-patterns)) | -
|
`upignore` | List of patterns to ignore when updating, appled to all dotfiles (enclose in quotes when using wildcards; see [ignore patterns](config-file.md#ignore-patterns)) | -
|
||||||
`workdir` | Path to the directory where templates are installed before being symlinked when using `link:link` or `link:link_children` (absolute path or relative to the config file location) | `~/.config/dotdrop`
|
`workdir` | Path to the directory where templates are installed before being symlinked when using `link:absolute|relative|link_children` (absolute path or relative to the config file location) | `~/.config/dotdrop`
|
||||||
<s>link_by_default</s> | When importing a dotfile, set `link` to this value by default | false
|
<s>link_by_default</s> | When importing a dotfile, set `link` to this value by default | false
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Entry | Description
|
|||||||
-------- | -------------
|
-------- | -------------
|
||||||
`dst` | Where this dotfile needs to be deployed (dotfiles with empty `dst` are ignored and considered installed, can use `variables`, make sure to quote)
|
`dst` | Where this dotfile needs to be deployed (dotfiles with empty `dst` are ignored and considered installed, can use `variables`, make sure to quote)
|
||||||
`src` | Dotfile path within the `dotpath` (dotfiles with empty `src` are ignored and considered installed, can use `variables`, make sure to quote)
|
`src` | Dotfile path within the `dotpath` (dotfiles with empty `src` are ignored and considered installed, can use `variables`, make sure to quote)
|
||||||
`link` | Defines how this dotfile is installed. Possible values: *nolink*, *link*, *link_children* (See [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) (defaults to value of `link_dotfile_default`)
|
`link` | Defines how this dotfile is installed. Possible values: *nolink*, *absolute*, *relative*, *link_children* (See [Symlinking dotfiles](config-file.md#symlinking-dotfiles)) (defaults to value of `link_dotfile_default`)
|
||||||
`actions` | List of action keys that need to be defined in the **actions** entry below (See [actions](config-actions.md))
|
`actions` | List of action keys that need to be defined in the **actions** entry below (See [actions](config-actions.md))
|
||||||
`chmod` | Defines the file permissions in octal notation to apply during installation (See [permissions](config-file.md#permissions))
|
`chmod` | Defines the file permissions in octal notation to apply during installation (See [permissions](config-file.md#permissions))
|
||||||
`cmpignore` | List of patterns to ignore when comparing (enclose in quotes when using wildcards; see [ignore patterns](config-file.md#ignore-patterns))
|
`cmpignore` | List of patterns to ignore when comparing (enclose in quotes when using wildcards; see [ignore patterns](config-file.md#ignore-patterns))
|
||||||
@@ -25,7 +25,7 @@ Entry | Description
|
|||||||
dst: <where-this-file-is-deployed>
|
dst: <where-this-file-is-deployed>
|
||||||
src: <filename-within-the-dotpath>
|
src: <filename-within-the-dotpath>
|
||||||
## Optional
|
## Optional
|
||||||
link: (nolink|link|link_children)
|
link: (nolink|absolute|relative|link_children)
|
||||||
ignoreempty: (true|false)
|
ignoreempty: (true|false)
|
||||||
cmpignore:
|
cmpignore:
|
||||||
- "<ignore-pattern>"
|
- "<ignore-pattern>"
|
||||||
@@ -209,7 +209,7 @@ profiles:
|
|||||||
dotfiles:
|
dotfiles:
|
||||||
- f_test
|
- f_test
|
||||||
variables:
|
variables:
|
||||||
link_value: "link"
|
link_value: "absolute"
|
||||||
windows:
|
windows:
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- f_test
|
- f_test
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ Dotdrop is able to install dotfiles in three different ways,
|
|||||||
which are controlled by the `link` config attribute of each dotfile:
|
which are controlled by the `link` config attribute of each dotfile:
|
||||||
|
|
||||||
* `link: nolink`: The dotfile (file or directory) is copied to its destination
|
* `link: nolink`: The dotfile (file or directory) is copied to its destination
|
||||||
* `link: link`: The dotfile (file or directory) is symlinked to its destination
|
* `link: absolute`: The dotfile (file or directory) is linked to its destination using an absolute symlink
|
||||||
|
* `link: relative`: The dotfile (file or directory) is linked to its destination using a relative symlink
|
||||||
* `link: link_children`: The files/directories found under the dotfile (directory) are symlinked to their destination
|
* `link: link_children`: The files/directories found under the dotfile (directory) are symlinked to their destination
|
||||||
|
|
||||||
For more, see [this how-to](howto/symlink-dotfiles.md).
|
For more, see [this how-to](howto/symlink-dotfiles.md).
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ There are two types of transformations available:
|
|||||||
A typical use-case for transformations is when dotfiles need to be
|
A typical use-case for transformations is when dotfiles need to be
|
||||||
stored encrypted or compressed. For more, see [the howto](howto/howto.md).
|
stored encrypted or compressed. For more, see [the howto](howto/howto.md).
|
||||||
|
|
||||||
Note that transformations cannot be used if the dotfile is to be linked (when `link: link` or `link: link_children`).
|
Note that transformations cannot be used if the dotfile is to be linked (when `link: absolute|relative|link_children`).
|
||||||
|
|
||||||
Transformations also support additional positional arguments that must start from 2 (since `{0}` and `{1}` are added automatically). The transformations themselves as well as their arguments can also be templated.
|
Transformations also support additional positional arguments that must start from 2 (since `{0}` and `{1}` are added automatically). The transformations themselves as well as their arguments can also be templated.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Dotdrop offers two ways to symlink a dotfile through its
|
Dotdrop offers two ways to symlink a dotfile through its
|
||||||
config entry `link`:
|
config entry `link`:
|
||||||
|
|
||||||
* Setting `link: link` for a dotfile will symlink `dst` to `src`
|
* Setting `link: absolute` or `link: relative` for a dotfile will symlink `dst` to `src`
|
||||||
* Setting `link: link_children` will, for every direct child of `src`, symlink `dst/<childrenX>` to `src/<childrenX>` (See [Link children](#link-children))
|
* Setting `link: link_children` will, for every direct child of `src`, symlink `dst/<childrenX>` to `src/<childrenX>` (See [Link children](#link-children))
|
||||||
|
|
||||||
where `src` is the file stored in your *dotpath* and
|
where `src` is the file stored in your *dotpath* and
|
||||||
@@ -28,13 +28,13 @@ $ dotdrop import ~/.bashrc
|
|||||||
-> "/home/user/.bashrc" imported
|
-> "/home/user/.bashrc" imported
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit the `config.yaml` and set the `link` value to `link`:
|
Edit the `config.yaml` and set the `link` value to `absolute`:
|
||||||
```yaml
|
```yaml
|
||||||
dotfiles:
|
dotfiles:
|
||||||
f_bashrc:
|
f_bashrc:
|
||||||
src: bashrc
|
src: bashrc
|
||||||
dst: ~/.bashrc
|
dst: ~/.bashrc
|
||||||
link: link
|
link: absolute
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the dotfile, which will remove your `~/.bashrc` and replace it with a link to the file stored in dotdrop:
|
Install the dotfile, which will remove your `~/.bashrc` and replace it with a link to the file stored in dotdrop:
|
||||||
@@ -64,7 +64,7 @@ Setting this option on a file that is not a directory will make any operation on
|
|||||||
|
|
||||||
A good example of its use is when managing `~/.vim` with dotdrop.
|
A good example of its use is when managing `~/.vim` with dotdrop.
|
||||||
|
|
||||||
Here's what it looks like when using `link: link`:
|
Here's what it looks like when using `link: absolute`:
|
||||||
```yaml
|
```yaml
|
||||||
config:
|
config:
|
||||||
dotpath: dotfiles
|
dotpath: dotfiles
|
||||||
@@ -72,7 +72,7 @@ dotfiles:
|
|||||||
vim:
|
vim:
|
||||||
dst: ~/.vim
|
dst: ~/.vim
|
||||||
src: vim
|
src: vim
|
||||||
link: link
|
link: absolute
|
||||||
```
|
```
|
||||||
|
|
||||||
The top directory `~/.vim` is symlinked to the `<dotpath>/vim` location:
|
The top directory `~/.vim` is symlinked to the `<dotpath>/vim` location:
|
||||||
@@ -126,7 +126,7 @@ to dotdrop's `dotpath` directory (see [the config file doc](../config-file.md)).
|
|||||||
When using templating directives, however, the dotfiles are first installed into
|
When using templating directives, however, the dotfiles are first installed into
|
||||||
`workdir` (defaults to *~/.config/dotdrop*; see [the doc](../config-config.md))
|
`workdir` (defaults to *~/.config/dotdrop*; see [the doc](../config-config.md))
|
||||||
and then symlinked there.
|
and then symlinked there.
|
||||||
This applies to both dotfiles with `link: link` and `link: link_children`.
|
This applies to both dotfiles with `link: absolute|relative` and `link: link_children`.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Obviously, if the dotfile uses template directives, it needs to be templated. Ho
|
|||||||
is not, disabling templating will speed up its installation (since it won't have to be
|
is not, disabling templating will speed up its installation (since it won't have to be
|
||||||
processed by the engine).
|
processed by the engine).
|
||||||
|
|
||||||
For dotfiles being symlinked (`link` or `link_children`), see
|
For dotfiles being symlinked (`absolute`, `relative` or `link_children`), see
|
||||||
[the dedicated doc](howto/symlink-dotfiles.md#templating-symlinked-dotfiles).
|
[the dedicated doc](howto/symlink-dotfiles.md#templating-symlinked-dotfiles).
|
||||||
|
|
||||||
## Delimiters
|
## Delimiters
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ def _dotfile_install(opts, dotfile, tmpdir=None):
|
|||||||
LinkTypes.LINK, LinkTypes.LINK_CHILDREN,
|
LinkTypes.LINK, LinkTypes.LINK_CHILDREN,
|
||||||
LinkTypes.RELATIVE, LinkTypes.ABSOLUTE
|
LinkTypes.RELATIVE, LinkTypes.ABSOLUTE
|
||||||
):
|
):
|
||||||
# link|relative|absolute|link_children
|
# nolink|relative|absolute|link_children
|
||||||
ret, err = inst.install(templ, dotfile.src, dotfile.dst,
|
ret, err = inst.install(templ, dotfile.src, dotfile.dst,
|
||||||
dotfile.link,
|
dotfile.link,
|
||||||
actionexec=pre_actions_exec,
|
actionexec=pre_actions_exec,
|
||||||
@@ -645,7 +645,7 @@ def cmd_remove(opts):
|
|||||||
k = dotfile.key
|
k = dotfile.key
|
||||||
# ignore if uses any type of link
|
# ignore if uses any type of link
|
||||||
if dotfile.link != LinkTypes.NOLINK:
|
if dotfile.link != LinkTypes.NOLINK:
|
||||||
msg = '{} uses link/link_children, remove manually'
|
msg = '{} uses symlink, remove manually'
|
||||||
LOG.warn(msg.format(k))
|
LOG.warn(msg.format(k))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ ETCCFG = '/etc/{}'.format(NAME)
|
|||||||
|
|
||||||
OPT_LINK = {
|
OPT_LINK = {
|
||||||
LinkTypes.NOLINK.name.lower(): LinkTypes.NOLINK,
|
LinkTypes.NOLINK.name.lower(): LinkTypes.NOLINK,
|
||||||
LinkTypes.LINK.name.lower(): LinkTypes.LINK,
|
LinkTypes.ABSOLUTE.name.lower(): LinkTypes.ABSOLUTE,
|
||||||
|
LinkTypes.RELATIVE.name.lower(): LinkTypes.RELATIVE,
|
||||||
LinkTypes.LINK_CHILDREN.name.lower(): LinkTypes.LINK_CHILDREN}
|
LinkTypes.LINK_CHILDREN.name.lower(): LinkTypes.LINK_CHILDREN}
|
||||||
|
|
||||||
BANNER = r""" _ _ _
|
BANNER = r""" _ _ _
|
||||||
@@ -82,7 +83,7 @@ Options:
|
|||||||
-G --grepable Grepable output.
|
-G --grepable Grepable output.
|
||||||
-i --ignore=<pattern> Pattern to ignore.
|
-i --ignore=<pattern> Pattern to ignore.
|
||||||
-k --key Treat <path> as a dotfile key.
|
-k --key Treat <path> as a dotfile key.
|
||||||
-l --link=<link> Link option (nolink|link|link_children).
|
-l --link=<link> Link option (nolink|absolute|relative|link_children).
|
||||||
-L --file-only Do not show diff but only the files that differ.
|
-L --file-only Do not show diff but only the files that differ.
|
||||||
-m --preserve-mode Insert a chmod entry in the dotfile with its mode.
|
-m --preserve-mode Insert a chmod entry in the dotfile with its mode.
|
||||||
-n --nodiff Do not diff when installing.
|
-n --nodiff Do not diff when installing.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ USAGE = """
|
|||||||
change-link.py
|
change-link.py
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
change-link.py (--true | --false) [--ignore=<dotfile-name>...] <config.yaml>
|
change-link.py --value=<value> [--ignore=<dotfile-name>...] <config.yaml>
|
||||||
change-link.py --help
|
change-link.py --help
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
@@ -35,11 +35,7 @@ def main():
|
|||||||
"""entry point"""
|
"""entry point"""
|
||||||
args = docopt(USAGE)
|
args = docopt(USAGE)
|
||||||
path = os.path.expanduser(args['<config.yaml>'])
|
path = os.path.expanduser(args['<config.yaml>'])
|
||||||
if args['--true']:
|
value = args['--value']
|
||||||
value = True
|
|
||||||
if args['--false']:
|
|
||||||
value = False
|
|
||||||
|
|
||||||
ignores = args['--ignore']
|
ignores = args['--ignore']
|
||||||
|
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r') as file:
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ mkdir -p ${tmps}/dotfiles
|
|||||||
|
|
||||||
# import without --preserve-mode and link
|
# import without --preserve-mode and link
|
||||||
for i in ${toimport}; do
|
for i in ${toimport}; do
|
||||||
cd ${ddpath} | ${bin} import -c ${cfg} -l link -f -p p1 -V ${i}
|
cd ${ddpath} | ${bin} import -c ${cfg} -l absolute -f -p p1 -V ${i}
|
||||||
done
|
done
|
||||||
|
|
||||||
cat ${cfg}
|
cat ${cfg}
|
||||||
@@ -155,7 +155,7 @@ cnt=`cat ${cfg} | grep "chmod: '777'" | wc -l`
|
|||||||
[ "${cnt}" != "${tot}" ] && echo "not all chmod inserted (2)" && exit 1
|
[ "${cnt}" != "${tot}" ] && echo "not all chmod inserted (2)" && exit 1
|
||||||
|
|
||||||
tot=`echo ${toimport} | wc -w`
|
tot=`echo ${toimport} | wc -w`
|
||||||
cnt=`cat ${cfg} | grep 'link: link' | wc -l`
|
cnt=`cat ${cfg} | grep 'link: absolute' | wc -l`
|
||||||
[ "${cnt}" != "${tot}" ] && echo "not all link inserted" && exit 1
|
[ "${cnt}" != "${tot}" ] && echo "not all link inserted" && exit 1
|
||||||
|
|
||||||
## --preserve-mode
|
## --preserve-mode
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ set -e
|
|||||||
|
|
||||||
# test values have been correctly updated
|
# test values have been correctly updated
|
||||||
echo "========> test for updated entries"
|
echo "========> test for updated entries"
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_link' | head -1 | grep ',link:link,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_link' | head -1 | grep ',link:absolute,'
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink' | head -1 | grep ',link:nolink,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink' | head -1 | grep ',link:nolink,'
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink1' | head -1 | grep ',link:nolink,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink1' | head -1 | grep ',link:nolink,'
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children' | head -1 | grep ',link:link_children,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children' | head -1 | grep ',link:link_children,'
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ inside="${tmps}/dotfiles/${tmpd}/abc"
|
|||||||
[ ! -e ${inside} ] && exit 1
|
[ ! -e ${inside} ] && exit 1
|
||||||
|
|
||||||
cat ${cfg}
|
cat ${cfg}
|
||||||
cat ${cfg} | grep 'link: link' >/dev/null
|
cat ${cfg} | grep 'link: absolute' >/dev/null
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -181,11 +181,11 @@ _EOF
|
|||||||
|
|
||||||
# import
|
# import
|
||||||
df="${tmpd}/qwert"
|
df="${tmpd}/qwert"
|
||||||
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=link
|
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=absolute
|
||||||
|
|
||||||
# checks
|
# checks
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:absolute,'
|
||||||
|
|
||||||
# try to install
|
# try to install
|
||||||
rm -rf ${tmpd}/qwert
|
rm -rf ${tmpd}/qwert
|
||||||
@@ -219,7 +219,7 @@ cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V
|
|||||||
|
|
||||||
# checks
|
# checks
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:absolute,'
|
||||||
|
|
||||||
# try to install
|
# try to install
|
||||||
rm -rf ${tmpd}/qwert
|
rm -rf ${tmpd}/qwert
|
||||||
@@ -349,11 +349,11 @@ _EOF
|
|||||||
|
|
||||||
# import
|
# import
|
||||||
df="${tmpd}/qwert"
|
df="${tmpd}/qwert"
|
||||||
cd ${ddpath} | ${bin} import -f -c ${cfg} --link=link -p p1 ${df} -V
|
cd ${ddpath} | ${bin} import -f -c ${cfg} --link=absolute -p p1 ${df} -V
|
||||||
|
|
||||||
# checks
|
# checks
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:absolute,'
|
||||||
|
|
||||||
# try to install
|
# try to install
|
||||||
rm -rf ${tmpd}/qwert
|
rm -rf ${tmpd}/qwert
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ cd ${ddpath} | ${bin} compare -c ${cfg} -p p1 -V
|
|||||||
|
|
||||||
# ensure minversion is present
|
# ensure minversion is present
|
||||||
cat ${cfg}
|
cat ${cfg}
|
||||||
grep 'link: link' ${cfg}
|
grep 'link: absolute' ${cfg}
|
||||||
grep 'minversion' ${cfg}
|
grep 'minversion' ${cfg}
|
||||||
|
|
||||||
# fake a higher version
|
# fake a higher version
|
||||||
|
|||||||
@@ -51,17 +51,20 @@ class TestConfig(SubsetTestCase):
|
|||||||
self.assertTrue(conf.dump() != '')
|
self.assertTrue(conf.dump() != '')
|
||||||
|
|
||||||
def test_def_link(self):
|
def test_def_link(self):
|
||||||
self._test_link_import('nolink', LinkTypes.LINK, 'link')
|
self._test_link_import('nolink', LinkTypes.ABSOLUTE, 'absolute')
|
||||||
|
self._test_link_import('nolink', LinkTypes.RELATIVE, 'relative')
|
||||||
self._test_link_import('nolink', LinkTypes.NOLINK, 'nolink')
|
self._test_link_import('nolink', LinkTypes.NOLINK, 'nolink')
|
||||||
self._test_link_import('nolink',
|
self._test_link_import('nolink',
|
||||||
LinkTypes.LINK_CHILDREN,
|
LinkTypes.LINK_CHILDREN,
|
||||||
'link_children')
|
'link_children')
|
||||||
self._test_link_import('link', LinkTypes.LINK, 'link')
|
self._test_link_import('link', LinkTypes.ABSOLUTE, 'absolute')
|
||||||
|
self._test_link_import('link', LinkTypes.RELATIVE, 'relative')
|
||||||
self._test_link_import('link', LinkTypes.NOLINK, 'nolink')
|
self._test_link_import('link', LinkTypes.NOLINK, 'nolink')
|
||||||
self._test_link_import('link',
|
self._test_link_import('link',
|
||||||
LinkTypes.LINK_CHILDREN,
|
LinkTypes.LINK_CHILDREN,
|
||||||
'link_children')
|
'link_children')
|
||||||
self._test_link_import('link_children', LinkTypes.LINK, 'link')
|
self._test_link_import('link_children', LinkTypes.ABSOLUTE, 'absolute')
|
||||||
|
self._test_link_import('link_children', LinkTypes.RELATIVE, 'relative')
|
||||||
self._test_link_import('link_children', LinkTypes.NOLINK, 'nolink')
|
self._test_link_import('link_children', LinkTypes.NOLINK, 'nolink')
|
||||||
self._test_link_import('link_children', LinkTypes.LINK_CHILDREN,
|
self._test_link_import('link_children', LinkTypes.LINK_CHILDREN,
|
||||||
'link_children')
|
'link_children')
|
||||||
|
|||||||
Reference in New Issue
Block a user