__package_apt seems to interpret "Recommends:" as "Depends:" #197

Closed
opened 2021-11-20 15:21:15 +00:00 by ungleich-gitea · 2 comments

Created by: tpo

I have this here in a manifest:

__package inkscape --state present

# remove unnecessary cruft
for cruft in aspell aspell-en; do
    __package "$cruft" --state absent
done

Inkscape has the following dependencies:

$ dpkg -s inkscape | grep Recommends
Recommends: aspell, libwmf-bin, pstoedit, imagemagick, perlmagick

The result of the above manifest is, that (depending on execution order) cdist will first deinstall aspell and inkscape and then reinstall inkscape and aspell. Or the inverse: install both and the remove them both:

$ cdist config -v -c . vrtest
INFO: cdist: version 3.1.5-33-g9f5a228
INFO: vrtest: Running global explorers
INFO: vrtest: Running initial manifest /tmp/tmpixmti1/conf/manifest/init
INFO: vrtest: Running manifest and explorers for __foobar/
INFO: vrtest: Running manifest and explorers for __package/aspell
INFO: vrtest: Running manifest and explorers for __package/inkscape
INFO: vrtest: Running manifest and explorers for __package/aspell-en
INFO: vrtest: Running manifest and explorers for __package_apt/aspell
INFO: vrtest: Generating code for __package_apt/aspell
INFO: vrtest: Executing code for __package_apt/aspell
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  fontconfig libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libcairo2
  libcairomm-1.0-1 libcups2 libdatrie1 libgc1c2 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libglibmm-2.4-1c2a libgnomevfs2-0 libgsl0ldbl
  libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libhunspell-1.3-0 liblcms1
  libmagick++5 libpango1.0-0 libpangomm-1.4-1 libpixman-1-0 libpoppler-glib8
  libpoppler19 libthai-data libthai0 libwpd-0.9-9 libwpg-0.2-2 libxcb-render0
  libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxft2 libxinerama1
  libxrandr2 libxrender1
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  aspell aspell-en inkscape libenchant1c2a libgtkspell0
0 upgraded, 0 newly installed, 5 to remove and 2 not upgraded.
After this operation, 84.7 MB disk space will be freed.
(Reading database ... 36420 files and directories currently installed.)
Removing inkscape ...
Removing libgtkspell0 ...
Removing libenchant1c2a ...
Removing aspell-en ...
Removing aspell ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for mime-support ...
Processing triggers for dictionaries-common ...
INFO: vrtest: Running manifest and explorers for __package_apt/inkscape
INFO: vrtest: Generating code for __package_apt/inkscape
INFO: vrtest: Executing code for __package_apt/inkscape
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  aspell aspell-en libenchant1c2a libgtkspell0
Suggested packages:
  aspell-doc spellutils dia dia-gnome ruby libgnomevfs2-extra libsvg-perl
  libxml-xql-perl python-numpy python-lxml python-uniconvertor skencil
  libenchant-voikko
Recommended packages:
  libwmf-bin pstoedit perlmagick enchant
