You are not logged in.

#1 2005-10-01 00:48:29

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

quick fix for libtool slay changes

Nearly all my PKGBUILDs conclude with the code:

}
# vim:syntax=sh

So, to save time, I want to quickly sed in the libtool slay command:

find $startdir/pkg -name '*.la' -exec rm {} ;
sed -i "s|}|find $startdir/pkg -name '*\.la' -exec rm {} \;n}|g" PKGBUILD 

Seems to work ok but I can't get it to match the vim line too - any suggestions or alternative ideas?

Offline

#2 2005-10-01 02:06:10

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: quick fix for libtool slay changes

why does it need to match the vim line? you are replacing 1 character with a string of different ones..

you might want to use something like..

sed -i "s|^[ ]*}[ ]*$||find $startdir/pkg -name '*\.la' -exec rm {} \;n}n|g" PKGBUILD

I'm not sure if the } needs escaping, as it can be a closure for a conditional count, such as  x{0,2}.

/me shrugs


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-10-01 09:34:25

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: quick fix for libtool slay changes

I want to match the vim line and the { as otherwise it will just hunt down ALL the {, right?  Which would be bad...

Offline

#4 2005-10-01 10:05:19

awalk
Member
From: Perth, Western Australia
Registered: 2005-02-14
Posts: 40

Re: quick fix for libtool slay changes

I think this is what you want, right?

sed -e 'N' -e 's|}n(# vim:syntax=sh$)|somethingorrather;n}n1|g' blah

Unless you tell sed otherwise, it'll match one line at a time. That's my understanding anyway...

Offline

#5 2005-10-02 12:16:55

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: quick fix for libtool slay changes

Yeah, it "works" but it just seens to demo it!

sed -e 'N' -e 's|}n(# vim:syntax=sh$)|  find $startdir/pkg -name '*\.la' -exec rm {} \;n}n1|g' PKGBUILD

I need to add a -i right?

sed -i -e 'N' -e 's|}n(# vim:syntax=sh$)|  find $startdir/pkg -name '*\.la' -exec rm {} \;n}n1|g' PKGBUILD

Offline

#6 2005-10-02 12:30:05

awalk
Member
From: Perth, Western Australia
Registered: 2005-02-14
Posts: 40

Re: quick fix for libtool slay changes

Yah, sorry. You need the '-i' flag for in-place transformation. Otherwise it just spits out the transformed text to stdout.

Offline

#7 2005-10-03 16:22:52

alterkacker
Member
From: Peoples Republic of Boulder
Registered: 2005-01-08
Posts: 52

Re: quick fix for libtool slay changes

You could also use the sed 'i'nsert command as in:

sed -i -e "$ifind $startdir/pkg -name '*.la' -exec rm {} \;" PKGBUILD

where the first '$' means go to the last line & the 'i' means insert before.

I admit that I have rarely used the sed 'i'nsert & 'a'ppend commands so this didn't exactly spring to my fingertips but it seemed a good excuse to re-read the man page and avoid more productive work!  wink

Offline

#8 2005-10-03 16:34:29

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: quick fix for libtool slay changes

ummm why not add it to makepkg? one line change - problem solved

Offline

#9 2005-10-03 19:51:03

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: quick fix for libtool slay changes

Well, Mr Phrakture, if you read the mailing list you would know that I already suggested that AND provided the patch and then was told why that was a bad idea tongue wink

Offline

#10 2005-10-03 22:19:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: quick fix for libtool slay changes

dibblethewrecker wrote:

Well, Mr Phrakture, if you read the mailing list you would know that I already suggested that AND provided the patch and then was told why that was a bad idea tongue wink

i'm on too many mailing lists, I try not to read everything... I'm just saying - why not do it to your own makepkg?

Offline

#11 2005-10-03 22:21:31

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: quick fix for libtool slay changes

Well, yeah, you could, but if that is not standard then you still need have it in your PKGBUILDs if other people might be using them...which they invariably are in my case smile

Offline

#12 2005-10-03 22:25:41

sweiss
Member
Registered: 2004-02-16
Posts: 635

Re: quick fix for libtool slay changes

Wouldn't it be easier to accomplish with Python? I never liked sed much.

Offline

#13 2005-10-03 22:50:50

Theoden
Member
Registered: 2005-03-03
Posts: 240

Re: quick fix for libtool slay changes

I don't mean to sound as ignorant as I am :?: , but this whole subject is still confusing to me.  Is there a concise yet understandable exposition of the problem somewhere I can read?  I'm afraid I don't fully understand what the problem is and what we are trying to accomplish here.

Thanks,

--Theoden   :?


"If builders built buildings the way programmers write programs,
the first woodpecker that came along would destroy civilization."

Offline

#14 2005-10-04 00:46:18

Benedict_White
Member
From: Sussex, UK
Registered: 2004-05-27
Posts: 331
Website

Re: quick fix for libtool slay changes

have you tried a two step approach?

Test for your vim line, if there remove, and perform the chanege, then replace, if not then just perform the change?

I know regular expressions are meant to implement virtualy a whole OS one one line, but hey, some times you might need two or three big_smile


Kind regards

Benedict White

Offline

#15 2005-10-04 01:16:36

Theoden
Member
Registered: 2005-03-03
Posts: 240

Re: quick fix for libtool slay changes

dibblethewrecker:

I read thru the logs for #archlinux and your explanation.  Thanks.  Now I have a couple questions:

1.  Do we need to remove any .la  files already existing on the local system?

2.  My system has the following .la files on it:

/var/abs/x11/xorg/libGL.la
/lib/libshadow.la
/usr/lib/libfam.la
/usr/lib/libalsatoss.la
/usr/lib/libaoss.la
/usr/lib/libossredir.la
/usr/lib/libgnutls.la
/usr/lib/libgnutls-extra.la
/usr/lib/libgnutls-openssl.la
/usr/lib/sasl2/libsasldb.la
/usr/lib/sasl2/libcrammd5.la
/usr/lib/sasl2/libdigestmd5.la
/usr/lib/sasl2/libotp.la
/usr/lib/sasl2/libgssapiv2.la
/usr/lib/sasl2/libplain.la
/usr/lib/sasl2/libanonymous.la
/usr/lib/sasl2/liblogin.la
/usr/lib/librep/rep/i686-pc-linux-gnu/gui/gtk-2/types.la
/usr/lib/librep/rep/i686-pc-linux-gnu/gui/gtk-2/gtk.la
/usr/lib/librep/rep/i686-pc-linux-gnu/gui/gtk-2/libglade.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/io/db/sdbm.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/io/db/gdbm.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/io/timers.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/io/readline.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/io/sockets.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/i18n/gettext.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/data/tables.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/lang/record-profile.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/vm/safe-interpreter.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/util/md5.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/rep/ffi.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/gettext.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/readline.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/gdbm.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/sdbm.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/tables.la
/usr/lib/librep/rep/0.17/i686-pc-linux-gnu/timers.la
/usr/lib/libsasl2.la
/usr/lib/librep.la
/usr/local/lib/vsound/libvsound.la
/usr/libexec/sudo_noexec.la
/home/software/compile/vsound-0.6/.libs/libvsound.la
/home/software/compile/vsound-0.6/libvsound.la
/opt/gnome/lib/bonobo/libnautilus-audio-properties-view.la
/opt/gnome/lib/gnome-stones/objects/libgnome-stones.la
/opt/gnome/lib/gnome-stones/objects/libgnomekoban.la
/opt/gnome/lib/libgnomecupsui-1.0.la
/opt/gnome/share/xmodmap/xmodmap.la
/opt/kde/lib/libmcop.la
/opt/kde/lib/libsoundserver_idl.la
/opt/kde/lib/libgmcop.la
/opt/kde/lib/libartsflow.la
/opt/kde/lib/libmcop_mt.la
/opt/kde/lib/libartsdsp_st.la
/opt/kde/lib/libkmedia2_idl.la
/opt/kde/lib/libartsflow_idl.la
/opt/kde/lib/libartscbackend.la
/opt/kde/lib/libartsc.la
/opt/kde/lib/libartsdsp.la
/opt/kde/lib/libqtmcop.la
/opt/kde/lib/libx11globalcomm.la
/opt/kde/lib/libartsgslplayobject.la
/opt/kde/lib/libartswavplayobject.la
/opt/kde/lib/libkmedia2.la
/opt/kde/lib/kde3/dcopserver.la
/opt/kde/lib/kde3/kded_kdetrayproxy.la
/opt/kde/lib/kde3/kded_kpasswdserver.la
/opt/kde/lib/kde3/kio_uiserver.la
/opt/kde/lib/kde3/kded_proxyscout.la
/opt/kde/lib/kde3/kded_kssld.la
/opt/kde/lib/kde3/kded_kwalletd.la
/opt/kde/lib/kde3/knotify.la
/opt/kde/lib/kde3/kconf_update.la
/opt/kde/lib/kde3/kded.la
/opt/kde/lib/kde3/kbuildsycoca.la
/opt/kde/lib/kde3/kio_help.la
/opt/kde/lib/kde3/kio_ghelp.la
/opt/kde/lib/kde3/kimg_eps.la
/opt/kde/lib/kde3/kimg_xview.la
/opt/kde/lib/kde3/kimg_tiff.la
/opt/kde/lib/kde3/kimg_ico.la
/opt/kde/lib/kde3/kimg_jp2.la
/opt/kde/lib/kde3/kimg_pcx.la
/opt/kde/lib/kde3/kimg_tga.la
/opt/kde/lib/kde3/kimg_rgb.la
/opt/kde/lib/kde3/kimg_xcf.la
/opt/kde/lib/kde3/kimg_dds.la
/opt/kde/lib/kde3/kimg_exr.la
/opt/kde/lib/kde3/kimg_psd.la
/opt/kde/lib/kde3/kio_file.la
/opt/kde/lib/kde3/kded_kcookiejar.la
/opt/kde/lib/kde3/kcookiejar.la
/opt/kde/lib/kde3/kio_http.la
/opt/kde/lib/kde3/kio_http_cache_cleaner.la
/opt/kde/lib/kde3/kio_ftp.la
/opt/kde/lib/kde3/kgzipfilter.la
/opt/kde/lib/kde3/kbzip2filter.la
/opt/kde/lib/kde3/kio_metainfo.la
/opt/kde/lib/kde3/kcm_kresources.la
/opt/kde/lib/kde3/kstyle_plastik_config.la
/opt/kde/lib/kde3/plugins/styles/plastik.la
/opt/kde/lib/kde3/plugins/styles/highcolor.la
/opt/kde/lib/kde3/plugins/styles/highcontrast.la
/opt/kde/lib/kde3/plugins/styles/light.la
/opt/kde/lib/kde3/plugins/styles/kthemestyle.la
/opt/kde/lib/kde3/plugins/styles/keramik.la
/opt/kde/lib/kde3/plugins/designer/kdewidgets.la
/opt/kde/lib/kde3/libkcertpart.la
/opt/kde/lib/kde3/klauncher.la
/opt/kde/lib/kde3/kded_kdeprintd.la
/opt/kde/lib/kde3/libkdeprint_management_module.la
/opt/kde/lib/kde3/kaddprinterwizard.la
/opt/kde/lib/kde3/kdeprint_lpdunix.la
/opt/kde/lib/kde3/cupsdconf.la
/opt/kde/lib/kde3/kdeprint_cups.la
/opt/kde/lib/kde3/kdeprint_lpr.la
/opt/kde/lib/kde3/kdeprint_rlpr.la
/opt/kde/lib/kde3/kdeprint_ext.la
/opt/kde/lib/kde3/kdeprint_tool_escputil.la
/opt/kde/lib/kde3/kabcformat_binary.la
/opt/kde/lib/kde3/kabc_file.la
/opt/kde/lib/kde3/kabc_dir.la
/opt/kde/lib/kde3/kabc_net.la
/opt/kde/lib/kde3/kabc_ldapkio.la
/opt/kde/lib/kde3/kspell_aspell.la
/opt/kde/lib/kde3/kspell_ispell.la
/opt/kde/lib/kde3/kcmshell.la
/opt/kde/lib/kde3/kjavaappletviewer.la
/opt/kde/lib/kde3/libkhtmlpart.la
/opt/kde/lib/kde3/khtmlimagepart.la
/opt/kde/lib/kde3/libkmultipart.la
/opt/kde/lib/kde3/libshellscript.la
/opt/kde/lib/kde3/kfileaudiopreview.la
/opt/kde/lib/kde3/libkatepart.la
/opt/kde/lib/kde3/ktexteditor_isearch.la
/opt/kde/lib/kde3/libgstreamerpart.la
/opt/kde/lib/kde3/ktexteditor_insertfile.la
/opt/kde/lib/kde3/ktexteditor_kdatatool.la
/opt/kde/lib/kde3/ktexteditor_docwordcompletion.la
/opt/kde/lib/kde3/libkaffeinepart.la
/opt/kde/lib/libDCOP.la
/opt/kde/lib/libkdeinit_dcopserver.la
/opt/kde/lib/libkdefx.la
/opt/kde/lib/libkdefakes.la
/opt/kde/lib/libkdecore.la
/opt/kde/lib/libkdeui.la
/opt/kde/lib/libkspell.la
/opt/kde/lib/libkdesu.la
/opt/kde/lib/libkjs.la
/opt/kde/lib/libkwalletclient.la
/opt/kde/lib/libkwalletbackend.la
/opt/kde/lib/libkio.la
/opt/kde/lib/libkdeinit_kio_uiserver.la
/opt/kde/lib/libkdesasl.la
/opt/kde/lib/libkntlm.la
/opt/kde/lib/libartskde.la
/opt/kde/lib/libkdnssd.la
/opt/kde/lib/libkdeinit_kconf_update.la
/opt/kde/lib/libkdeinit_kded.la
/opt/kde/lib/libkdeinit_kbuildsycoca.la
/opt/kde/lib/libkdeinit_kcookiejar.la
/opt/kde/lib/libkdeinit_kio_http_cache_cleaner.la
/opt/kde/lib/libknewstuff.la
/opt/kde/lib/libkparts.la
/opt/kde/lib/libkresources.la
/opt/kde/lib/libkutils.la
/opt/kde/lib/libkmid.la
/opt/kde/lib/libkscreensaver.la
/opt/kde/lib/libkdeinit_klauncher.la
/opt/kde/lib/libkdeprint.la
/opt/kde/lib/libkdeprint_management.la
/opt/kde/lib/libkdeinit_kaddprinterwizard.la
/opt/kde/lib/libkdeinit_cupsdconf.la
/opt/kde/lib/libvcard.la
/opt/kde/lib/libkabc.la
/opt/kde/lib/libkabc_file.la
/opt/kde/lib/libkabc_dir.la
/opt/kde/lib/libkabc_net.la
/opt/kde/lib/libkabc_ldapkio.la
/opt/kde/lib/libkspell2.la
/opt/kde/lib/libkmdi2.la
/opt/kde/lib/libkmdi.la
/opt/kde/lib/libkdeinit_kcmshell.la
/opt/kde/lib/libkjava.la
/opt/kde/lib/libkhtml.la
/opt/kde/lib/libktexteditor.la
/opt/kde/lib/libkmediapart.la
/opt/kde/lib/libkscript.la
/opt/kde/lib/libkmediaplayer.la
/opt/kde/lib/libkimproxy.la
/opt/kde/lib/libkatepartinterfaces.la

    Do I need to remove these?

3.  If so - is there any special method? or will just 'rm'ing' them do it?

Regards,

--Theoden   smile


"If builders built buildings the way programmers write programs,
the first woodpecker that came along would destroy civilization."

Offline

#16 2005-10-04 02:00:35

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: quick fix for libtool slay changes

Theoden: Some packages, like KDE, needs the *.la files otherwise they don't work.  I would suggest keeping them on your system.  Unless you build packages, you don't need to be concerned about them.

Offline

#17 2005-10-04 02:13:30

Theoden
Member
Registered: 2005-03-03
Posts: 240

Re: quick fix for libtool slay changes

Snowman wrote:

Theoden: Some packages, like KDE, needs the *.la files otherwise they don't work.  I would suggest keeping them on your system.  Unless you build packages, you don't need to be concerned about them.

Yeah - I suppose.  But I do build pkgs for arch fairly frequently, so knowing which ones to remove so I can avoid problems would be nice.   big_smile

--Theoden


"If builders built buildings the way programmers write programs,
the first woodpecker that came along would destroy civilization."

Offline

#18 2005-10-04 04:08:06

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: quick fix for libtool slay changes

You can put a:

find $startdir/pkg -name '*.la' -exec rm {} ;

at the end of the PKGBUILD to remove the *.la and check if the apps sill works without his *.la files.

Most users have error like "can't find libfoo.la" on build time. In this case you need to find the .la file on your system that refers to libfoo.la and  to recompile the package it belongs to against the libtool-slayed packages. I never had any issue with *.la files yet but that's how I understand the procedure.
HTH.

Offline

Board footer

Powered by FluxBB