Can't install telegram-cli with Cygwin - makefile

I followed this guide on how to install telegram-cli with Cygwin, but when I attempted the step "We need to patch Makefile and loop.c to compile in cygwin. Download this patch then untar. Then, patch in tg directory." and tried to patch using the provided code
patch -p1 < telegram-cli-cygwin.patch
I got the following message:
$ patch -p1 < telegram-cli-cygwin.patch
patching file Makefile
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file loop.c
Hunk #1 FAILED at 383.
Hunk #2 FAILED at 634.
2 out of 2 hunks FAILED -- saving rejects to file loop.c.rej
Everything was working fine up until then. Any help would be appreciated.

The source does not matches with the version for which the patch was prepared.
Likely it is a following version.
Look on Makefile.rej and loop.c.rej and check the discrepancy.
May be the change were alredy implemented or the context changes do not allow
the patch program to recognize where to implement the changes.

Related

how to install from source code on mac terminal

I'm trying to install a software named "pigz" on mac . after downloading the source code, in terminal I go to the folder containing source code then I run make. when I try to install it with sudo make install I get this message
make: *** No rule to make target `install'. Stop.
or when I try to install it with brew
brew install pigz
I get this error
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/pigz-2.4.catalina.bottle.ta
Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.
##O=# #
curl: (6) Could not resolve host: homebrew.bintray.com
Error: Failed to download resource "pigz"
Download failed: https://homebrew.bintray.com/bottles/pigz-2.4.catalina.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://zlib.net/pigz/pigz-2.4.tar.gz
######################################################################## 100.0%
==> make CC=clang CFLAGS=
🍺 /usr/local/Cellar/pigz/2.4: 7 files, 154KB, built in 4 seconds
since I'm very new to command line I really don't know what this means and what I should do
I would appreciate your help
In the source code that you're looking at, there is a Makefile. When you run the command make, it executes the first default rule that it sees within that file.
When you run the command sudo make install, it looks inside of the Makefile and looks for the install rule. However, if you look at the Makefile of the software you're looking at, there is no install rule, hence the reason you get the error message:
make: *** No rule to make target `install'. Stop.
This is simply because there is no rule to install anything, so when you run that command, it simply will not do anything.
You can get a better understanding of this stuff by searching online about what Makefiles are, you'll find a bunch of resources. This can be a good starting point.

Error while installing Alien::XGBoost library

I'm unable to install the Alien::XGBoost library using the default installation of Strawberry Perl on Windows 10. I'm using the 64-bit version of Strawberry Perl.
When installing Alien::XGBoost, I receive an error on line 49 in the Alien/Build/CommandSequence.pm file as shown below.
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/Alien-XGBoost-0.04-1/_alien/build_wYwS'
Alien::Build::CommandSequence> + md "C:/STRAWB~1/cpan/build/Alien-XGBoost-0.04-1/blib/lib/auto/share/dist/Alien-XGBoost/dynamic"
Alien::Build::CommandSequence> + md "C:/STRAWB~1/cpan/build/Alien-XGBoost-0.04-1/blib/lib/auto/share/dist/Alien-XGBoost/bin"
Alien::Build::CommandSequence> + copy xgboost.exe C:/STRAWB~1/cpan/build/Alien-XGBoost-0.04-1/blib/lib/auto/share/dist/Alien-XGBoost/bin/
The syntax of the command is incorrect.
external command failed at C:/Strawberry/perl/site/lib/Alien/Build/CommandSequence.pm line 49.
gmake: *** [Makefile:2881: _alien/mm/build] Error 2
PABLROD/Alien-XGBoost-0.04.tar.gz
C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Alien::XGBoost'.
The author of the library just confirmed it was a bug. His statement is below. I installed the previous version and it worked perfectly.
Thanks for reporting this!!
It's a bug! I forgot to quote the path.
As you can see both md commands have the path double quoted (""), but not the copy command.
I'm working to fix it and also I'm going to get travis and appveyor integrations to avoid this in the future.
This weekend this will be fixed. Meanwhile please install the previous version:
cpanm PABLROD/Alien-XGBoost-0.03.tar.gz

Patching Magento SUPEE-5345 Magento 1.7.0.2

