Is there a way to build any RPM file in another name than tar source.
I've currently a tar file, like this:
my-current-file.10.1-cert1.tar.gz and I'd like to get a result like this: my-file-certified-10.1.1-1.rpm
Do you think it's possible in the spec file or the rpm file will be on the same format anyway?
It is as simple as:
Name: my-file-certified
Version: 10.1.1
Source0: my-current-file.10.1-cert1.tar.gz
Related
I have a situation where I need to use curl/wget to download a tar file from a website, based on users input. If they mention a build I need to download a tar file based on the release version, I have a logic already to switch between builds, Questions is how can i filter out a particular tar file from multiple files.
curl -s https://somewebsite/somerepo-folder/os-based.tar | grep os-based* > sample.txt
curl -s https://somewebsite/somerepo-folder/os-based2.tar
curl -s https://somewebsite/somerepo-folder/os-based2.tar
first curl downloads all files. Regex helps here, how can I place this along with curl?
if there is a mapping between the user-input and the tar file that you can think of, you can do something like this:
userInput=1
# some logic to map user-input with the tar filename to download
$tarFileName="os-based$userInput.tar"
wget "https://somewebsite/somerepo-folder/$tarFileName"
The following worked on my old server (Ubuntu)
rename -n 's/(.*)\/.*\./$1\/$1./' */*
but not on my new server (Debian).
I'm guessing the new server is using the Perl rename. How would one convert the above to work the same with Perl rename? All it was meant to do is rename files in a folder so that the name starts with the name of the parent folder (removing any name before the last dot in the original filename). Thus, include/anything.h would become include/include.h.
The rename command that is part of the util-linux package, won't work.
You need to run :
# apt install rename
If you run the following command (GNU)
$ file "$(readlink -f "$(type -p rename)")"
and you have a result that contains Perl script, ASCII text executable and not containing ELF, then this seems to be the right tool =)
If not, to make it the default (usually already the case) on Debian and derivative like Ubuntu :
# update-alternatives --set rename /usr/bin/file-rename
I have a large ~10GB zip file that was created using the standard Windows method (right click, select "send to compressed (zipped) folder"). I am able to unzip it just file on my Macbook.
I'm trying to unzip it on an EC2 machine. I know the file is a zip file because when I run file file.zip it says:
file.zip: Zip archive data, at least v2.0 to extract
Running unzip returns the following error:
Archive: file.zip
warning [file.zip]: 3082769992 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [file.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
Running tar xvf file.zip returns the following:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains `<{\204\027\333"D\344\210\321o\331' where numeric off_t value expected
tar: Archive contains `S\354\202},F\3546\276[\265\273' where numeric time_t value expected
tar: Archive contains ``3c\254\372$:e' where numeric uid_t value expected
tar: Archive contains `\265\306\025+ܫL\352' where numeric gid_t value expected
...etc
Does anyone know what might be going wrong?
Actually, 7-zip should makes this well, you can install it by:
sudo apt-get install p7zip-full
Then, you can extract your zip file as follows:
7z e file.zip
If your zip archive has 88,000 files and you are dealing with ~10Gig of content, you will need an unzip program that supports the zip64 extension.
You can check if your unzip program supports zip64 like this
$ unzip -v | grep -i zip64
ZIP64_SUPPORT (archives using Zip64 for large files supported)
If it doesn't have ZIP64_SUPPORT, you are out of luck. I suspect your unzip doesn't support zip64.
Alternatives are to get a version of unzip that does support zip64 or use an alternative program, like z-zip.
Your Entire File did not zip most probably and you prematurely moved it. At Least that was the issue with me.
I was unable to install 7z on my machine due to no sudo access, but I managed to repair the archive using
zip -FF archive.zip --out archive_repaired.zip -fz
and unzip worked on the repaired archive.
I found the solution via this github issue
How do I create/write a TAR file in OCaml? I know there is the ocaml_tar module, but I couldn't find any examples on how to create/write a TAR file. How do I do it in OCaml?
There is Archive.create to create an archive on a file descriptor (if you want to create a file, use Unix.openfile), to read a file, you have with_next_filefd f where the callback f should use the Header.t to know the length of the data to read. If you just want to extract the content to files, just use extract.
A workaround is to use the existing tar tool of Linux, or relevant tools in Windows. For example, tar -zcvf data.tgz *.doc
And you can use functions in the Sys library to create a system call to the tool tar.
I am trying to install Qt on my Ubuntu Linux for using its libraries in reading XML files. I downloaded it from Qt Submodules and started to install step by step according the instruction in the Qt for Linux/X11 - Building from Source web page.
Things when well until I issued ./configure at the step 3. Then this error is appeared:
bash: ./configure: No such file or directory
These are my code lines:
cd /tmp
gunzip qt-everywhere-opensource-src-%VERSION%.tar.gz # uncompress the archive
tar xvf qt-everywhere-opensource-src-%VERSION%.tar # unpack it
cd /tmp/qt-everywhere-opensource-src-%VERSION%
./configure
I am confused that what should I do? I can not find configure...
Thanks in advance for your helpful answers.
From the official website:
If you download a Zip source package, you will need to convert Windows-style line endings (CR/LF) to Unix-style line-endings (LF) when you uncompress the package. To do this, give the "-a" option when you run the "unzip' command.If you fail to supply the "-a" option when unzipping the package, you will see the following error message when you attempt to execute the configure command: "bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory"
So be sure to supply the -a option when uzipping
Take a look at this link: http://www.stackoverflow.com/questions/2920416/configure-bin-shm-bad-interpreter
For those who came into this question with same answer, but for Qt5..
From the official website:
If you download a Zip source package, you will need to convert
Windows-style line endings (CR/LF) to Unix-style line-endings (LF)
when you uncompress the package. To do this, give the "-a" option when
you run the "unzip' command.If you fail to supply the "-a" option when
unzipping the package, you will see the following error message when
you attempt to execute the configure command: "bash: ./configure:
/bin/sh^M: bad interpreter: No such file or directory"
So be sure to supply the -a option when uzipping Take a look at this
link:
http://www.stackoverflow.com/questions/2920416/configure-bin-shm-bad-interpreter
This answer does not work anymore, becouse all files in zip archive are tagged as binary (even configure text files). Only way to make it work is download xxx.tar.xz file, and open it by tar -xf xxx.tar.xz. If TAR.XZ file is not recognized, use -J parameter (tar -xJf xxx.tar.xz).