mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-09-02 04:11:33 +02:00
73 lines
2.2 KiB
Diff
73 lines
2.2 KiB
Diff
diff --git a/masterfiles/libraries/cfengine_stdlib.cf b/masterfiles/libraries/cfengine_stdlib.cf
|
|
index 13d554f..24529e8 100644
|
|
--- a/masterfiles/libraries/cfengine_stdlib.cf
|
|
+++ b/masterfiles/libraries/cfengine_stdlib.cf
|
|
@@ -2047,6 +2047,31 @@ package_update_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --need
|
|
|
|
##
|
|
|
|
+body package_method alpinelinux
|
|
+{
|
|
+ package_changes => "individual";
|
|
+
|
|
+ package_list_command => "/sbin/apk info -v";
|
|
+
|
|
+ # Remember to escape special characters like |
|
|
+
|
|
+ package_list_name_regex => "([^\s]+)-.*";
|
|
+ package_list_version_regex => "[^\s]+-([^\s]+).*";
|
|
+
|
|
+ package_name_regex => "([^\s]+)-.*";
|
|
+ package_version_regex => "[^\s]+-([^\s]+).*";
|
|
+
|
|
+ package_installed_regex => ".*";
|
|
+
|
|
+ package_name_convention => "$(name)-$(version)";
|
|
+
|
|
+
|
|
+ package_add_command => "/sbin/apk add";
|
|
+ package_delete_command => "/sbin/apk del";
|
|
+}
|
|
+
|
|
+##
|
|
+
|
|
# Single bundle for all the similar managers simplifies promises
|
|
|
|
body package_method generic
|
|
@@ -2186,6 +2211,18 @@ archlinux::
|
|
package_add_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --needed";
|
|
package_delete_command => "/usr/bin/pacman -Rs --noconfirm";
|
|
package_update_command => "/usr/bin/pacman -S --noconfirm --noprogressbar --needed";
|
|
+
|
|
+alpinelinux::
|
|
+ package_changes => "individual";
|
|
+ package_list_command => "/sbin/apk info -v";
|
|
+ package_list_name_regex => "([^\s]+)-.*";
|
|
+ package_list_version_regex => "[^\s]+-([^\s]+).*";
|
|
+ package_name_regex => "([^\s]+)-.*";
|
|
+ package_version_regex => "[^\s]+-([^\s]+).*";
|
|
+ package_installed_regex => ".*";
|
|
+ package_name_convention => "$(name)-$(version)";
|
|
+ package_add_command => "/sbin/apk add";
|
|
+ package_delete_command => "/sbin/apk del";
|
|
}
|
|
|
|
##
|
|
diff --git a/src/sysinfo.c b/src/sysinfo.c
|
|
index 557f449..56046ba 100644
|
|
--- a/src/sysinfo.c
|
|
+++ b/src/sysinfo.c
|
|
@@ -819,6 +819,12 @@ void OSClasses(void)
|
|
SetFlavour("UnitedLinux");
|
|
}
|
|
|
|
+ if (cfstat("/etc/alpine-release", &statbuf) != -1)
|
|
+ {
|
|
+ CfOut(cf_verbose, "", "This appears to be an AlpineLinux system.\n");
|
|
+ SetFlavour("alpinelinux");
|
|
+ }
|
|
+
|
|
if (cfstat("/etc/gentoo-release", &statbuf) != -1)
|
|
{
|
|
CfOut(cf_verbose, "", "This appears to be a gentoo system.\n");
|