Reads the content of the [alpm-install-scriptlet] from the package archive, if it exists. # Errors Returns an error if [`PackageReader::entries`] fails to read the entries. [alpm-install-scriplet]: https://alpm.archlinux.page/specifications/alpm-install-scriptlet.5.html
(&mut self)
| 894 | /// |
| 895 | /// [alpm-install-scriplet]: https://alpm.archlinux.page/specifications/alpm-install-scriptlet.5.html |
| 896 | pub fn read_install_scriptlet(&mut self) -> Result<Option<String>, crate::Error> { |
| 897 | for entry in self.entries()? { |
| 898 | let entry = entry?; |
| 899 | if let PackageEntry::InstallScriptlet(scriptlet) = entry { |
| 900 | return Ok(Some(scriptlet)); |
| 901 | } |
| 902 | } |
| 903 | Ok(None) |
| 904 | } |
| 905 | |
| 906 | /// Reads a [`TarballEntry`] matching a specific path name from the package archive. |
| 907 | /// |