Skip to content

Commit

Permalink
tar -> tar.gz everywhere - fixes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
clux committed Dec 5, 2017
1 parent fdd6ff6 commit dbdbf76
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions SPEC.md
Expand Up @@ -158,15 +158,15 @@ The local cache is populated by fetches from the registry, or calls to `stash` t
│   ├── centos
│   │   └── ciscossl
│   │   └── 6
│   │   └── ciscossl.tar
│   │   └── ciscossl.tar.gz
│   └── xenial
│   └── ciscossl
│   └── 6
│   └── ciscossl.tar
│   └── ciscossl.tar.gz
└── stash
└── ciscossl
└── asan
└── ciscossl.tar
└── ciscossl.tar.gz
```

Sources:
Expand Down
6 changes: 3 additions & 3 deletions package.sh
Expand Up @@ -15,9 +15,9 @@
#
# ARTIFACT/
# ├── 3.3.3
# │   └── lal.tar
# │   └── lal.tar.gz
# ├── latest
# │   └── lal.tar
# │   └── lal.tar.gz
# └── lockfile.json
#
# Such that jenkins will upload this verbatim to:
Expand All @@ -40,7 +40,7 @@ mutate_artifact_folder() {
else
echo "Packaging new lal version"
mkdir "ARTIFACT/${lalversion}" -p
mv ARTIFACT/lal.tar.gz "ARTIFACT/${lalversion}/lal.tar"
mv ARTIFACT/lal.tar.gz "ARTIFACT/${lalversion}/lal.tar.gz"
# Overwrite the latest folder
cp "ARTIFACT/${lalversion}" "ARTIFACT/latest" -R
fi
Expand Down
2 changes: 1 addition & 1 deletion src/core/output.rs
Expand Up @@ -24,7 +24,7 @@ pub fn tar(tarball: &Path) -> LalResult<()> {
args.push(f.into())
}

// basically `tar czf component.tar --transform.. $(find OUTPUT -type f -o -type l)`:
// basically `tar czf component.tar.gz --transform.. $(find OUTPUT -type f -o -type l)`:
debug!("tar {}", args.join(" "));
let s = Command::new("tar").args(&args).status()?;

Expand Down
2 changes: 1 addition & 1 deletion src/storage/artifactory.rs
Expand Up @@ -310,7 +310,7 @@ pub fn get_latest_lal_version() -> LalResult<LatestLal> {
if let Some(l) = latest {
Ok(LatestLal {
version: l.clone(),
url: format!("https://engci-maven.cisco.com/artifactory/CME-group/lal/{}/lal.tar",
url: format!("https://engci-maven.cisco.com/artifactory/CME-group/lal/{}/lal.tar.gz",
l),
})
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/storage/download.rs
Expand Up @@ -24,8 +24,8 @@ fn store_tarball<T: Backend + ?Sized>(
if !destdir.is_dir() {
fs::create_dir_all(&destdir)?;
}
// 2. stuff $PWD/$name.tar in there
let tarname = [name, ".tar"].concat();
// 2. stuff $PWD/$name.tar.gz in there
let tarname = [name, ".tar.gz"].concat();
let dest = Path::new(&destdir).join(&tarname);
let src = Path::new(".").join(&tarname);
if !src.is_file() {
Expand Down Expand Up @@ -119,7 +119,7 @@ where

if !is_cached(self, &component.name, component.version, env) {
// download to PWD then move it to stash immediately
let local_tarball = Path::new(".").join(format!("{}.tar", name));
let local_tarball = Path::new(".").join(format!("{}.tar.gz", name));
self.raw_fetch(&component.location, &local_tarball)?;
store_tarball(self, name, component.version, env)?;
}
Expand All @@ -128,7 +128,7 @@ where

trace!("Fetching {} from cache", name);
let tarname = get_cache_dir(self, &component.name, component.version, env)
.join(format!("{}.tar", name));
.join(format!("{}.tar.gz", name));
Ok((tarname, component))
}

Expand Down
4 changes: 2 additions & 2 deletions src/storage/local.rs
Expand Up @@ -71,7 +71,7 @@ impl Backend for LocalBackend {
} else {
self.get_latest_version(name, loc)?
};
let loc = format!("{}/environments/{}/{}/{}/{}.tar", self.cache, loc, name, v, name);
let loc = format!("{}/environments/{}/{}/{}/{}.tar.gz", self.cache, loc, name, v, name);
Ok(Component {
name: name.into(),
version: v,
Expand All @@ -88,7 +88,7 @@ impl Backend for LocalBackend {

// prefix with environment
let tar_dir = format!("{}/environments/{}/{}/{}/", self.cache, env, name, version);
let tar_path = format!("{}/environments/{}/{}/{}/{}.tar", self.cache, env, name, version, name);
let tar_path = format!("{}/environments/{}/{}/{}/{}.tar.gz", self.cache, env, name, version, name);
let lock_path = format!("{}/environments/{}/{}/{}/lockfile.json", self.cache, env, name, version);

if let Some(full_tar_dir) = config_dir().join(tar_dir).to_str() {
Expand Down
6 changes: 3 additions & 3 deletions src/upgrade.rs
Expand Up @@ -6,7 +6,7 @@
//! Be very careful about updating these functions without also testing the musl
//! build on a variety of Cargo.toml.version strings.
//!
//! People should not have to be told to `curl lal.tar | tar xz -C prefix` again.
//! People should not have to be told to `curl lal.tar.gz | tar xz -C prefix` again.

use semver::Version;
use std::env;
Expand Down Expand Up @@ -79,7 +79,7 @@ fn verify_permissions(exe: &ExeInfo) -> LalResult<()> {

fn overwrite_exe(latest: &LatestLal, exe: &ExeInfo) -> LalResult<()> {
let prefix = exe.prefix.clone().unwrap();
extract_tarball(prefix.join("lal.tar"), &prefix)?;
extract_tarball(prefix.join("lal.tar.gz"), &prefix)?;
validate_exe(latest, exe)?;
Ok(())
}
Expand Down Expand Up @@ -111,7 +111,7 @@ fn upgrade_exe(latest: &LatestLal, exe: &ExeInfo) -> LalResult<()> {
fs::remove_file(&old_file)?;
}
// 2. make sure we can download the tarball before starting
let tar_dest = prefix.join("lal.tar");
let tar_dest = prefix.join("lal.tar.gz");
info!("Downloading tarball to {}", tar_dest.display());
http_download_to_path(&latest.url, &tar_dest)?;
info!("Backing up {} to {}", exe.path, old_file.display());
Expand Down

0 comments on commit dbdbf76

Please sign in to comment.