Not able to use tar option sort on Centos
Username: Zbyněk Kocur
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=1195
During the installation process of packages on Centos 7.4 system occurs an error with using of tar utility:
[flowtester@FTCompiler flowtester_ng]$ flock /home/flowtester/caes/CAES/flowtester_ng/tmp/.flowtester_ctl-2017112301-d11eaf2933a1e37022890012113d546fe9ef2a19.tar.gz.flock -c ' echo "Checking out files from the git repository..."; mkdir -p /home/flowtester/caes/CAES/flowtester_ng/tmp/dl && cd /home/flowtester/caes/CAES/flowtester_ng/tmp/dl && rm -rf flowtester_ctl-2017112301 && [ ! -d flowtester_ctl-2017112301 ] && git clone https://kttmine.fel.cvut.cz/git/nga-tester.git flowtester_ctl-2017112301 && (cd flowtester_ctl-2017112301 && git checkout d11eaf2933a1e37022890012113d546fe9ef2a19 && git submodule update --init --recursive) && echo "Packing checkout..." && export TAR_TIMESTAMP=cd flowtester_ctl-2017112301 && git log -1 --format='\''@%ct'\''
&& rm -rf flowtester_ctl-2017112301/.git && tar --numeric-owner --owner=0 --group=0 --sort=name {TAR_TIMESTAMP:+--mtime="
TAR_TIMESTAMP"} -c flowtester_ctl-2017112301 | gzip -nc > /home/flowtester/caes/CAES/flowtester_ng/tmp/dl/flowtester_ctl-2017112301-d11eaf2933a1e37022890012113d546fe9ef2a19.tar.gz && mv /home/flowtester/caes/CAES/flowtester_ng/tmp/dl/flowtester_ctl-2017112301-d11eaf2933a1e37022890012113d546fe9ef2a19.tar.gz /home/flowtester/caes/CAES/flowtester_ng/dl/ && rm -rf flowtester_ctl-2017112301; '
Checking out files from the git repository...
Cloning into 'flowtester_ctl-2017112301'...
Username for 'https://kttmine.fel.cvut.cz': kocurzby
Password for 'https://kocurzby@kttmine.fel.cvut.cz':
remote: Counting objects: 158, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 158 (delta 78), reused 113 (delta 55)
Receiving objects: 100% (158/158), 35.96 KiB | 5.99 MiB/s, done.
Resolving deltas: 100% (78/78), done.
Note: checking out 'd11eaf2933a1e37022890012113d546fe9ef2a19'.
You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at d11eaf2... Progress message is always filled.
Packing checkout...
tar: unrecognized option '--sort=name'
Try tar --help' or
tar --usage' for more information.
The problem is in download.mk :
define dl_tar_pack
(TAR) --numeric-owner --owner=0 --group=0 --sort=name $
{TAR_TIMESTAMP:+--mtime="
$$TAR_TIMESTAMP"} -c $(2) | (call dl_pack,
(1))
endef
The solutions is do not user sort parameter like:
define dl_tar_pack
$(TAR) --numeric-owner --owner=0 --group=0 -c $(2) | (call dl_pack,
(1))
endef