Quickie: what is a file that starts with these bytes?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But what should be the correct, for this command and project is:
Code:
xdelta3 # the name of the command is different
-s
patch-qt-x11-free-3.0.4 # downloaded patch file
qt-x11-free-3.0.3.tar # downloaded or previously owned file
qt-x11-free-3.0.4.tar # this does not exist in local machine
xdelta --help
xdelta: usage: xdelta COMMAND [OPTIONS] [ARG1 ...]
xdelta: COMMAND is one of:
xdelta: delta Produce a delta from ARG1 to ARG2 producing ARG3
xdelta: info List details about delta ARG1
xdelta: patch Apply patch ARG1 using file ARG2 producing ARG3
xdelta: OPTIONS are:
xdelta: -v, --version Print version information
xdelta: -V, --verbose Print verbose error messages
xdelta: -h, --help Print this summary
xdelta: -n, --noverify Disable automatic MD5 verification
xdelta: -p, --pristine Disable automatic GZIP decompression
xdelta: -m, --maxmem=SIZE Set the buffer size limit, e.g. 640K, 16M
xdelta: -[0-9] ZLIB compress level: 0=none, 1=fast, 6=default, 9=best
xdelta: -s=BLOCK_SIZE Sets block size (power of 2), minimum match length
xdelta: In-core memory requirement is (FROM_LEN * 8) / BLOCK_SIZE
I'm not sure what happened with 3.3.8b , there seems to be no patch to make it
but anyway, you don't need the patch
Edit: I blame the names
patch-qt-x11-free-3.3.7-3.3.8
or
patch-qt-x11-free-3.3.7-to-3.3.8
would have made much more sense
My guess with the similar command name was that you assumed xdelta3 worked like other patch commands, like people have said before, in this thread. I did not know or imagine that 'xdelta' existed, and that it would work with the same kind of patch 'xdelta3' does.
So, the thread had ended a few posts ago: the strange file is Xdelta3. The Qt files distributed for older versions do not have good names, and documentation about them is... no, it is not in the README* files in the 3.3.8* versions of it. /-: Let me recheck that, before i close the thread.
The Makefile may already know how to apply patches. Check the README file for instructions.
Which README file you talk about? It is not inside qt-x11-free-3.3.8.tar.bz2, qt-x11-free-3.3.8b.tar.bz2 or qt-x11-free-3.3.7.tar.bz2 files. I checked the files README*, INSTALL and FAQ.
The Makefile may already know how to apply patches. Check the README file for instructions.
I also did a
grep -Ri patch * | less
to find "patch" written in any file, but i could not find anything. And if the Makefile knows about patches, i cannot understand where in it that target is - i would say it does not exist:
Code:
# -*- makefile -*-
#
# Main Makefile for building the Qt library, examples
# and tutorial.
SHELL=/bin/sh
init: FORCE
@$(MAKE) all
uninstall: FORCE
@$(MAKE) qt.uninstall
install: FORCE
@$(MAKE) qt.install
all: symlinks src-qmake src-moc sub-src sub-tools
sub-tutorial sub-examples
@echo
@echo "The Qt library is now built in ./lib"
@echo "The Qt examples are built in the directories in ./examples"
@echo "The Qt tutorials are built in the directories in ./tutorial"
@echo
@echo "Enjoy! - the Trolltech team"
@echo
qt.install: qmake-install moc-install src-install tools-install plugins-install
qt.uninstall: qmake-uninstall moc-uninstall src-uninstall \
tools-uninstall plugins-uninstall
#moc
moc-uninstall: .qmake.cache
cd src/moc && $(MAKE) uninstall
moc-install: src-moc
cd src/moc && $(MAKE) install
src-moc: src-qmake FORCE
cd src/moc && $(MAKE)
#Qt
src-uninstall: .qmake.cache
cd src && $(MAKE) uninstall
src-install: sub-src
cd src && $(MAKE) install
sub-src: src-moc .qmake.cache FORCE
cd src && $(MAKE)
#qmake
qmake-uninstall: .qmake.cache
cd qmake && $(MAKE) uninstall
qmake-install: src-qmake
cd qmake && $(MAKE) install
src-qmake: symlinks FORCE
cd qmake && $(MAKE)
#tools
tools-uninstall: .qmake.cache
cd tools && $(MAKE) uninstall
tools-install: sub-tools
cd tools && $(MAKE) install
sub-tools: sub-plugins FORCE
cd tools && $(MAKE)
#plugins
plugins-uninstall: .qmake.cache
cd plugins/src && $(MAKE) uninstall
plugins-install: sub-plugins
cd plugins/src && $(MAKE) install
sub-plugins: sub-src .qmake.cache FORCE
cd plugins/src && $(MAKE)
#tutorials
sub-tutorial: sub-src FORCE
cd tutorial && $(MAKE)
#examples
sub-examples: sub-tools FORCE
cd examples && $(MAKE)
#docs
doc: FORCE
qdoc util/qdoc/qdoc.conf
symlinks: .qmake.cache
# @cd include && rm -f q*.h;
# ln -s ../src/*/q*.h . ;
# ln -s ../extensions/*/src/q*.h . ;
# rm -f q*_p.h
distclean clean uiclean mocclean:
cd tools && $(MAKE) $@
cd src/moc && $(MAKE) $@
cd src && $(MAKE) $@
cd tutorial && $(MAKE) $@
cd plugins/src && $(MAKE) $@
cd examples && $(MAKE) $@
cd config.tests/unix/stl && $(MAKE) $@
cd config.tests/unix/endian && $(MAKE) distclean
cd config.tests/unix/ipv6 && $(MAKE) distclean
cd config.tests/unix/largefile && $(MAKE) distclean
cd config.tests/unix/ptrsize && $(MAKE) distclean
[ ! -f config.tests/x11/notype/Makefile ] || \
cd config.tests/x11/notype && $(MAKE) $@
cd qmake && $(MAKE) $@
#confclean is actually the same as distclean, except qmake and moc
#are not cleaned.
confclean:
cd tools && $(MAKE) distclean
cd src && $(MAKE) distclean
cd tutorial && $(MAKE) distclean
cd plugins/src && $(MAKE) distclean
cd examples && $(MAKE) distclean
cd config.tests/unix/stl && $(MAKE) distclean
cd config.tests/unix/endian && $(MAKE) distclean
cd config.tests/unix/ipv6 && $(MAKE) distclean
cd config.tests/unix/largefile && $(MAKE) distclean
cd config.tests/unix/ptrsize && $(MAKE) distclean
[ ! -f config.tests/x11/notype/Makefile ] || \
cd config.tests/x11/notype && $(MAKE) distclean
.qmake.cache:
@echo
@echo ' Qt must first be configured using the "configure" script.'
@echo
@test ! /bin/true
FORCE:
Two answers for the questions below have been answered. See #29.
-----------------------------
1)
Quote:
Originally Posted by smallpond
The Makefile may already know how to apply patches. Check the README file for instructions.
This does not seem to be true in this case, for the officially distributed Qt3 files - or i could not locate that. I checked the Makefile and instructions files (like README, INSTALL and a few others, when present).
Did you make this statement in a guess that is (or were) true for many things around there?
2) How to use the patch files in https://download.qt.io/archive/qt/3/ ? (in this page we also download all other files mentioned here) For example, we can use patch-qt-x11-free-3.3.8 to obtain the content in either qt-x11-free-3.3.8b.tar.gz or qt-x11-free-3.3.8.tar.bz2 beginning with the contents of qt-x11-free-3.3.7.tar.bz2. I was unable to get a working patched content with the commands xdelta3 i tried (commands discussed/pointed in this thread).
3) Once achieved a working result file in 2, how to check the new contents are the same?
I forgot to show a few other tests i did with the patched files, in other day. I tried to extract them with bunzip2, gunzip and tar. None works. Look here with a few comments added to help people reading quickier:
Code:
2019.09.21 18:05:50 [ 0] me@here: /dev/shm/qt
$ ls
total 298M
1,2M patch-qt-x11-free-3.3.8 14M qt-x11-free-3.3.7.tar.bz2
17M qt3-patched-1 68M qt-x11-free-3.3.8b.tar
17M qt3-patched-2 17M qt-x11-free-3.3.8b.tar.gz
17M qt3-patched-3 68M qt-x11-free-3.3.8.tar
68M qt-x11-free-3.3.7.tar 14M qt-x11-free-3.3.8.tar.bz2
2019.09.21 18:29:32 [ 130] me@here: /dev/shm/qt
$ for i in qt3-patched-1; do ln -s $i p1.tar; ln -s $i p1.tbz; \
ln -s $i p1.tgz;done # create 3 symbolic links, with different\
extensions, to patched file 1
2019.09.21 18:29:51 [ 0] me@here: /dev/shm/qt
$ for i in qt3-patched-2; do ln -s $i p2.tar; ln -s $i p2.tbz; \
ln -s $i p2.tgz;done # create 3 symbolic links, with different\
extensions, to patched file 2
2019.09.21 18:30:19 [ 0] me@here: /dev/shm/qt
$ for i in qt3-patched-3; do ln -s $i p3.tar; ln -s $i p3.tbz;\
ln -s $i p3.tgz;done # create 3 symbolic links, with different\
extensions, to patched file 3
2019.09.21 18:30:32 [ 0] me@here: /dev/shm/qt
$ ls
total 298M
0 p1.tar 0 p3.tbz 14M qt-x11-free-3.3.7.tar.bz2
0 p1.tbz 0 p3.tgz 68M qt-x11-free-3.3.8b.tar
0 p1.tgz 1,2M patch-qt-x11-free-3.3.8 17M qt-x11-free-3.3.8b.tar.gz
0 p2.tar 17M qt3-patched-1 68M qt-x11-free-3.3.8.tar
0 p2.tbz 17M qt3-patched-2 14M qt-x11-free-3.3.8.tar.bz2
0 p2.tgz 17M qt3-patched-3
0 p3.tar 68M qt-x11-free-3.3.7.tar
2019.09.21 18:30:38 [ 0] me@here: /dev/shm/qt
# try to list patched file contents with tar
$ for i in p[1-3].tar; do echo -e "=== file $i:\n"; tar tf $i; done
=== file p1.tar:
tar: Este não parece ser um arquivo-tar
tar: Pulando para o próximo cabeçalho
tar: Exiting with failure status due to previous errors
=== file p2.tar:
tar: Este não parece ser um arquivo-tar
tar: Pulando para o próximo cabeçalho
tar: Exiting with failure status due to previous errors
=== file p3.tar:
tar: Este não parece ser um arquivo-tar
tar: Pulando para o próximo cabeçalho
tar: Exiting with failure status due to previous errors
2019.09.21 18:32:09 [ 2] me@here: /dev/shm/qt
# try to bunzip the patched files
$ for i in p[1-3].tbz; do echo -e "=== file $i:\n"; bunzip2 $i; done
=== file p1.tbz:
bunzip2: Input file p1.tbz is not a normal file.
=== file p2.tbz:
bunzip2: Input file p2.tbz is not a normal file.
=== file p3.tbz:
bunzip2: Input file p3.tbz is not a normal file.
2019.09.21 18:32:43 [ 1] me@here: /dev/shm/qt
# try to gunzip the patched files
$ for i in p[1-3].tgz; do echo -e "=== file $i:\n"; gunzip $i; done
=== file p1.tgz:
gzip: p1.tgz: Too many levels of symbolic links
=== file p2.tgz:
gzip: p2.tgz: Too many levels of symbolic links
=== file p3.tgz:
gzip: p3.tgz: Too many levels of symbolic links
2019.09.21 18:33:24 [ 1] me@here: /dev/shm/qt
# The gunzip error is nonsense. Cannot we gunzip symbolic links?
$ ls
total 298M
0 p1.tar 0 p3.tbz 14M qt-x11-free-3.3.7.tar.bz2
0 p1.tbz 0 p3.tgz 68M qt-x11-free-3.3.8b.tar
0 p1.tgz 1,2M patch-qt-x11-free-3.3.8 17M qt-x11-free-3.3.8b.tar.gz
0 p2.tar 17M qt3-patched-1 68M qt-x11-free-3.3.8.tar
0 p2.tbz 17M qt3-patched-2 14M qt-x11-free-3.3.8.tar.bz2
0 p2.tgz 17M qt3-patched-3
0 p3.tar 68M qt-x11-free-3.3.7.tar
2019.09.21 18:33:49 [ 0] me@here: /dev/shm/qt
$ ls -l
total 298M
0 lrwxrwxrwx 1 user user 13 set 21 18:29 p1.tar -> qt3-patched-1
0 lrwxrwxrwx 1 user user 13 set 21 18:29 p1.tbz -> qt3-patched-1
0 lrwxrwxrwx 1 user user 13 set 21 18:29 p1.tgz -> qt3-patched-1
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p2.tar -> qt3-patched-2
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p2.tbz -> qt3-patched-2
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p2.tgz -> qt3-patched-2
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p3.tar -> qt3-patched-3
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p3.tbz -> qt3-patched-3
0 lrwxrwxrwx 1 user user 13 set 21 18:30 p3.tgz -> qt3-patched-3
1,2M -rw-r--r-- 1 user user 1,2M dez 13 2012 patch-qt-x11-free-3.3.8
17M -rw-r--r-- 1 user user 17M set 21 18:03 qt3-patched-1
17M -rw-r--r-- 1 user user 17M set 21 18:04 qt3-patched-2
17M -rw-r--r-- 1 user user 17M set 21 18:05 qt3-patched-3
68M -rw-r--r-- 1 user user 68M dez 13 2012 qt-x11-free-3.3.7.tar
14M -rw-r--r-- 1 user user 14M dez 13 2012 qt-x11-free-3.3.7.tar.bz2
68M -rw-r--r-- 1 user user 68M dez 13 2012 qt-x11-free-3.3.8b.tar
17M -rw-r--r-- 1 user user 17M dez 13 2012 qt-x11-free-3.3.8b.tar.gz
68M -rw-r--r-- 1 user user 68M dez 13 2012 qt-x11-free-3.3.8.tar
14M -rw-r--r-- 1 user user 14M dez 13 2012 qt-x11-free-3.3.8.tar.bz2
2019.09.21 18:33:55 [ 0] me@here: /dev/shm/qt
# try to gunzip the patched files directly, since filenames should not matter
$ for i in qt3*; do echo -e "=== file $i:\n"; gunzip $i; done
=== file qt3-patched-1:
gzip: qt3-patched-1: unknown suffix -- ignored
=== file qt3-patched-2:
gzip: qt3-patched-2: unknown suffix -- ignored
=== file qt3-patched-3:
gzip: qt3-patched-3: unknown suffix -- ignored
2019.09.21 18:35:12 [ 2] me@here: /dev/shm/qt
$
Software versions and patch file format versions should be different things. /-: I can unzip a tar.gz file with Winzip, Winrar, gunzip, 7-zip, etc., in most versions of all of these. 'xdelta' and 'xdelta3' were just another example of this, for me. So i did not even bother with 'xdelta', since 'xdelta3' was the one i already had installed.
Do you consider that, of using a patch in a wrong format, a bug in xdelta3?
This does not seem to be true in this case, for the officially distributed Qt3 files - or i could not locate that. I checked the Makefile and instructions files (like README, INSTALL and a few others, when present).
Did you make this statement in a guess that is (or were) true for many things around there?
Still needs an answer, just to confirm my statement.
Quote:
Originally Posted by dedec0
2) How to use the patch files in https://download.qt.io/archive/qt/3/ ? (in this page we also download all other files mentioned here) For example, we can use patch-qt-x11-free-3.3.8 to obtain the content in either qt-x11-free-3.3.8b.tar.gz or qt-x11-free-3.3.8.tar.bz2 beginning with the contents of qt-x11-free-3.3.7.tar.bz2. I was unable to get a working patched content with the commands xdelta3 i tried (commands discussed/pointed in this thread).
The program 'xdelta' must be used to apply the patch files to the tar files of the last version before the version the patch filename has. So patch-qt-x11-free-3.3.8 should be applied to qt-x11-free-3.3.7.tar to obtain qt-x11-free-3.3.8.tar, and so on. Important note: do *not* use 'xdelta3' instead of 'xdelta' program. It will not give any error (as of 2019/09/21), but it will not give any useful result.
Quote:
Originally Posted by dedec0
3) Once achieved a working result file in 2, how to check the new contents are the same?
md5sum or any other file content comparison suffice. See #28.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.