@@ -22,7 +22,7 @@ use base64::engine::{Engine, general_purpose::STANDARD};
2222use futures:: { StreamExt , TryFutureExt , TryStreamExt , stream} ;
2323use rattler_conda_types:: {
2424 ChannelInfo , PackageRecord , Platform , RepoData ,
25- package:: { CondaArchiveType , DistArchiveIdentifier } ,
25+ package:: { ArchiveIdentifier , ArchiveType } ,
2626} ;
2727use rattler_digest:: { HashingWriter , Md5 , Sha256 } ;
2828use rattler_lock:: {
@@ -192,18 +192,18 @@ pub async fn pack(options: PackOptions) -> Result<()> {
192192 . map_err ( |e : anyhow:: Error | anyhow ! ( "could not download package: {}" , e) ) ?;
193193 bar. pb . finish_and_clear ( ) ;
194194
195- let mut conda_packages: Vec < ( DistArchiveIdentifier , PackageRecord ) > = Vec :: new ( ) ;
195+ let mut conda_packages: Vec < ( String , PackageRecord ) > = Vec :: new ( ) ;
196196
197197 for package in conda_packages_from_lockfile {
198198 let filename = package. file_name ;
199199 conda_packages. push ( ( filename, package. package_record ) ) ;
200200 }
201201
202- let injected_packages: Vec < ( PathBuf , CondaArchiveType ) > = options
202+ let injected_packages: Vec < ( PathBuf , ArchiveType ) > = options
203203 . injected_packages
204204 . iter ( )
205205 . filter_map ( |e| {
206- CondaArchiveType :: split_str ( e. as_path ( ) . to_string_lossy ( ) . as_ref ( ) )
206+ ArchiveType :: split_str ( e. as_path ( ) . to_string_lossy ( ) . as_ref ( ) )
207207 . map ( |( p, t) | ( PathBuf :: from ( format ! ( "{}{}" , p, t. extension( ) ) ) , t) )
208208 } )
209209 . collect ( ) ;
@@ -212,8 +212,8 @@ pub async fn pack(options: PackOptions) -> Result<()> {
212212 for ( path, archive_type) in injected_packages. iter ( ) {
213213 // step 1: Derive PackageRecord from index.json inside the package
214214 let package_record = match archive_type {
215- CondaArchiveType :: TarBz2 => package_record_from_tar_bz2 ( path) ,
216- CondaArchiveType :: Conda => package_record_from_conda ( path) ,
215+ ArchiveType :: TarBz2 => package_record_from_tar_bz2 ( path) ,
216+ ArchiveType :: Conda => package_record_from_conda ( path) ,
217217 } ?;
218218
219219 // step 2: Copy file into channel dir
@@ -224,14 +224,14 @@ pub async fn pack(options: PackOptions) -> Result<()> {
224224 . to_str ( )
225225 . ok_or ( anyhow ! ( "could not convert filename to string" ) ) ?
226226 . to_string ( ) ;
227- let package_identifier = DistArchiveIdentifier :: try_from_filename ( & filename)
227+ ArchiveIdentifier :: try_from_filename ( & filename)
228228 . ok_or ( anyhow ! ( "could not parse package filename: {}" , filename) ) ?;
229229
230230 fs:: copy ( & path, channel_dir. join ( subdir) . join ( & filename) )
231231 . await
232232 . map_err ( |e| anyhow ! ( "could not copy file to channel directory: {}" , e) ) ?;
233233
234- conda_packages. push ( ( package_identifier , package_record) ) ;
234+ conda_packages. push ( ( filename , package_record) ) ;
235235 }
236236
237237 // In case we injected packages, we need to validate that these packages are solvable with the
@@ -912,7 +912,7 @@ async fn create_environment_file(
912912
913913/// Create `repodata.json` files for the given packages.
914914async fn create_repodata_files (
915- packages : impl Iterator < Item = & ( DistArchiveIdentifier , PackageRecord ) > ,
915+ packages : impl Iterator < Item = & ( String , PackageRecord ) > ,
916916 channel_dir : & Path ,
917917) -> Result < ( ) > {
918918 let mut packages_per_subdir = HashMap :: new ( ) ;
@@ -941,7 +941,6 @@ async fn create_repodata_files(
941941 } ) ,
942942 packages : Default :: default ( ) ,
943943 conda_packages,
944- experimental_whl_packages : Default :: default ( ) ,
945944 removed : Default :: default ( ) ,
946945 version : Some ( 2 ) ,
947946 } ;
0 commit comments