Remove line from patch script - patch

When I run a patch it fails on one of the files. I would like to remove the respective line from the patch.x.x.x.sh so everything else is being patched except this file.
Hope someone can explain the procedure.
For example, I am trying to apply Patch SUPEE-10336 and get error:
[http]$ bash PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.
patching file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
patching file app/locale/en_US/Mage_Usa.csv
Hunk #1 FAILED at 99.
1 out of 1 hunk FAILED -- saving rejects to file app/locale/en_US/Mage_Usa.csv.rej
I would like to edit the PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh so I remove the line from the patch that's responsible for this file.

I can't see anyone interested in this question but I thought I post the answer to it anyway.
If you open the patch in any text editor, and find the section __PATCHFILE_FOLLOWS__ that's where the files are being merged using diff command. In make case it was the `Mage_Usa.csv" file was causing the problem so I found the part of the patch responsible for this file:
diff --git app/locale/en_US/Mage_Usa.csv app/locale/en_US/Mage_Usa.csv
index 072170d..5e8f844 100644
--- app/locale/en_US/Mage_Usa.csv
+++ app/locale/en_US/Mage_Usa.csv
## -99,7 +99,7 ##
"First-Class Mail Large Envelope","First-Class Mail Large Envelope"
"First-Class Mail Large Postcards","First-Class Mail Large Postcards"
"First-Class Mail Letter","First-Class Mail Letter"
-"First-Class Mail Parcel","First-Class Mail Parcel"
+"First-Class Package Service - Retail","First-Class Package Service - Retail"
"First-Class Mail Postcards","First-Class Mail Postcards"
"First-Class Package International Service","First-Class Package International Service"
"First-Class Package Service","First-Class Package Service"
I have deleted this whole section of the patch and re-run it is SSH.
This time:
[http]$ bash PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.
I have manually changed the USPS names in file Mage_Usa.csv (The part of the patch that I deleted).

Related

Error with install.packages using renv|knit|rmarkdown

I'm updating the renv folder from a project in order to adjust the libraries, but it seems I'm having a permission problem. After running renv::init() and trying to installing manually the remaining libraries using install.packages() I always get the message
Error: failed to retrieve 'https://cran.rstudio.com/bin/windows/contrib/4.2/ipeadatar_0.1.6.zip' [error code 23]
1: curl: (23) Failure writing output to destination
2: curl: (23) Failure writing output to destination
Using .libPath() I can see that the renv was created in the "AppData" hidden folder
1] "C:/Users/André Ferreira/AppData/Local/R/cache/R/renv/library/MacroBRA_Wrld-09789847/R-4.2/x86_64-w64-mingw32"
So checking my permissions, I couldn't see anything wrong. Any thoughts about this problem? The thing it's that when I open my .Rmd file and try to knit, I receive the same message "1: curl: (23) Failure writing output to destination", now from rmarkdown retrieve installation, so it may be a configuration/permission problem.
Adding "C:\rtools42\usr\bin" and "C:\Program Files\R\R-4.2.1\bin" in the environment variable didn't help.
As I could see, opening an empty file from rstudio, I could use install.packages() without problem.
Although this doesn't solve the problem directly, you can also instruct renv to use a different library path with something like:
# use a project-local library path
RENV_PATHS_LIBRARY = renv/library
in your project's .Renviron file. Depending on your environment, you might also consider placing the library path in an alternate location.
See https://rstudio.github.io/renv/articles/packages.html#r-cmd-build-and-the-project-library for more details.

nbsphinx causes build to fail when building Jupyter Notebooks

