| 14 | stream::Stream, |
| 15 | token::any, |
| 16 | }; |
| 17 | |
| 18 | use crate::{Error, SourceUrl}; |
| 19 | |
| 20 | /// Represents the location that a source file should be retrieved from |
| 21 | /// |
| 22 | /// It can be either a local file (next to the PKGBUILD) or a URL. |
| 23 | #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] |
| 24 | #[serde(tag = "type")] |
| 25 | pub enum Source { |
| 26 | /// A local file source. |
| 27 | /// |
| 28 | /// The location must be a pure file name, without any path components (`/`). |
| 29 | /// Hence, the file must be located directly next to the PKGBUILD. |
| 30 | File { |
| 31 | /// The optional destination file name. |
| 32 | filename: Option<PathBuf>, |
| 33 | /// The source file name. |
| 34 | location: PathBuf, |
| 35 | }, |
| 36 | /// A URL source. |
| 37 | SourceUrl { |