Discussion:
%post script weirdness
Kory Hansen
2007-08-08 19:07:03 UTC
Permalink
In my spec file I have a %post script to create a .desktop file using a
here doc. It creates the file but the file name has a ^M at the end, so
it doesn't show up in the menu. My script looks like this:



%post

cat <<EOF > /usr/share/applications/mycompany-myapp.desktop

[Desktop Entry]

Version=x.y

Encoding=UTF-8

Name=MyApp

Path=$RPM_INSTALL_PREFIX/myapp

...

EOF



Any ideas why it is adding the ^M?
Jeff Johnson
2007-08-08 19:16:58 UTC
Permalink
Post by Kory Hansen
Any ideas why it is adding the ^M?
rpm is not "adding" ^M, it's not deleting ^M's for you.

The spec file has embedded ^M characters.

Verify whether that is true, eliminate in the spec file.

73 de Jeff
Kory Hansen
2007-08-08 19:29:24 UTC
Permalink
Post by Jeff Johnson
rpm is not "adding" ^M, it's not deleting ^M's for you.
The spec file has embedded ^M characters.
Verify whether that is true, eliminate in the spec file.
I thought that too, but I am editing the spec file with vi. I even did
a search of the spec file for ^M characters.
R***@ubs.com
2007-08-08 19:32:53 UTC
Permalink
In general if you create a file in DOS and copy on to unix OS, it will
add ^M characters, run dos2unix filename >filename1 to remove ^M
characters at the end lines.

-----Original Message-----
From: rpm-list-***@redhat.com [mailto:rpm-list-***@redhat.com]
On Behalf Of Kory Hansen
Sent: Wednesday, August 08, 2007 3:29 PM
To: RPM Package Manager
Subject: RE: %post script weirdness
Post by Jeff Johnson
rpm is not "adding" ^M, it's not deleting ^M's for you.
The spec file has embedded ^M characters.
Verify whether that is true, eliminate in the spec file.
I thought that too, but I am editing the spec file with vi. I even did
a search of the spec file for ^M characters.

_______________________________________________
Rpm-list mailing list
Rpm-***@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
Luciano Rocha
2007-08-08 19:33:59 UTC
Permalink
Post by Kory Hansen
Post by Jeff Johnson
rpm is not "adding" ^M, it's not deleting ^M's for you.
The spec file has embedded ^M characters.
Verify whether that is true, eliminate in the spec file.
I thought that too, but I am editing the spec file with vi. I even did
a search of the spec file for ^M characters.
vi detects the EOL style used by the file and adapts to it. Run the
command: set fileformat=unix, and save.

Or, tr -d '\r' < spec > spec.new
--
lfr
0/0
Kory Hansen
2007-08-08 19:57:19 UTC
Permalink
Post by Luciano Rocha
vi detects the EOL style used by the file and adapts to it. Run the
command: set fileformat=unix, and save.
Or, tr -d '\r' < spec > spec.new
I tried both commands, and the rpm works great now. Thanks everyone!
Loading...