Details
I am getting a build failure of my read-the-docs that I don't understand. The assertion of "verbatim" in line 2151 of nbsphinx.py is causing the build failure. So the build fails when I try to include the Jupyter Notebook tutorials I created. I compared current versions of the tutorials to previous versions which had not caused the build to fail, and I can't find a difference that could account for the current failure.
Read the Docs project URL: lofti_gaia
Build URL: https://github.com/logan-pearce/lofti_gaia
Read the Docs username: logan-pearce
Expected Result
A passing build including *.ipynb files
Actual Result
Build failed at line 2151 of nbsphinx.py due to assertion of 'Verbatim' failing.
Terminal output:
Running Sphinx v4.1.2
loading translations [en]... done
making output directory... done
WARNING: html_static_path entry '_static' does not exist
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing lofti_gaia.tex... index installation tutorials/QuickStart tutorials/Tutorial api lofti loftitools
resolving references...
done
writing... failed
Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/lofti-gaia/conda/latest/lib/python3.7/site-packages/nbsphinx.py", line 2151, in depart_codearea_latex
assert 'Verbatim' in lines[0]
AssertionError
The full traceback has been saved in /tmp/sphinx-err-x1h83s3m.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
According to the github issue 584 for nbsphinx (https://github.com/spatialaudio/nbsphinx/issues/584), this is due to a compatibility issue with sphinx 4.1.0. It can be gotten around by requiring sphinx version 4.0.2.
So in my requirements.txt file, I included sphinx==4.0.2, after which the build passes. So now my requirements.txt file looks like:
numpy
matplotlib
astropy>=4.0.1.post1
astroquery>=0.4
sphinx==4.0.2
ipython==7.19.0
nbsphinx>=0.8.6
and the build passes.
I have encountered the same issue. I did not solve it with .ipynb format, but converting the jupyter notebook to .rst format works.
May it helps

Firebase error: symbolFileMappings:upsert: The uploaded file is not a valid Breakpad Symbol file

I am trying to upload a dSYM file to Firebase using this command:
./Pods/FirebaseCrash/batch-upload -i ./Info.plist -p ./GoogleService-Info.plist ./service-accounts/mtb.json 78*****C-5**4-3***-***C-00*********7
But each time I run this, I get back the following errors
./Pods/FirebaseCrash/upload-sym-util.bash:377: error: symbolFileMappings:upsert: The uploaded file is not a valid Breakpad Symbol file.
./Pods/FirebaseCrash/upload-sym-util.bash:378: note: symbolFileMappings:upsert: The metadata for the symbol file failed to update.
I have tried this link https://groups.google.com/forum/#!msg/firebase-talk/4829Sp1_uKY/IEC_T4-VBAAJ but haven't had any luck as it errors out to
usage: batch-upload [-hv] [-p google-service] [-i info] service-account-file {mach-o file|uuid}
Can someone help me on this one please?
Thanks
Apparently this bug relates to batch-upload script having problems with archives, so you would need to patch it manually.
Try the following:
Change extract_symbols_and_upload "$EXE" "$ARCH" "$BUNDLE" to
extract_symbols_and_upload "$EXE" "$ARCH" "$BUNDLE/$BNDL_PATH"
The dump_syms utility understands dSYM bundles but not archives,
curiously enough. This fix will go out with the next release.
Source

Configuring Nexus 3 (3.0m7) to run as a Linux Service

Can anyone help me translate the instructions for setting this up as a Linux Service (at http://books.sonatype.com/nexus-book/3.0/reference/install.html#service-linux) into English?
After following them as best I could, I get the following when starting the service:
su: user / does not exist
Here are the parts of the instructions which were unclear:
In the bin/nexus script remove the line below.
INSTALL4J_JAVA_PREFIX="su - $run_as_user -c"
The line in the file is actually
INSTALL4J_JAVA_PREFIX=""
but ok, I can remove that. However, the next instruction is:
Replace the entire link with this line:
exec su - $run_as_user "$prg_dir/$progname" $#
What is meant by "the entire link"? The thing I removed above? That was the first line in the file - therefore the three variables above have not yet been set.... and is probably the reason the script currently fails.
I'll get the book fixed, it shouldn't have this in it anymore.
Download the 3.0 release, this was just a bug in 3.0m7, and it has been fixed. You don't need to make these changes.
https://support.sonatype.com/hc/en-us/articles/217965118
The only things you need to do is edit $NEXUS_HOME/bin/nexus.rc, uncomment the run_as_user line, and set the value for it appropriately. Then just symlink $NEXUS_HOME/bin/nexus to /etc/init.d/nexus, and after that run chkconfig or update-rc.d depending on your Linux version.

What is a swap file?

Using vi I started editing a html file and I accidentally exited out of session, now when I try to edit the file again I receive this message :
E325: ATTENTION Found a swap file by the name ".myfile.swp" While
opening file "myfile.html"
dated: Tue Jul 3 09:55:39 2012
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r myfile.html"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".myfile.html.swp"
to avoid this message.
Swap file ".myfile.html.swp" already exists!
Has any damage occured to myfile.html ?
What I think is occuring is that its storing a copy of the opened file when I exited my session (the swap file) ?
From the Vim documentation:
Vim stores the things you changed in a swap file. Using the original
file you started from plus the swap file you can mostly recover your
work.
The documentation also describes the recovery procedure in case you need it.

Resources