aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-08-19 11:55:13 -0400
committerXe Iaso <me@xeiaso.net>2024-08-19 11:55:13 -0400
commitca61231d78993f368f3675ac4bad0d70ba2a0e50 (patch)
tree132bf3c02700959c6dd24e58f7f43bdea822a673
parenta38a24f385247fc2f6412ab396f8a03007a9f16d (diff)
downloadxesite-ca61231d78993f368f3675ac4bad0d70ba2a0e50.tar.xz
xesite-ca61231d78993f368f3675ac4bad0d70ba2a0e50.zip
notes: tar pop quiz
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--Brewfile.lock.json2
-rw-r--r--lume/src/notes/2024/pop-quiz-tar.mdx36
2 files changed, 37 insertions, 1 deletions
diff --git a/Brewfile.lock.json b/Brewfile.lock.json
index b527127..dcf976d 100644
--- a/Brewfile.lock.json
+++ b/Brewfile.lock.json
@@ -731,7 +731,7 @@
"GCC": "11.4.0"
},
"Ubuntu 22.04.3 LTS (jammy)": {
- "HOMEBREW_VERSION": "4.3.6",
+ "HOMEBREW_VERSION": "4.3.17",
"HOMEBREW_PREFIX": "/home/linuxbrew/.linuxbrew",
"Homebrew/homebrew-core": "api",
"GCC": "11.4.0"
diff --git a/lume/src/notes/2024/pop-quiz-tar.mdx b/lume/src/notes/2024/pop-quiz-tar.mdx
new file mode 100644
index 0000000..31b9363
--- /dev/null
+++ b/lume/src/notes/2024/pop-quiz-tar.mdx
@@ -0,0 +1,36 @@
+---
+title: "Pop quiz: what is wrong with this tar command?"
+date: 2024-08-19
+desc: "It's stupider than you think"
+hero:
+ ai: "Flux [dev]"
+ file: laptop-anger
+ prompt: "A green haired anime woman with green eyes and very long hair angrily typing on a laptop, headphones, seattle, space needle, black hoodie, best quality, coffee shop"
+ social: true
+---
+
+Pop quiz: what is wrong with this tar command?
+
+```sh
+tar cf ../iosevka-iaso.tgz .
+```
+
+<Conv name="Aoi" mood="wut">
+ That looks fine to me? You're creating a tarball in the parent directory with
+ the contents of the current working directory. What's the problem?
+</Conv>
+
+```sh
+$ tar xzf iosevka-iaso.tgz
+gzip: not a compressed stream
+```
+
+The thing I messed up was not adding `z` to the tarball creation command. I needed to do:
+
+```sh
+tar czf ../iosevka-iaso.tgz .
+```
+
+This happens because GNU tar looks at file extensions to try to determine the user's intent. If you do `tar xf foo.tgz` or `tar xf foo.tar.gz`, it will invoke gzip to decompress the tarball for you. This is intended behavior, but that same logic doesn't run when you create a tarball.
+
+I lost 15 minutes to this today and feel that I need to let y'all know so you can learn from my suffering.