__apt_mark improvements #159

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

Created by: 4nd3r

__apt_mark needs 1 or 2 improvements.

first there should be check if package is installed (if not, then exit) and secondly apt version check. apt-mark hold is supproted since wheezy which is also oldest supported debian release. but life is more difficult and there's probably enough squeezes and lennys in production in somewhat closed networks and running that type against squeeze or older will output error.

about package check. since explorers are run with -e flag... is it okay when explorer just fails? or where should the package presence check should be? there's no need to run apt-mark when package isn't installed. maybe cdist needs separate explorer(s) to check existence of package and its version?

*Created by: 4nd3r* __apt_mark needs 1 or 2 improvements. first there should be check if package is installed (if not, then exit) and secondly apt version check. `apt-mark hold` is supproted since wheezy which is also oldest supported debian release. but life is more difficult and there's probably enough squeezes and lennys in production in somewhat closed networks and running that type against squeeze or older will output error. about package check. since explorers are run with `-e` flag... is it okay when explorer just fails? or where should the package presence check should be? there's no need to run apt-mark when package isn't installed. maybe cdist needs separate explorer(s) to check existence of package and its version?
Author
Owner

Created by: telmich

Re package installed: completely agree - you should use an explorer for this. In the same way you can check the apt version and abort in the manifest, if the apt version is too low (which is a good check because someone might backport it to lenny - so we cannot rely on the distribution version)

Basically for this case create the two explorers to keep the type closed - it does not depend on others. Afair the return code of an explorer is not checked, as you only use the output of an explorer anyway. If it fails, the output will be empty and you have to deal with it either in the type that uses an explorer (for global explorers) or in this particular case you would use 2 type explorers, which it is up to you to define "proper" behaviour.

In general, empty output is concerned as an error.

HTH

*Created by: telmich* Re package installed: completely agree - you should use an explorer for this. In the same way you can check the apt version and abort in the manifest, if the apt version is too low (which is a good check because someone might backport it to lenny - so we cannot rely on the distribution version) Basically for this case create the two explorers to keep the type closed - it does not depend on others. Afair the return code of an explorer is not checked, as you only use the output of an explorer anyway. If it fails, the output will be empty and you have to deal with it either in the type that uses an explorer (for global explorers) or in this particular case you would use 2 type explorers, which it is up to you to define "proper" behaviour. In general, empty output is concerned as an error. HTH
Author
Owner

Created by: 4nd3r

@telmich @darko-poljak can you give me some feedback? thanks.

*Created by: 4nd3r* @telmich @darko-poljak can you give me some feedback? thanks.
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#159
No description provided.