I'm trying to install the latest patch on Magento 1.7.0.2 running on a centOS nginx server. I've installed it on the dev server via SSH and all worked smoothly. However the live server which is nginx I'm getting this error:
[root#### htdocs]# sh PATCH_SUPEE-5345_CE_1.7.0.2_v1.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.
patching file app/code/core/Mage/Admin/Model/Observer.php
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 58.
Hunk #3 FAILED at 69.
3 out of 3 hunks FAILED -- saving rejects to file app/code/core/Mage/Admin/Model/Observer.php.rej
patching file app/code/core/Mage/Core/Controller/Request/Http.php
Hunk #1 FAILED at 76.
Hunk #2 FAILED at 530.
2 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Request/Http.php.rej
patching file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
Hunk #1 FAILED at 55.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php.rej
patching file lib/Varien/Db/Adapter/Pdo/Mysql.php
Hunk #1 FAILED at 2672.
1 out of 1 hunk FAILED -- saving rejects to file lib/Varien/Db/Adapter/Pdo/Mysql.php.rej
From what I've seen this is due to line endings, but I've double checked these and they are Unix. Has anyone come across this before is it something to do with nginx? Any advise would be great!
Thanks
I have run into this issue on a couple of patches. My solution was to just grab the files from a fresh copy of Magento, replace the modified files, and then apply the patch.
This should work fine so long as the modifications to those files are trivial (such as line ending issues). You should verify that there haven't been actual changes to the functionality of those core files.
Alternatively, you can find the already patched files here:
http://magentary.com/kb/apply-supee-5344-and-supee-1533-without-ssh/
You could just upload those over FTP. Personally I think it is better to use the shell patch as it is easy to roll back if something goes wrong.

Installing new patch in magento

I have this patch in Magento which is patch.sh and I want to run this file and execute it. I logged in and tried to install using SSH way. I'm using PUTTY. When I run the patch.sh file I encountered an error, and I don't know how to fix it. Here is the error message:
ERROR: Patch can't be applied/reverted successfully.
patching file app/code/core/Mage/Admin/Model/Observer.php
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 62.
Hunk #3 FAILED at 73.
3 out of 3 hunks FAILED -- saving rejects to file app/code/core/Mage/Admin/Model/Observer.php.rej
patching file app/code/core/Mage/Core/Controller/Request/Http.php
Hunk #1 FAILED at 76.
Hunk #2 FAILED at 541.
2 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Request/Http.php.rej
patching file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
Hunk #1 FAILED at 55.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php.rej
patching file app/code/core/Mage/XmlConnect/Model/Observer.php
Hunk #1 FAILED at 143.
Hunk #2 FAILED at 160.
2 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/XmlConnect/Model/Observer.php.rej
patching file lib/Varien/Db/Adapter/Pdo/Mysql.php
Hunk #1 FAILED at 2834.
1 out of 1 hunk FAILED -- saving rejects to file lib/Varien/Db/Adapter/Pdo/Mysql.php.rej
How should I fix it or where should I start to debug the problem?
Either your Magento installation is already patched, or you have modifications in core files (app/code/core/Mage/Admin/Model/Observer.php for example and so on).
The solution is to compare your current files with original files from Magento distribution and understand why your files got changed.
If you believe there should be no any changes in core files, you can simply replace app/code/core/Mage/Admin/Model/Observer.php, app/code/core/Mage/Core/Controller/Request/Http.php and so on with original files from corresponding Magento distribution and re-run the patch.
Try on your /var/www magento root
rm -rf var/cache var/session
chmod 550 ./mage
./mage mage-setup .

FreeBSD make error File 5.19 supports only version 12 magic files. /usr/share/misc/magic.mgc is version 8

I'm having trouble reinstalling ProFTPD on a FreeBSD 10.1 setup. The server is newly upgraded from 10.0 to 10.1. When I start the make install clean process, these warnings first shows on screen.
===> proftpd-1.3.5_4 depends on shared library: libpcre.so
/usr/share/misc/magic, 93: Warning: Printf format `l' is not valid for type `lelong' in description `, %ld pages'
...
/usr/share/misc/magic, 15118: Warning: Printf format `l' is not valid for type `belong' in description `Volume %ld,'
/usr/share/misc/magic, 15609: Warning: Current entry does not yet have a description for adding a MIME type
file: File 5.19 supports only version 12 magic files. `/usr/share/misc/magic.mgc' is version 8
[: =: unexpected operator
- not found
And after i while, the make process stops with this error:
/bin/ln -s libpcre.so.1 /usr/ports/devel/pcre/work/stage/usr/local/lib/libpcre.so.3
====> Compressing man pages (compress-man)
===> Installing for pcre-8.35_2
===> Checking if pcre already installed
===> pcre-8.35_2 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pcre
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/ftp/proftpd
*** Error code 1
Stop.
make: stopped in /usr/ports/ftp/proftpd
Seems that the file /usr/share/misc/magic.mgc is of a wrong version?
This might happens when I was upgrading from 10.0-RELEASE-p12 to 10.1-RELESE-p1?
If i run make install clean of the ProFTP port, and disable support for pcre, the process and install is successful.
But I believe that something is still broken?
My programming skills are limited, and also this level of error.
Please let me know if you have any ideas,
Thanks,
First of all, proftpd 1.3.5 is available as a binary package, it's much simpler to install it that way (pkg install proftpd).
Second - at first it looked like a port bug; as Etan said, there is a shell syntax error (something like '[ x == y ]' instead of '[ x = y ]'); those are common, and ports contain patches to fix those. However, there is a binary package, and packages are built from ports ("make package"), so port obviously does work on package build machines. So it's probably something specific to your environment.
If you really want to build from ports, try this: first, reinstall pcre. For some reason it had to be rebuilt, but failed to install, because it's already installed. So, "cd /usr/ports/*/pcre && make clean all deinstall reinstall". That should get rid of the second error. Then go back to "../*/proftpd" and see how far it goes.
But really, I'd try packages first. They have nothing in common with old pkg_add system, and are really nice.
freebsd-update diff for FreeBSD-SA-14:28.file seems wrong, and it breaks file(1).
Therefore simply pkg install file will be a workaround.

Resources