How to tell what directory was created by ansible's unarchive module? - tar

I'm writing an ansible playbook to automate the installation of a piece of software. When I download the tarball from the website I have:
software-package-release.tar.gz
When untarred I'm left with the directory
software-package-v2.15/
Does ansible have any way of registering the directory created as part of the unarchive module?
I've tried with the following plays (I put the nrpe-lkdsflkdjf file there which contains a dir nrpe-2.15)
- name: Extract
unarchive
src:/tmp/nrpe-lkdsflkdjf
dest: /tmp/
copy: no
register: tar_reg
- name: debug tar_reg
debug: var=tar_reg
And this was the output of the debug:
ok: [IP-here] => {
"tar_reg": {
"changed": true,
"check_results": {
"cmd": "/bin/gtar -C \"/tmp/\" --diff -f \"/tmp/nrpe-lkdsjflkdsjf\"",
"err": "/bin/gtar: nrpe-2.15: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/SECURITY: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/README.Solaris: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/init-script.debian.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/nrpe.spec.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/LEGAL: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/subst.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/sample-config: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/sample-config/nrpe.xinetd.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/sample-config/nrpe.cfg.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/preinstall: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/nrpe.xml: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/i.config: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/postinstall: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/r.config: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/pkg/nrpe: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/package/solaris/Makefile.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/nrpe.spec: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/README: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/acl.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/check_nrpe.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/snprintf.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/Makefile.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/utils.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/src/nrpe.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/config.guess: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/install-sh: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/contrib: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/contrib/nrpe_check_control.c: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/contrib/README.nrpe_check_control: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/init-script.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/docs: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/docs/NRPE.pdf: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/docs/NRPE.odt: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/init-script.suse.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/configure: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/config.sub: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/Changelog: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/Makefile.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/README.SSL: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/configure.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/update-version: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/dh.h: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/common.h: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/utils.h: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/acl.h: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/config.h.in: Warning: Cannot stat: No such file or directory\n/bin/gtar: nrpe-2.15/include/nrpe.h: Warning: Cannot stat: No such file or directory\n",
"out": "",
"rc": 1,
"unarchived": false
},
"dest": "/tmp/",
"extract_results": {
"cmd": "/bin/gtar -xf \"/tmp/nrpe-lkdsjflkdsjf\"",
"err": "",
"out": "",
"rc": 0
},
"gid": 0,
"group": "root",
"handler": "TarArchive",
"mode": "01777",
"owner": "root",
"size": 3072,
"src": "/tmp/nrpe-lkdsjflkdsjf",
"state": "directory",
"uid": 0
}
}

The unarchive module does have the option to list the files - list_files. The output can be registered, and usually the first value in the array is the directory name.
The following worked for me:
- name: Extract files
unarchive:
src: /tmp/my_archive.tar.gz
dest: /mydir
remote_src: yes
list_files: yes
register: archive_contents
archive_contents.files[0] will have your top level directory.

Update: see answer from #vinayak-thatte for correct answer.
Unarchive module doesn't know what's inside the archive – it just places all archive content into dest folder.
If you know in advance that there is or there may be a single folder inside the archive, you can make some test like this:
- name: Get dir 1 - fast - when you are sure that there is one and only one subfolder
shell: tar tf file.tgz | head -1 | sed -e 's/\/.*//'
changed_when: false
register: tar_test
- debug: 'msg="Subfolder: {{tar_test.stdout}}"'
- name: Get dir 2 - slow - when you dont sure
shell: tar tf file.tgz | sed -e 's/\/.*//' | sort | uniq
changed_when: false
register: tar_test
- debug: 'msg="Subfolder: {{tar_test.stdout}}"'
when: tar_test.stdout_lines | count == 1
- debug: msg="No subfolder!"
when: tar_test.stdout_lines | count > 1
First method is quicker than second, but it checks only one line of archive file listing – so you must me sure that there is only one subfolder inside.
Second method checks all paths in the archive and collects distinct names in the archive "root" – so if there is only one match (count == 1) it is very likely to be subfolder (or single file in the archive :-/), otherwise there are many entries in the archive "root".

Related

Mac GridLabD installation error at % make -j8

