Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted documentation about packages to v1/v2 instead of old/new #3237

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion examples/tutorials/file_comparison.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Here is the order in which bundles are called in the command line above (some ot

1. [robot][#robot] - demonstrates use of `reports`.
2. [global_vars][#global_vars] - sets up some global variables for later use.
3. [packages][#packages] - installs packages that will be used later on.
3. [packages--v2][#packages] - installs packages that will be used later on.
4. [create_aout_source_file][#create_aout_source_file] - creates a source file.
5. [create_aout][#create_aout] - compiles the source file.
6. [test_delete][#test_delete] - deletes a file.
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/manage-packages.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The packages promise also supports version pinning, so that you can specify
exactly the version you want to have installed. It is modular and extensible, so
that it is easy to add support for new platforms and package managers. For
complete documentation, please have a look at the [reference manual for the
packages promise][packages].
packages promise][packages--v2].

Of course, running the policy by hand is only good for initial testing. Once
your policy works the way you need, you will want to deploy it to your entire
Expand Down
3 changes: 3 additions & 0 deletions generator/_references.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@
[mpf-classification-bundles]: reference-masterfiles-policy-framework.html#classification-bundles-before-autorun.html
[mpf-services-autorun]: reference-masterfiles-policy-framework-services-autorun.html
[package-modules-the-api]: reference-language-concepts-modules-package-module-api.html#the-api
[packages#options]: reference-promise-types-packages-v2.html#options
[packages-v1]: reference-promise-types-packages-v1.html
[packages-v1#package_name_convention]: reference-promise-types-packages-v1.html#package_name_convention
6 changes: 3 additions & 3 deletions generator/_scripts/cfdoc_linkresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def parseMarkdownForAnchors(file_name, config):


def applyLinkMap(file_name, config):
# print("applyLinkMap() filename = %s" % file_name)
print("applyLinkMap() filename = %s" % file_name)
markdown_file = open(file_name, "r")
markdown_lines = markdown_file.readlines()
markdown_file.close()
Expand Down Expand Up @@ -295,8 +295,8 @@ def applyLinkMap(file_name, config):
candidate_start = -1
i += 1
if index != -1:
# print("applyLinkMap() candidate = %s" % candidate)
# print("applyLinkMap() markdownline = %s" % markdown_line)
print("applyLinkMap() candidate = %s" % candidate)
print("applyLinkMap() markdownline = %s" % markdown_line)
write_changes = True
new_line += markdown_line[:index]
new_line += "[" + candidate + "]" + anchor
Expand Down
4 changes: 4 additions & 0 deletions redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ RewriteRule ^/latest/guide-latest-release-supported-platforms.html /docs/latest/
RewriteRule ^/nickanderson https://www.linkedin.com/in/hithisisnick/
RewriteRule ^/thisistheway https://orgmode.org
RewriteRule ^/orgmode https://orgmode.org

# CFE-4315 renaming packages old/new/deprecated to v1 and v2
RewriteRule ^/docs/(.*)/reference-promise-types-packages.html https://%{SERVER_NAME}/docs/$1/reference-promise-types-packages--v2.html
RewriteRule ^/docs/(.*)/reference-promise-types-packages-deprecated.html https://%{SERVER_NAME}/docs/$1/reference-promise-types-packages--v1.html
2 changes: 1 addition & 1 deletion reference/language-concepts/normal-ordering.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ following, converging towards a final state:
4. [classes][classes]
5. [users][users]
6. [files][files]
7. [packages][packages]
7. [packages--v2][packages]
8. [guest_environments][guest_environments]
9. [methods][methods]
10. [processes][processes]
Expand Down
2 changes: 1 addition & 1 deletion reference/promise-types.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ depends on the [bundle][bundles] type:
| [commands][commands] - execute a command | | x | | |
| [databases][databases] - configure a database | | x | | |
| [files][files] - configure a file | | x | | |
| [packages][packages] - install a package | | x | | |
| [packages--v2][packages] - install a package | | x | | |
| [guest_environments][guest_environments] | | x | | |
| [methods][methods] - take on a whole bundle of other promises | | x | | |
| [processes][processes] - start or terminate processes | | x | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
layout: default
title: packages (deprecated)
title: packages (v1)
published: true
---

**NOTE:** This package promise is deprecated and has been superseded by
[the new package promise][packages]. It is recommended to use the new package
promise whenever possible. Simply using attributes from the new package promise
interface will select the new implementation.
**NOTE:** This package promise is deprecated.
When possible use the latest [package promise version][packages].

If specific attributes are not specified and there is no `default:package_module_knowledge.platform_default` variable set then this v1 packages promise will be used.
Also note that if no specific `package_method` attribute is included a default of [`generic`][#Default package method] will be used.

NOTE: CFEngine 3.6 introduces bundles `package_absent`, `package_present`,
`package_latest`, `package_specific_present`, `package_specific_absent`, and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: packages
title: packages (v2)
published: true
---

Expand All @@ -13,7 +13,7 @@ CFEngine 3.6 and older had a different package promise implementation, which is
still functional, but considered deprecated. However, it may still be in use by
existing policy files, and it may cover platforms which the new implementation
does not currently cover. To read about the old package promise, go to the
[old package promise section][packages (deprecated)].
[v1 package promise (package_method)][packages-v1].

The actual communication with the package manager on the system is handled by so
called [package modules][Package modules], which are specifically written for
Expand Down Expand Up @@ -46,7 +46,7 @@ string needs to be a bare package name, you cannot use a file name for this.

* The promiser must be the fully qualified path to a file *or* a *package name*.
`package_modules` do not have the concept of a
flexible [naming convention][packages (deprecated)#package_name_convention].
flexible [naming convention][packages-v1#package_name_convention].

For example, here are valid ways to specify a specific package version when
using the `package_module` based implementation.
Expand Down
Loading