You are not logged in.
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
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
I want to match the vim line and the { as otherwise it will just hunt down ALL the {, right? Which would be bad...
Offline
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
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
Yah, sorry. You need the '-i' flag for in-place transformation. Otherwise it just spits out the transformed text to stdout.
Offline
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!
Offline
ummm why not add it to makepkg? one line change - problem solved
Offline
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
Offline
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
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
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
Offline
Wouldn't it be easier to accomplish with Python? I never liked sed much.
Some PKGBUILDs: http://members.lycos.co.uk/sweiss3
Offline
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
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
Kind regards
Benedict White
Offline
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
"If builders built buildings the way programmers write programs,
the first woodpecker that came along would destroy civilization."
Offline
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
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.
--Theoden
"If builders built buildings the way programmers write programs,
the first woodpecker that came along would destroy civilization."
Offline
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