I am trying to build GridLabD on my mac, but get a range or warnings and errors at the step "% make -j8". It is a long log, but below is how it starts (couldn't find gridlabd tag). I followed steps in Is it possible to run GridLab-D on macOS Catalina?, but got the same error at the "make" command. I appreciate any help.
% make -j8
/bin/bash -c "source utilities/build_number . gldcore/build.h"
Updating gldcore/build.h: revision 19053 (d7f83006:develop:Mod)
/Users/hei06j/Documents/repositories/remote/gridlab-d
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
CXX gldcore/gridlabd-convert.o
CC gldcore/gridlabd-instance_slave.o
CC gldcore/gridlabd-interpolate.o
CXX gldcore/gridlabd-job.o
CC gldcore/gridlabd-kml.o
CC gldcore/gridlabd-legal.o
CC gldcore/gridlabd-linkage.o
CXX gldcore/gridlabd-link.o
CC gldcore/gridlabd-load.o
CC gldcore/gridlabd-loadshape.o
CXX gldcore/gridlabd-load_xml.o
CXX gldcore/gridlabd-load_xml_handle.o
CC gldcore/gridlabd-local.o
CXX gldcore/gridlabd-lock.o
CC gldcore/gridlabd-main.o
CC gldcore/gridlabd-match.o
CC gldcore/gridlabd-matlab.o
CC gldcore/gridlabd-module.o
CC gldcore/gridlabd-object.o
CC gldcore/gridlabd-output.o
CC gldcore/gridlabd-property.o
CC gldcore/gridlabd-random.o
CC gldcore/gridlabd-realtime.o
CXX gldcore/gridlabd-sanitize.o
CC gldcore/gridlabd-save.o
CC gldcore/gridlabd-schedule.o
CC gldcore/gridlabd-server.o
CXX gldcore/gridlabd-setup.o
In file included from gldcore/load_xml.cpp:15:
In file included from ./gldcore/platform.h:57:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:420:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
./version:1:3: error: invalid preprocessing directive
# $Id: VERSION 858 2008-08-28 21:06:13Z d3g637 $
^
./version:2:1: error: C++ requires a type specifier for all declarations
MAJOR=3
^
./version:2:8: error: expected ';' after top level declarator
MAJOR=3
^
In file included from gldcore/convert.cpp:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:420:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
./version:1:3: error: invalid preprocessing directive
# $Id: VERSION 858 2008-08-28 21:06:13Z d3g637 $
^
./version:2:1: error: C++ requires a type specifier for all declarations
MAJOR=3
^
In file included from gldcore/load_xml_handle.cpp:18:
In file included from ./gldcore/platform.h:57:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:420:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
./version:./version1::32:: 8: error: error: invalid preprocessing directive
expected ';' after top level declarator
MAJOR=3
^
# $Id: VERSION 858 2008-08-28 21:06:13Z d3g637 $
^
./version:2:1: error: C++ requires a type specifier for all declarations
MAJOR=3
^
./version:2:8: error: expected ';' after top level declarator
MAJOR=3
^
In file included from gldcore/setup.cpp:4:
In file included from ./gldcore/gridlabd.h:91:
In file included from ./gldcore/platform.h:57:
In file included from
...

ld: 0706-005 Cannot find or open file: /lib/mcrt0.o

I am try to make install the ImageMagick-6.9.10-86 on the AIX system, but error prompted as below :
CCLD magick/libMagickCore-6.Q16.la
/opt/IBM/xlC/16.1.0/bin/.orig/xlc: 1501-210 (W) command option t contains an incorrect subargument
ld: 0706-005 Cannot find or open file: /lib/mcrt0.o
ld:open(): A file or directory in the path name does not exist.
make: 1254-004 The error code from the last command is 255.
Stop.
make: 1254-004 The error code from the last command is 2.
when I try to use ls -l /lib/mcrt0.o and ls -l /usr/ccs/lib/mcrt0.o command, result as below :
ls: 0653-341 The file /lib/mcrt0.o does not exist.
I only can find crt0.o in the path.

Architecture not supported error when installing OpenSSL on OS X

rbenv-2.6.5 is attempting to install openssl-1.1.1d and that's where the architecture error comes, I have no direct access to the Makefile:
$ rbenv install 2.6.5
Downloading openssl-1.1.1d.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
Installing openssl-1.1.1d...
BUILD FAILED (OS X 10.15.1 using ruby-build 20191124)
Inspect or clean up the working tree at /var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.Z0Hvfg
Results logged to /var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.log
Last 10 log lines:
In file included from include/openssl/e_os2.h:243:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/inttypes.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/inttypes.h:227:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types/_wchar_t.h:34:9: error: unknown type name '__darwin_wchar_t'
typedef __darwin_wchar_t wchar_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [apps/app_rand.o] Error 1
make: *** [all] Error 2
Complete log:
$ cat /var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.log
/var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.Z0Hvfg ~/Developer/ReactNativeApp/ios
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 8845861
Connection: keep-alive
Date: Tue, 26 Nov 2019 09:50:32 GMT
Last-Modified: Tue, 01 Oct 2019 21:38:26 GMT
ETag: "3be209000dbc7e1b95bcdf47980a3baa"
Accept-Ranges: bytes
Server: AmazonS3
X-Cache: Hit from cloudfront
Via: 1.1 e56e6732f380db727425bac2d6158761.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FRA2-C2
X-Amz-Cf-Id: Hw-jhD36n4Jk8CezqbAuFTzudNo4qopXkdH3CaxRXUHbadZgf9Z6xA==
Age: 9492
/var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.Z0Hvfg/openssl-1.1.1d /var/folders/8s/8mw7vg315l7dr9vyfxmv9vk80000gn/T/ruby-build.20191126132843.6027.Z0Hvfg ~/Developer/ReactNativeApp/ios
Operating system: x86_64-apple-darwinDarwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64
Configuring OpenSSL version 1.1.1d (0x1010104fL) for darwin64-x86_64-cc
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
WARNING! If you wish to build 32-bit libraries, then you have to
invoke 'KERNEL_BITS=32 ./config '--prefix=/Users/User/.rbenv/versions/2.6.5/openssl' '--openssldir=/Users/User/.rbenv/versions/2.6.5/openssl/ssl' 'zlib-dynamic' 'no-ssl3' 'shared''.
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _all
clang -I. -Iinclude -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/User/.rbenv/versions/2.6.5/openssl/ssl\"" -DENGINESDIR="\"/Users/User/.rbenv/versions/2.6.5/openssl/lib/engines-1.1\"" -D_REENTRANT -DZLIB -DZLIB_SHARED -DNDEBUG -I/Users/User/.rbenv/versions/2.6.5/include -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/limits.h:37:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/limits.h:63:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
^
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/limits.h:37:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/limits.h:64:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
#error architecture not supported
^
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:16:
In file included from include/openssl/e_os2.h:243:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/inttypes.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/inttypes.h:226:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:16:
In file included from include/openssl/e_os2.h:243:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/inttypes.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/inttypes.h:226:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/_types.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'; did you mean '__int128_t'?
typedef __int64_t __darwin_blkcnt_t; /* total blocks */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_blksize_t; /* preferred block size */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_dev_t; /* dev_t */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean '__uint128_t'?
typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'; did you mean '__int128_t'?
typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_sigset_t; /* [???] signal set */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_uid_t; /* [???] user IDs */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:16:
In file included from include/openssl/e_os2.h:243:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/inttypes.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/inttypes.h:226:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:16:
In file included from include/openssl/e_os2.h:243:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/inttypes.h:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/inttypes.h:227:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/sys/_types/_wchar_t.h:34:9: error: unknown type name '__darwin_wchar_t'
typedef __darwin_wchar_t wchar_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [apps/app_rand.o] Error 1
make: *** [all] Error 2
There were two errors in total, the final solution was:
Made sure I have the right version of gcc installed
Install xcode-select to fix the compiler error by selecting the right environment:
xcode-select --install
sudo xcode-select -switch /Applications/Xcode.app
Restarted Mac (important)
Installed the rbenv:
rbenv install 2.6.5

tar.bz2 cannot stat: no such file or directory

I am compressing 60G of a backup of a bank using the command below, but the log informs the following messages.
What can it be?
Command:
BZIP=-9 tar -cvjf /backup/backup-mysql-'date "+%Y%m%d"'.tar.bz2 /backup/backup-mysql
Error:
tar: "+%Y%m%d".tar.bz2: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
Try with following command:
tar -cvjf /backup/backup-mysql-$(date "+%Y%m%d").tar.bz2 /backup/backup-mysql

Can't add or build ios platform in Cordova 5.0.0

When I go to add ios platform to a boilerplate Cordova project, I'm confronted with this:
jondamato$ cordova platform add ios
Adding ios project...
mv: no such file or directory: project.pbxproj
mv: dest is not a directory (too many sources)
mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/__PROJECT_NAME__-Info.plist
mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/__PROJECT_NAME__-Prefix.pch
mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/gitignore
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld.xcodeproj/project.pbxproj
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/AppDelegate.h
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/AppDelegate.m
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/MainViewController.h
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/MainViewController.m
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/main.m
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Info.plist
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Prefix.pch
sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Info.plist
rm: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/CordovaLib
cp: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/.gitignore
grep: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld.xcodeproj/project.pbxproj
/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:266
throw new Error('Subproject: ' + subprojectPath + ' entry not found in
^
Error: Subproject: CordovaLib/CordovaLib.xcodeproj entry not found in project file
at update_cordova_subproject (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:266:15)
at copyJsAndCordovaLib (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:69:9)
at Object.exports.createProject (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:202:5)
at Object.<anonymous> (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/create:53:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
Error: /Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
It looks likes Cordova creates the project files but can't load them. When I try to build the project, this is what I get:
jondamato$ cordova build ios
cp: no such file or directory: *new/hiworld/config.xml
mkdir: path already exists: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/www
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html
cp: no such file or directory: *new/hiworld/www/js
cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html
cp: no such file or directory: *new/hiworld/www/js
cp: no such file or directory: *new/hiworld/www/js/index.js
Parsing /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/__CLI__/config.xml failed
Error: ENOENT, no such file or directory '/Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/__CLI__/config.xml'
at Object.fs.openSync (fs.js:439:18)
at Object.fs.readFileSync (fs.js:290:15)
at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:118:27)
at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/configparser/ConfigParser.js:33:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:115:32
at Array.map (native)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:70:40
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
The preliminary build files end up in my directory though.
Can anyone tell me what's going on? I've uninstalled and reinstalled Cordova a few times hoping it would help, but no luck.
Thanks!
I found out that the asterisk in my directory name makes Cordova freak out somehow. Just make sure you're Cordova project isn't in a folder with an asterisk in the name.

Resources