The following NEW packages will be installed:
  aspell aspell-en inkscape libenchant1c2a libgtkspell0
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/25.5 MB of archives.
After this operation, 84.7 MB of additional disk space will be used.
Selecting previously unselected package aspell.
(Reading database ... 35281 files and directories currently installed.)
Unpacking aspell (from .../aspell_0.60.7~20110707-1_amd64.deb) ...
Selecting previously unselected package aspell-en.
Unpacking aspell-en (from .../aspell-en_7.1-0-1_all.deb) ...
Selecting previously unselected package libenchant1c2a.
Unpacking libenchant1c2a (from .../libenchant1c2a_1.6.0-7_amd64.deb) ...
Selecting previously unselected package libgtkspell0.
Unpacking libgtkspell0 (from .../libgtkspell0_2.0.16-1_amd64.deb) ...
Selecting previously unselected package inkscape.
Unpacking inkscape (from .../inkscape_0.48.3.1-1.3_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for mime-support ...
Processing triggers for hicolor-icon-theme ...
Setting up aspell (0.60.7~20110707-1) ...
Processing triggers for dictionaries-common ...
aspell-autobuildhash: processing: en [en-common]
aspell-autobuildhash: processing: en [en-variant_0]
aspell-autobuildhash: processing: en [en-variant_1]
aspell-autobuildhash: processing: en [en-variant_2]
aspell-autobuildhash: processing: en [en-w_accents-only]
Setting up aspell-en (7.1-0-1) ...
Processing triggers for dictionaries-common ...
Setting up libenchant1c2a (1.6.0-7) ...
Setting up libgtkspell0 (2.0.16-1) ...
Setting up inkscape (0.48.3.1-1.3) ...
INFO: vrtest: Running manifest and explorers for __package_apt/aspell-en
INFO: vrtest: Generating code for __package_apt/aspell-en
INFO: vrtest: Executing code for __package_apt/aspell-en
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  fontconfig libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libcairo2
  libcairomm-1.0-1 libcups2 libdatrie1 libgc1c2 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libglibmm-2.4-1c2a libgnomevfs2-0 libgsl0ldbl
  libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libhunspell-1.3-0 liblcms1
  libmagick++5 libpango1.0-0 libpangomm-1.4-1 libpixman-1-0 libpoppler-glib8
  libpoppler19 libthai-data libthai0 libwpd-0.9-9 libwpg-0.2-2 libxcb-render0
  libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxft2 libxinerama1
  libxrandr2 libxrender1
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  aspell-en inkscape libenchant1c2a libgtkspell0
0 upgraded, 0 newly installed, 4 to remove and 2 not upgraded.
After this operation, 83.6 MB disk space will be freed.
(Reading database ... 36420 files and directories currently installed.)
Removing inkscape ...
Removing libgtkspell0 ...
Removing libenchant1c2a ...
Removing aspell-en ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for mime-support ...
Processing triggers for dictionaries-common ...
INFO: vrtest: Generating code for __package/aspell
INFO: vrtest: Generating code for __package/inkscape
INFO: vrtest: Generating code for __package/aspell-en
INFO: vrtest: Generating code for __foobar/
INFO: vrtest: Finished successful run in 82.12426018714905 seconds
INFO: cdist: Total processing time for 1 host(s): 82.12498021125793

My intuitive expectation of the above two declarations would however be, that aspell only would be removed and inscape would not be touched at all.

Of course the interpretation of "Recommends" is it is stronly advised to... unless you know what you're doing. But since cdist's target audience is devops I'd expect exactly this to be the case?

I suggest not to automatically deinstall a package if its "Recommends" dependecy gets deinstalled.

You can find the whole recipe attached.

*Created by: tpo* I have this here in a manifest: ``` __package inkscape --state present # remove unnecessary cruft for cruft in aspell aspell-en; do __package "$cruft" --state absent done ``` Inkscape has the following dependencies: ``` $ dpkg -s inkscape | grep Recommends Recommends: aspell, libwmf-bin, pstoedit, imagemagick, perlmagick ``` The result of the above manifest is, that (depending on execution order) cdist will first deinstall aspell **and** inkscape and then reinstall inkscape **and** aspell. Or the inverse: install both and the remove them both: ``` $ cdist config -v -c . vrtest INFO: cdist: version 3.1.5-33-g9f5a228 INFO: vrtest: Running global explorers INFO: vrtest: Running initial manifest /tmp/tmpixmti1/conf/manifest/init INFO: vrtest: Running manifest and explorers for __foobar/ INFO: vrtest: Running manifest and explorers for __package/aspell INFO: vrtest: Running manifest and explorers for __package/inkscape INFO: vrtest: Running manifest and explorers for __package/aspell-en INFO: vrtest: Running manifest and explorers for __package_apt/aspell INFO: vrtest: Generating code for __package_apt/aspell INFO: vrtest: Executing code for __package_apt/aspell Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: fontconfig libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libcairo2 libcairomm-1.0-1 libcups2 libdatrie1 libgc1c2 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libglibmm-2.4-1c2a libgnomevfs2-0 libgsl0ldbl libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libhunspell-1.3-0 liblcms1 libmagick++5 libpango1.0-0 libpangomm-1.4-1 libpixman-1-0 libpoppler-glib8 libpoppler19 libthai-data libthai0 libwpd-0.9-9 libwpg-0.2-2 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxft2 libxinerama1 libxrandr2 libxrender1 Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: aspell aspell-en inkscape libenchant1c2a libgtkspell0 0 upgraded, 0 newly installed, 5 to remove and 2 not upgraded. After this operation, 84.7 MB disk space will be freed. (Reading database ... 36420 files and directories currently installed.) Removing inkscape ... Removing libgtkspell0 ... Removing libenchant1c2a ... Removing aspell-en ... Removing aspell ... Processing triggers for man-db ... Processing triggers for hicolor-icon-theme ... Processing triggers for mime-support ... Processing triggers for dictionaries-common ... INFO: vrtest: Running manifest and explorers for __package_apt/inkscape INFO: vrtest: Generating code for __package_apt/inkscape INFO: vrtest: Executing code for __package_apt/inkscape Reading package lists... Building dependency tree... Reading state information... The following extra packages will be installed: aspell aspell-en libenchant1c2a libgtkspell0 Suggested packages: aspell-doc spellutils dia dia-gnome ruby libgnomevfs2-extra libsvg-perl libxml-xql-perl python-numpy python-lxml python-uniconvertor skencil libenchant-voikko Recommended packages: libwmf-bin pstoedit perlmagick enchant The following NEW packages will be installed: aspell aspell-en inkscape libenchant1c2a libgtkspell0 0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/25.5 MB of archives. After this operation, 84.7 MB of additional disk space will be used. Selecting previously unselected package aspell. (Reading database ... 35281 files and directories currently installed.) Unpacking aspell (from .../aspell_0.60.7~20110707-1_amd64.deb) ... Selecting previously unselected package aspell-en. Unpacking aspell-en (from .../aspell-en_7.1-0-1_all.deb) ... Selecting previously unselected package libenchant1c2a. Unpacking libenchant1c2a (from .../libenchant1c2a_1.6.0-7_amd64.deb) ... Selecting previously unselected package libgtkspell0. Unpacking libgtkspell0 (from .../libgtkspell0_2.0.16-1_amd64.deb) ... Selecting previously unselected package inkscape. Unpacking inkscape (from .../inkscape_0.48.3.1-1.3_amd64.deb) ... Processing triggers for man-db ... Processing triggers for mime-support ... Processing triggers for hicolor-icon-theme ... Setting up aspell (0.60.7~20110707-1) ... Processing triggers for dictionaries-common ... aspell-autobuildhash: processing: en [en-common] aspell-autobuildhash: processing: en [en-variant_0] aspell-autobuildhash: processing: en [en-variant_1] aspell-autobuildhash: processing: en [en-variant_2] aspell-autobuildhash: processing: en [en-w_accents-only] Setting up aspell-en (7.1-0-1) ... Processing triggers for dictionaries-common ... Setting up libenchant1c2a (1.6.0-7) ... Setting up libgtkspell0 (2.0.16-1) ... Setting up inkscape (0.48.3.1-1.3) ... INFO: vrtest: Running manifest and explorers for __package_apt/aspell-en INFO: vrtest: Generating code for __package_apt/aspell-en INFO: vrtest: Executing code for __package_apt/aspell-en Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: fontconfig libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libcairo2 libcairomm-1.0-1 libcups2 libdatrie1 libgc1c2 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libglibmm-2.4-1c2a libgnomevfs2-0 libgsl0ldbl libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libhunspell-1.3-0 liblcms1 libmagick++5 libpango1.0-0 libpangomm-1.4-1 libpixman-1-0 libpoppler-glib8 libpoppler19 libthai-data libthai0 libwpd-0.9-9 libwpg-0.2-2 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxft2 libxinerama1 libxrandr2 libxrender1 Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: aspell-en inkscape libenchant1c2a libgtkspell0 0 upgraded, 0 newly installed, 4 to remove and 2 not upgraded. After this operation, 83.6 MB disk space will be freed. (Reading database ... 36420 files and directories currently installed.) Removing inkscape ... Removing libgtkspell0 ... Removing libenchant1c2a ... Removing aspell-en ... Processing triggers for man-db ... Processing triggers for hicolor-icon-theme ... Processing triggers for mime-support ... Processing triggers for dictionaries-common ... INFO: vrtest: Generating code for __package/aspell INFO: vrtest: Generating code for __package/inkscape INFO: vrtest: Generating code for __package/aspell-en INFO: vrtest: Generating code for __foobar/ INFO: vrtest: Finished successful run in 82.12426018714905 seconds INFO: cdist: Total processing time for 1 host(s): 82.12498021125793 ``` My intuitive expectation of the above two declarations would however be, that aspell **only** would be removed and inscape would not be touched _at all_. Of course the interpretation of "Recommends" is _it is stronly advised to... unless you know what you're doing_. But since cdist's target audience is devops I'd expect exactly this to be the case? I suggest not to automatically deinstall a package if its "Recommends" dependecy gets deinstalled. You can find the whole recipe attached.
ungleich-gitea added the
Stale
label 2021-11-20 15:21:15 +00:00
Author
Owner

closed

closed
Author
Owner

Created by: tpo

Oops, it seems I can't attach random files to issues. So here we go in cleartext:

$ find
.
./manifest
./manifest/init
./type
./type/__foobar
./type/__foobar/manifest
./type/__foobar/singleton
$ cat manifest/init 
__foobar
$ cat type/__foobar/manifest 
__package inkscape --state present

# remove unnecessary cruft
for cruft in aspell aspell-en; do
    __package "$cruft" --state absent
done
$ cat type/__foobar/singleton 
$
*Created by: tpo* Oops, it seems I can't attach random files to issues. So here we go in cleartext: ``` $ find . ./manifest ./manifest/init ./type ./type/__foobar ./type/__foobar/manifest ./type/__foobar/singleton $ cat manifest/init __foobar $ cat type/__foobar/manifest __package inkscape --state present # remove unnecessary cruft for cruft in aspell aspell-en; do __package "$cruft" --state absent done $ cat type/__foobar/singleton $ ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#197
No description provided.