Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 7093  / 1 Year ago, wed, february 22, 2023, 8:18:38

I play OpenTTD. There are three versions available and I want to have all three; stable, testing and nightly. I downloaded and compiled the source code for all three with no problems. The issue is when I want to compile a new version. When I extract the tar.xz file into /usr/lib/games/openttd-trunk/ the old files aren't overwritten. Instead, a new directory is created called openttd-trunk-r26175.



Is there any way to extract the files from the archive directly into /usr/lib/games/openttd-trunk/? That way I can just simply make without having to ./configure every time.



EDIT: I don't think I made clear that the archive has the source files inside a single folder called openttd-trunk-r26175. What I want to do is extract all files from that folder, but not the folder itself.


More From » tar

 Answers
4

See this answer.



If you archive has one top level folder you can use --strip-components 1, to remove first folder from full files path.



Finaly, this should do what you want:



tar xf openttd-trunk-r26175.tar -C /usr/lib/games/openttd-trunk/ --strip-components 1

[#27838] Friday, February 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
defendle

Total Points: 219
Total Questions: 131
Total Answers: 112

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
;