Help with sed in a PKGBUILD

Basically, I need to make a few modifications to a conf file but I am no good with sed.  Here is a portion of the original conf file:
our %HTTP_LOG = ("Linux-RHFC" => "/var/log/httpd/access_log",
"Linux-Debian" => "/var/log/apache2/access.log",
"Linux-Gentoo" => "/var/log/apache2/access_log",
"Linux-Slack" => "/var/log/httpd/access.log",
"Linux-SuSE" => "/var/log/apache2/access_log",
"Linux-Generic" => "/var/log/httpd/access_log",
"FreeBSD" => "/var/log/httpd-access.log");
our %BASE_WWW = ("Linux-RHFC" => "/var/www/html",
"Linux-Debian" => "/var/www",
"Linux-Gentoo" => "/var/www/localhost/htdocs",
"Linux-Slack" => "/var/www/htdocs",
"Linux-SuSE" => "/srv/www/htdocs",
"Linux-Generic" => "/usr/local/www",
"FreeBSD" => "/usr/local/www/apache22/data");
I need to make two changes:
1) change the .log to _log in the following:
"Linux-Slack"   => "/var/log/httpd/access.log",
2) change the path from "/var/www/htdocs" to "/srv/http" in the following:
"Linux-Slack"   => "/var/www/htdocs",
Here is a model line with sed making another needed change that res wrote into the PKGBUILD:
sed '/^our $OSTYPE = "Linux-RHFC"/ s,RHFC,Slack,' < $pkgname.conf \
> $pkgdir/etc/$pkgname.conf
Basically, I can't adapt his line to do what I need.  Anyone willing to help me out?  BTW, this is for the monitorix PKGBUILD in the AUR: http://aur.archlinux.org/packages.php?ID=33911
Last edited by graysky (2010-01-26 21:35:28)

CommandLine: (Combined)
sed '/ *"Linux-Slack"/{ s=/var/www=/srv/http=; s=log=_log= }' < infile > outfile
Output:
our %HTTP_LOG = ("Linux-RHFC"   => "/var/log/httpd/access_log",
                "Linux-Debian"  => "/var/log/apache2/access.log",
                "Linux-Gentoo"  => "/var/log/apache2/access_log",
                "Linux-Slack"   => "/var/_log/httpd/access.log",
                "Linux-SuSE"    => "/var/log/apache2/access_log",
                "Linux-Generic" => "/var/log/httpd/access_log",
                "FreeBSD"       => "/var/log/httpd-access.log");
our %BASE_WWW = ("Linux-RHFC"   => "/var/www/html",
                "Linux-Debian"  => "/var/www",
                "Linux-Gentoo"  => "/var/www/localhost/htdocs",
                "Linux-Slack"   => "/srv/http/htdocs",
                "Linux-SuSE"    => "/srv/www/htdocs",
                "Linux-Generic" => "/usr/local/www",
                "FreeBSD"       => "/usr/local/www/apache22/data");
Don't try to write to the original file using this approach as it will clobber your original file. Use "sed -i" to save to the original file instead. The "< infile > outfile" save the output to another file obviously.
Sed Script: ( Invoked as sed -f whatever_you_call_the_script file )
/ *"Linux-Slack"/{
s=/var/www=/srv/http=
s=log=_log=
sed '/^our $OSTYPE = "Linux-RHFC"/ s,RHFC,Slack,' < $pkgname.conf \
                                                    > $pkgdir/etc/$pkgname.conf
This means find this regex pattern ^our $OSTYPE = "Linux-RHFC" and whatever it matches change RHFC to Slack. Take $pkgname.conf as the infile and send the output of sed to $pkgdir/etc/$pkgname.conf
Notice he used s,RHFC,Slack, and I used s=log=_log=. This is typically done if you have a lot of "/" in a file. Sed's typical replacement pattern is this s/original/changed/ but as I mentioned it becomes hard to figure out if you have something like this s/\/mnt\/usb\/somefile/\/mnt\/usb\/somename/. Sed allows you to substitute any character (except a few special ones) in place of "/" in it's replacement pattern as long as you follow through the whole command like that. So in essence these are equivalent s,RHFC,Slack,, s=RHFC=Slack=, s/RHFC/Slack/
You did say you wanted to know. Hope this is what you were looking for or at least a step in the right direction. Sorry if I bored you with the school lession.

Similar Messages

  • Need help with sed to fix migrated web site links (part II)

    I thought I had this fixed, but I didn't, so starting over:
    I'm moving my web files from one host to another, and have backed up my directory called WEB into my user downloads folder.  The site is dead simple, mostly links within the site, pages primarily text with some links to my photos posted on flickr, and a few outside links.  I want to avoid opening/replacing/saving a hundred or more files to fix the links from "http://www.old_domain_name/user/my_username" to "http://my_new_domain_name"
    A friend suggested the following scripts to do this
      mkdir fix_urls
      cd fix_urls
      cp -r <wherever>/WEB .
      cd WEB
      xargs -0 egrep -i  old_domain_name $(find * -name "*.html" -print0) > ../to_fix
      cd ..
      less to_fix
    to see what needs changing, but after I've created and moved to WEB, the xargs command results in a zero kb file called to_fix appearing in WEB, and nothing else happens....and the prompt in terminal (myusername$) doesn't reappear.
    I tried his part II anyway:
      mkdir new_web
      while read filename; do
          sed 's/\/www.old_domain_name/user/my_username/\/my_new_domain_name/' < WEB/$filename > new_web/$filename
      done
      diff -r WEB new_web > what_i_did
      less what_i_did
    and after the 'done', I get again....nothing.  No new cursor gray rectangle, no new prompt, haven't even gotten to the last bit of diff to review the changes.
    Any tips on what fundamental bone-headed thing I'm doing wrong?
    and I got this helpful answer which seemed to have solved it, but didn't entirely:
    This solved my question by X423424X  on Jul 1, 2012 1:23 AM
    I want to avoid opening/replacing/saving a hundred or more files to fix the links from "http://www.old_domain_name/user/my_username" to "http://my_new_domain_name"
    If that's all you want to do then here's the pertinent sed command to do it:
    sed -e 's,www.old_domain_name/user/my_username,my_new_domain_name,'
    Syntax is a bit simpler when you don't use slashes as the sed substitute delimiters.  You can use anything.  Here I used commas.
    I got excited too quickly after the first file I clicked looked correct--the first file in the subdirectory.
    I see no indication in terminal that the process is going or ending--no sense of when I can close terminal and move on.
    Checking the directory in finder shows no updates to 'date modified' for any of the files.
    So how do I know if it is in progress, or done working, aside from opening random files to see if they're 'done'?
    I've got three subfolders inside one folder (my WEB folder), and it looks like only the first file of the first subdirectory got repaired.

    Here is a bash script to interate through all files in a folder of a given extension.
    #!/bin/bash
    # be sure to use Unix lineends -- linefeed \n
    # Use TextWrangle for editing.  It's free.
    # http://www.barebones.com/products/TextWrangler/
    # or nano in the terminal
    # to make this file -- listFile.bash runable do:
    # chmod u+x listFile.bash
    # debug info
    export PS4='+(${BASH_SOURCE}:${LINENO}):'
    # remove the leading # in the line below to show debug info
    # set -o xtrace
    # first comes the directory/folder you want to search
    # -name do a case independent search for all file ending
    #       with the extension .txt
    find /Users/mac/Desktop/iMac -iname "*.txt" | while read file
    do
        echo
        echo "file to process is = " $file
        # replace the list command with your command.
        # You will need to place a $ in front of file
        # To avoid problems with blanks & other characters,
        # put " around $file, your variable.
        ls -l "$file"
    done
    mac $ chmod u+x /Users/mac/Desktop/listFiles.bash
    mac $ /Users/mac/Desktop/listFiles.bash
    file to process is =  /Users/mac/Desktop/iMac/bash/pdisk-l.txt
    -rw-r--r--   1 mac  staff  20915 Feb  4  2009 /Users/mac/Desktop/iMac/bash/pdisk-l.txt
    file to process is =  /Users/mac/Desktop/iMac/comments on new forum software.txt
    -rw-r--r--   1 mac  staff  1966 May 26  2011 /Users/mac/Desktop/iMac/comments on new forum software.txt
    file to process is =  /Users/mac/Desktop/iMac/hidden mac os files.txt
    -rw-r--r--   1 mac  staff  1499 Jul  1 17:01 /Users/mac/Desktop/iMac/hidden mac os files.txt
    file to process is =  /Users/mac/Desktop/iMac/key combinations.txt
    -rw-r--r--   1 mac  staff  2547 Aug 24  2011 /Users/mac/Desktop/iMac/key combinations.txt
    file to process is =  /Users/mac/Desktop/iMac/nvram -p.txt
    -rw-r--r--   1 mac  staff  1248 Feb  1  2011 /Users/mac/Desktop/iMac/nvram -p.txt
    file to process is =  /Users/mac/Desktop/iMac/reset mac Open Firmware.txt
    -rw-r--r--   1 mac  staff  7876 Jun 25 21:56 /Users/mac/Desktop/iMac/reset mac Open Firmware.txt
    mac $

  • [SOLVED] Help with updating conky-colors PKGBUILD

    I'm looking to update my PKGBUILD for https://aur.archlinux.org/packages/conky-colors/ to support the latest version.  After getting annoyed with DeviantArt replacing the zips of the package when it is updated upstream, I've decided to pull in specific commits from the git repo instead.  I'm trying to use the ...#commit= option on the source line.  It seems to be building ok but I'm getting the following errors:
    /usr/bin/makepkg: eval: line 2225: unexpected EOF while looking for matching `"'
    /usr/bin/makepkg: eval: line 2226: syntax error: unexpected end of file
    Can anyone give any help as to what may be the cause here.  If i remove the #commit it goes away.  I need to clean up the depends section to remove those that are no longer needed, but I can do that easy enough.
    # Maintainer: Android_808 <android underscore 808 at hotmail dot com>
    # Contributor: Pauline123 <321eniluap at gmail dot com>
    # Contributor: Shanto <shanto at hotmail>
    # Contributor: Piotr Rogoża <rogoza dot piotr at gmail dot com>
    pkgname=conky-colors
    _pkgname=conky_colors
    pkgver=9.0
    pkgrel=1
    pkgdesc="An easier way to configure Conky."
    arch=('i686' 'x86_64')
    url="http://gnome-look.org/content/show.php/CONKY-colors?content=92328"
    license=('GPL')
    depends=('pystatgrab' 'ttf-liberation' 'hddtemp' 'curl' 'lm_sensors' 'conky' 'ttf-droid' 'ttf-ubuntu-font-family' 'ttf-ms-fonts')
    makedepends=('perl' 'git')
    optdepends=('conky-lua')
    conflicts=('ttf-openlogos' 'ttf-weather')
    options="!strip"
    install=$pkgname.install
    source=("$pkgname::git+https://github.com/helmuthdu/conky_colors.git#commit=f4b530a94d5f3f73d4c21c4417c51b6011a71b28")
    md5sums=('SKIP')
    build() {
    cd "$srcdir/conky-colors"
    make
    package() {
    cd "$srcdir/conky-colors"
    mkdir -p ${pkgdir}/usr/share
    mkdir -p ${pkgdir}/usr/share/fonts
    mkdir -p ${pkgdir}/usr/bin
    cp -v conky-colors ${pkgdir}/usr/bin
    cp -v -r conkycolors ${pkgdir}/usr/share
    #cp -v -r fonts ${pkgdir}/usr/share/conkycolors
    cp -v -r fonts/conkycolors ${pkgdir}/usr/share/fonts/TTF
    ln -fs /usr/share/conkycolors/bin/conkyTask ${pkgdir}/usr/bin/ct
    #ln -fs /usr/share/conkycolors/fonts/conkycolors ${pkgdir}/usr/share/fonts/
    chmod +x ${pkgdir}/usr/share/conkycolors/scripts/*
    chmod +x ${pkgdir}/usr/share/conkycolors/bin/*
    chmod -R 755 ${pkgdir}/usr/share/conkycolors/
    Last edited by android_808 (2013-11-11 19:33:06)

    I didn't post the install earlier because I've never had an issue with it, been using the same file for several releases of several custom built packages.  The eval: lines posted appear before "Making package: conky-colors 9.0-1 (Mon 11 Nov 18:58:03 GMT 2013)" but doesn't prevent it from building.  Just don't get what's causing them.
    Install files "s have matching end ", brackets have brackets. namcap PKGBUILD gave no error.
    PKGBUILD ' has matching '
                     " has matching "
                     ( has matching )

  • [SOLVED] Need Help with Sed

    Since I'm a dirty TF2 idler and I use Source Tools to idle, it uses a list of servers from a servers.txt file.
    A list of idling servers is here: http://tf2stats.net/blacklist_generate/ … ourcetools
    The list is in this format:
    {IP ADDRESS}:{PORT};{SERVER NAME}
    Unfortunately, I can't just save that as the list, because it thinks you're trying to send {SERVER NAME} as a command or something.
    There's ~920 lines that are just that and so I need to remove everything AFTER the port number (so it would be the colon and the server name).
    The tricky part is that not all ports are the same. 27015 is the standard, some use 27016, and some use other ones. So I need to have a sed command to remove everything past a colon on all lines, then remove the colon on all lines.
    And since I suck at sed, I've come crawling to the forums for help. So please, help.
    Last edited by Arm-the-Homeless (2010-04-05 23:47:19)

    Procyon wrote:@brisbin33: if you're going to redefine IFS, why not to :; with while read ip port name
    true story.  IFS=$'\n'; while read -r is just a habit i fall back on when i want to read [possibly inconsistent] lines out of a file.

  • [solved] Need a little help with sed and regular expressions

    Hello!
    I am shure this is something easy for most of you
    I want to make a script, which converts filenames of my ripped MP3s (replaces '_' with spaces, removes leading track numbers...)
    But I have some problems:
    j=$(echo $j | sed 's/_\+/ /g')
    j=$(echo $j | sed 's/^[0-9]{0,3}//g')
    j=$(echo $j | sed 's/[^ ]-[^ ]/ - /g')
    j=$(echo $j | sed 's/_\+/ /g') << this is working fine (converts all "_" to spaces)
    j=$(echo $j | sed 's/^[0-9]{0,3}//g') << is NOT working, why??
    For Example in "01-somebody_feat_someone-somemusic.mp3" the leading "01" number is NOT being removed..
    j=$(echo $j | sed 's/[^ ]-[^ ]/ - /g') << how can I insert spaces before and after the "-"?
    So that "someone-somemusic" becomes "someone - somemusic" (but only where "-" is surrounded by letters)
    Last edited by cyberius (2011-07-27 18:50:54)

    For sed, you must escape { and } to use them as you want (just slap a \ before them).
    For the last expression, capture the letter before/after the dash -- use \( and \) -- and then substitute it for something like "\1 -" and then "- \1". You'll want to split this into two pieces, one for the front and one for the back so you can get "somemusic -someband" the way you want without a bunch of cases.
    Edit: Or, you could just do a replace for "-" to be " - " and then have another expression to reduce spaces. I see you've used \+ before, so I'm guessing you can figure that out
    Also, sed has the -e switch so you can do multiple different expressions with one invocation.
    Also (also), have you looked into something like Picard with automatic track renaming? You can even customize how they are renamed.
    Edit (2): Also^3, check out prename. There are different versions, ones which use PCRE and ones that use other standards, but it is for renaming files based on regular expressions, which is what you're doing. In any case, you might want to put you script into the User made scripts thread when you feel more comfortable and get some more critiquing, if you're interested.
    Last edited by jac (2011-07-26 23:13:27)

  • Help with Java program and PKGBUILD

    Hey guys, I'm fairly new to Arch and very new to making packages. I write a lot of my stuff in Java, and I know that Java is normally a pain to package on Linux systems. I have had a good look at the Java Packaging Guidelines, http://wiki.archlinux.org/index.php/Jav … Guidelines and I see that it says about not bothering compiling from Java source and just provide the JARs (am I correct?). So my question is, if I were to make a PKGBUILD for my Java based program, would the build() block just basically create the folders in the filesystem and move the content (JARs etc) to the folders? And then create the shell script in the appropriate location?
    Forgive me I have the completely wrong idea...
    Many thanks

    Hey guys, I'm fairly new to Arch and very new to making packages. I write a lot of my stuff in Java, and I know that Java is normally a pain to package on Linux systems. I have had a good look at the Java Packaging Guidelines, http://wiki.archlinux.org/index.php/Jav … Guidelines and I see that it says about not bothering compiling from Java source and just provide the JARs (am I correct?). So my question is, if I were to make a PKGBUILD for my Java based program, would the build() block just basically create the folders in the filesystem and move the content (JARs etc) to the folders? And then create the shell script in the appropriate location?
    Forgive me I have the completely wrong idea...
    Many thanks

  • Help with first PKGBUILD

    Hi there,
    I'm fairly new to Arch but I've been using linux for a good few years now. I'm trying to patch a version of Wine to fix some of the issues with source games. It's complicated a bit by the fact I'm on a 64 bit install of Arch.
    I've build myself a 32 bit chroot of the arch system and installed the required packages and compiled my nice new patched version of Wine. I've even managed to test it as Wine is good at running in situe and was pleased to get a good 20% framerate increase.
    So now I'm wanting to install the result but I'm not sure how best to go about creating a PKGBUILD or how the 64 bit / 32 bit thing will effect it.
    Any advice would be welcome.

    # Maintainer: Michael Green <[email protected]>
    pkgname=bin32-wine-source
    _pkgname32=wine-source
    pkgver=1.2
    pkgrel=1
    _pkgrel32=1
    pkgdesc="Windows API implementation and interpreter, enabling the use of Windows apps in other OSes. Contains rgb<->srgb patch for source games."
    arch=('x86_64')
    url="http://www.winehq.org/"
    license=('LGPL')
    depends=('lib32-fontconfig' 'lib32-freetype2' 'lib32-libjpeg' 'lib32-libtiff' 'lib32-libldap' 'lib32-libxslt' 'lib32-mesa' 'lib32-zlib')
    optdepends=('lib32-alsa-lib: ALSA audio driver'
    'lib32-openal: OpenAL native driver'
    'lib32-esound: EsounD audio driver'
    'lib32-nvidia-utils: Accelerated 3D with the NVIDIA binary blob video driver'
    'lib32-catalyst-utils: Accelerated 3D with the AMD/ATI binary blob video driver')
    provides=("bin32-wine=$pkgver" "bin32-wine")
    conflicts=("bin32-wine")
    source=("/chroot/home/mikey/src/wine-$pkgver/$_pkgname32-$pkgver-$_pkgrel32-i686.pkg.tar.gz")
    md5sums=(6717c23b1bee9812de57c71f2f1810a0)
    # Don't strip the package, that was already decided on packaging of the original package
    options=('!strip')
    build() {
    rm "$_pkgname32-$pkgver-$_pkgrel32-i686.pkg.tar.gz" || return 1 # Delete symbolic link to the now-extracted source that we don't want to copy
    cp -rfpP * "$pkgdir" || return 1 # Copy 32-bit files
    install -d "$pkgdir"/opt/lib32/usr/lib/
    mv "$pkgdir"/usr/lib/libwine.so* "$pkgdir"/opt/lib32/usr/lib/ || return 1
    cd "$pkgdir"/usr/bin/
    # DIRTY PKGBUILD TOUCHING YOUR /bin (force loading old LD_LIBRARY_PATH without moving wine binaries, as they seem to break)
    install -d "$pkgdir"/opt/wine/bin/ "$srcdir"/tmpscripts/
    for binfile in ${_binnames[*]}; do
    echo -e \
    '#!/bin/sh\n#wrapper for replacename\nPATH="/opt/wine/bin/:$PATH"\nLD_LIBRARY_PATH="/opt/lib32/usr/lib/:/opt/lib32/lib/:$LD_LIBRARY_PATH" linux32 /usr/bin/replacename "$@"' \
    > "$srcdir/tmpscripts/$binfile" || return 1
    sed -re "s/replacename/$binfile/" -i "$srcdir/tmpscripts/$binfile" || return 1
    install -m755 "$srcdir/tmpscripts/$binfile" "$pkgdir/opt/wine/bin/$binfile" || return 1
    done
    rm -rf "$srcdir"/tmpscripts
    # PPD fix
    mkdir -p "$pkgdir"/opt/lib32/usr/share/
    ln -s /usr/share/wine "$pkgdir"/opt/lib32/usr/share/wine || return 1
    echo "export WINELOADER=/opt/wine/bin/wine" > "$srcdir"/wine.sh || return 1
    echo '#export LD_LIBRARY_PATH="/opt/lib32/lib/:/opt/lib32/usr/lib/:$LD_LIBRARY_PATH"' >> "$srcdir"/wine.sh || return 1
    echo 'export PATH="/opt/wine/bin:$PATH"' >> "$srcdir"/wine.sh || return 1
    install -Dm755 "$srcdir"/wine.sh "$pkgdir"/etc/profile.d/wine.sh || return 1
    This is my best shot. It's based on the PKGBUILDs for the other bin32-wine variants. I've tried to make my source as similar to the one they use as possible by as chroot:
    $./configure --prefix=/usr
    $make
    $make DESTDIR=/home/mikey/src/wine-1.2/package/ install
    $cd /home/mikey/src/wine-1.2/package/
    $tar zcvf ../wine-source-1.2-1-i686.pkg.tar.gz *
    Then exiting chroot and trying makepkg on my PKGBUILD. It installs but it's giving me an error when I try to run wine:
    wine: failed to initialize: /usr/local/lib/wine/ntdll.dll.so: cannot open shared object file: No such file or directory
    I'm not sure why  this is but I suspect it's got something to do with the fact I did ./configure --prefix=/usr
    Does anyone know what it'll be?
    (edit) I've just noticed that it seems to be a more fundamental problem as it's looking for /usr/local which I didn't give it.
    (edit) OK a bit more digging around and as it turned out there were direct references to /usr/local in some of the Wine scripts that were getting installed. A find and replace with sed during the install sorted it.
    Last edited by mikeym (2010-07-25 03:11:12)

  • Help with my first PKGBUILD script [solved]

    Hi There
    I am trying to write my first PKGBUILD script and I am landing in a bit of trouble.  The script is short and is:
    #Contributor: iKevin <kellwood-at-ameritech.net>
    pkgname=fpm
    pkgver=0.60
    pkgrel=1
    pkgdesc="A password manager for gnome"
    url="http://fpm.sourceforge.net"
    license="GPL"
    depends=('xorg' 'gtk' 'glibc' 'libgnome' 'libxml2' 'glib')
    source=(http://heanet.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=(be7655d300c306c8f962f6aad0a60cc5)
    build() {
    cd $startdir/src/$pkgname-$pkgver
    ./configure --prefix=/usr
    make || return 1
    mkdir -p $startdir/pkg/usr/bin
    make prefix=$startdir/pkg/usr install
    I haven't reach the point where it compiles.  It failes to download the file.  Oddly, when I type:
    wget http://heanet.dl.sourceforge.net/source … .60.tar.gz
    it downloads fine.  When running makepkg, the contents of ./src/fpm-0.60.tar.gz is some kind of web page.
    I have eyeballed this PKGBUILD script for a while and I can't see any problems.  Is there something special about sourceforge files?  I feel that I must have a typo because makepkg is using wget, which works by hand.
    Thanks
    Kev

    Well,
    I installed kedpm with my first working PKGBUILD script.  I was able to import my "fpm" password file.  Once I get my gnucash stuff transfered into grisbi, I will be able to switch my main machine completely to archlinux.
    I know it is trivial for you guys, but here is my script -- it might save you some typing.
    Kev
    pkgname=kedpm
    pkgver=0.4.0
    pkgrel=1
    pkgdesc="Ked Password Manager helps to manage large amounts of passwords and related information"
    url="http://kedpm.sourceforge.net/"
    depends=(python pygtk pycrypto)
    makedepends=()
    conflicts=()
    replaces=()
    backup=()
    install=
    source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=('6b83a646873f8ea00af9c6403aa259bc')
    build() {
    cd $startdir
    mkdir -p pkg/usr
    cd $startdir/src/$pkgname-$pkgver
    python setup.py install --prefix=$startdir/pkg/usr

  • [SOLVED] Asking for help and reviews for a PKGBUILD (cnijfilter-mp250)

    Hi everyone,
    I recently changed the desktop pc used by my parents, and I installed Arch on it (the previous desktop was running Debian). I know that I need to install a driver to get the printer working (a Canon MP 250 Series), because I did it before with Debian.
    The driver is in the AUR:
    https://aur.archlinux.org/packages/cnijfilter-mp250/
    A user in the comment (Huulivoide) suggested that the PKGBUILD was old, but the current mantainer didn't respond, so I decided to try to update the PKGBUILD myself as a learning opportunity and as a way to give something back to the community. This is the first PKGBUILD that I modify; while I've used Arch for quite some time, I'm still a noob in many respects.
    I tried to apply all the suggestions, and I did some other things (like quoting variables) that I often see in PKGBUILDs. This is the PKGBUILD:
    # Maintainer: Alireza Savand <[email protected]>
    # Special thanks to: olive, mirrr, GUiHKX, alessiofachechi, jeremy33,
    # jstitch, plv
    pkgname=cnijfilter-mp250
    pkgver=3.40.1
    pkgrel=5.1
    _pkgrealver=3.40
    _pkgrealrel=1
    pkgdesc="Canon IJ Printer Driver (MP250 series)"
    url="http://support-au.canon.com.au/contents/AU/EN/0100302002.html"
    arch=('i686' 'x86_64')
    license=('custom')
    depends=(
    'libcups'
    'cups'
    'popt'
    'ghostscript'
    'gsfonts'
    'atk>=1.9.0'
    'gtk2>=2.8.0'
    'pango>=1.12.3'
    'libpng>=1.2.8'
    'libtiff'
    'cairo>=1.0.2'
    'libxml2>=2.6.24'
    'fontconfig>=2.3.0'
    'libxinerama'
    makedepends=(
    'autoconf>=2.13'
    'automake>=1.6'
    'tar'
    'make'
    'gcc'
    conflicts=('cnijfilter-common')
    install=cnijfilter-mp250.install
    source=(
    'http://gdlp01.c-wss.com/gds/0/0100003020/01/cnijfilter-source-3.40-1.tar.gz'
    'fix.patch'
    'libpng.patch'
    'automake_fix.patch'
    md5sums=(
    '609975a05d6050fcca88f312d3f35c6a'
    'ba9c7ec49e76bf74cc50702e362aba7b'
    '15e417cd427a920c83e4f28e225e428e'
    '07f698d8987632d9bb427d3f4a42a29a'
    prepare() {
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/"
    #patch -p0 < "${srcdir}/fix.patch"
    #patch -p0 < "${srcdir}/libpng.patch"
    #patch -p0 < "${srcdir}/automake_fix.patch"
    build() {
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/libs"
    ./autogen.sh --prefix=/usr --program-suffix=mp250
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cngpij"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cnijfilter"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/pstocanonij"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/lgmon"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/ppd"
    ./autogen.sh --prefix=/usr --program-suffix=mp250
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cngpijmon/cnijnpr"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin LIBS="-ldl"
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/backend"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/backendnet"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    package() {
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/libs"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cngpij"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cnijfilter"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/pstocanonij"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/lgmon"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/ppd"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cngpijmon/cnijnpr"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/backend"
    make DESTDIR="${pkgdir}" install
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/backendnet"
    make DESTDIR="${pkgdir}" install
    cp "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/cnijfilter/src/config* \
    "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/lgmon/src/
    cp "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/cnijfilter/src/config* \
    "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/cngpijmon/cnijnpr/cnijnpr/
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"
    install -d "${pkgdir}/usr/lib/bjlib"
    install -m 755 356/database/* "${pkgdir}/usr/lib/bjlib"
    if [ "$CARCH" == "x86_64" ]; then
    libdir=libs_bin64
    else
    libdir=libs_bin32
    fi
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpcmcm356.so.8.0.1" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpcnclapi356.so.3.5.0" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpcnclbjcmd356.so.3.3.0" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpcnclui356.so.3.6.0" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpess356.so.3.3.3" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpess356.so.3.3.3" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${libdir}/libcnbpo356.so.1.0.2" \
    "${pkgdir}/usr/lib/"
    install -m 755 "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/com/${libdir}/libcnnet.so.1.2.0" \
    "${pkgdir}/usr/lib/"
    cd "${pkgdir}/usr/lib/"
    ln -s libcnbpcmcm356.so.8.0.1 libcnbpcmcm356.so
    ln -s libcnbpcnclapi356.so.3.5.0 libcnbpcnclapi356.so
    ln -s libcnbpcnclbjcmd356.so.3.3.0 libcnbpcnclbjcmd356.so
    ln -s libcnbpcnclui356.so.3.6.0 libcnbpcnclui356.so
    ln -s libcnbpess356.so.3.3.3 libcnbpess356.so
    ln -s libcnbpo356.so.1.0.2 libcnbpo356.so
    ln -s libcnnet.so.1.2.0 libcnnet.so
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"
    install -D "LICENSE-cnijfilter-${_pkgrealver}EN.txt" \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-cnijfilter-${_pkgrealver}EN.txt"
    Questions:
    * Is the PKGBUILD all right?
    * The PKGBUILD apparently needs some patches. Unfortunately I don't code so I don't understand what their effect is. As far as I can tell, automake_fix.patch isn't needed anymore: I actually had to remove it to make the package build. Can someone confirm that it is safe to remove automake_fix.patch? What about the other patches? The package seems to build fine without libpng.patch and fix.patch, but since I don't know what they do I cannot really evaluate the impact of removing them.
    * namcap outputs some warnings about missing libraries. I'm not sure how to proceed here. Here is the output:
    cnijfilter-mp250 W: Referenced library 'libcnbpess356.so' is an uninstalled dependency
    cnijfilter-mp250 W: Referenced library 'libcnnet.so' is an uninstalled dependency
    cnijfilter-mp250 W: Referenced library 'libcnbpcmcm356.so' is an uninstalled dependency
    cnijfilter-mp250 W: Referenced library 'libcnbpcnclbjcmd356.so' is an uninstalled dependency
    cnijfilter-mp250 W: Referenced library 'libcnbpcnclapi356.so' is an uninstalled dependency
    cnijfilter-mp250 W: Referenced library 'libcnbpcnclui356.so' is an uninstalled dependency
    On the other hand, if I try to search (with find) for the name of the library in the package, I can see them:
    ./src/cnijfilter-source-3.40-1/356/libs_bin32/libcnbpess356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin64/libcnbpess356.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnbpess356.so
    ./src/cnijfilter-source-3.40-1/com/libs_bin32/libcnnet.so
    ./src/cnijfilter-source-3.40-1/com/libs_bin64/libcnnet.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnnet.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin32/libcnbpcmcm356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin64/libcnbpcmcm356.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnbpcmcm356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin32/libcnbpcnclbjcmd356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin64/libcnbpcnclbjcmd356.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnbpcnclbjcmd356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin32/libcnbpcnclapi356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin64/libcnbpcnclapi356.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnbpcnclapi356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin32/libcnbpcnclui356.so
    ./src/cnijfilter-source-3.40-1/356/libs_bin64/libcnbpcnclui356.so
    ./pkg/cnijfilter-mp250/usr/lib/libcnbpcnclui356.so
    So, all I can guess is that they're not in the correct place... Some of these "missing" libraries are moved around in the pkgbuild. Maybe I should move them in another dir...?
    There are other warnings in namcap; I'm inclined to ignore these:
    cnijfilter-mp250 W: Dependency libcups included but already satisfied
    cnijfilter-mp250 W: Dependency included and not needed ('cups')
    cnijfilter-mp250 W: Dependency included and not needed ('ghostscript')
    cnijfilter-mp250 W: Dependency included and not needed ('gsfonts')
    cnijfilter-mp250 W: Dependency included and not needed ('atk')
    cnijfilter-mp250 W: Dependency included and not needed ('gtk2')
    cnijfilter-mp250 W: Dependency included and not needed ('pango')
    cnijfilter-mp250 W: Dependency libpng included but already satisfied
    cnijfilter-mp250 W: Dependency libtiff included but already satisfied
    cnijfilter-mp250 W: Dependency included and not needed ('cairo')
    cnijfilter-mp250 W: Dependency included and not needed ('libxml2')
    cnijfilter-mp250 W: Dependency included and not needed ('fontconfig')
    cnijfilter-mp250 W: Dependency included and not needed ('libxinerama')
    * now the *really* noob question... My understanding is that the PKGBUILD contains instructions to produce a binary from source. What it's still mysterious to me is how to write these instruction *in practice*. E.g. in this PKGBUILD I see a lot of things copied/installed around, but how the user that originally wrote the PKGBUILD came to determine what to move and where, is beyond me. If I were to write a PKGBUILD from scratch now, how should I know that I need to  e.g.
    cp "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/cnijfilter/src/config* \
    "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"/cngpijmon/cnijnpr/cnijnpr/
    Thanks to those who will find the time/patience to respond, and sorry for the long post.
    Last edited by greymatter (2014-04-06 13:06:27)

    Wow, so much could be simplified with a few cd's and a few for loops.
    Yes, it's OK. Not great, but OK.
    The patches, build fails here without fix.patch and libpng.patch. Make sure to delete your src dir before rebuilding, you probably still have the patches applied from a previous run. It works for now without the automake patch, but it may be needed again in the future. It would be much better done with sed than a patch, though.
    Edit: first attempt at a major cleanup
    # Maintainer: Alireza Savand <[email protected]>
    # Special thanks to: olive, mirrr, GUiHKX, alessiofachechi, jeremy33,
    # jstitch, plv
    pkgname=cnijfilter-mp250
    pkgver=3.40.1
    pkgrel=5.1
    _pkgrealver=3.40
    _pkgrealrel=1
    pkgdesc="Canon IJ Printer Driver (MP250 series)"
    url="http://support-au.canon.com.au/contents/AU/EN/0100302002.html"
    arch=('i686' 'x86_64')
    license=('custom')
    depends=(
    'libcups'
    'cups'
    'popt'
    'ghostscript'
    'gsfonts'
    'atk'
    'gtk2'
    'pango'
    'libpng'
    'libtiff'
    'cairo'
    'libxml2'
    'fontconfig'
    'libxinerama'
    conflicts=('cnijfilter-common')
    install=cnijfilter-mp250.install
    source=(
    'http://gdlp01.c-wss.com/gds/0/0100003020/01/cnijfilter-source-3.40-1.tar.gz'
    'fix.patch'
    'libpng.patch'
    'automake_fix.patch'
    md5sums=(
    '609975a05d6050fcca88f312d3f35c6a'
    'ba9c7ec49e76bf74cc50702e362aba7b'
    '15e417cd427a920c83e4f28e225e428e'
    '07f698d8987632d9bb427d3f4a42a29a'
    prepare() {
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/"
    patch -p0 < "${srcdir}/fix.patch"
    patch -p0 < "${srcdir}/libpng.patch"
    #patch -p0 < "${srcdir}/automake_fix.patch"
    build() {
    for i in libs cngpij cnijfilter pstocanonij lgmon ppd backend backendnet; do
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/${i}"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin
    make
    done
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/cngpijmon/cnijnpr"
    ./autogen.sh --prefix=/usr --program-suffix=mp250 --enable-progpath=/usr/bin LIBS="-ldl"
    make
    package() {
    for i in libs cngpij cnijfilter pstocanonij lgmon ppd backend backendnet cngpijmon/cnijnpr; do
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/${i}"
    make DESTDIR="${pkgdir}" install
    done
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}"
    install -d "${pkgdir}/usr/lib/bjlib"
    install -m 755 356/database/* "${pkgdir}/usr/lib/bjlib"
    install -D "LICENSE-cnijfilter-${_pkgrealver}EN.txt" \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-cnijfilter-${_pkgrealver}EN.txt"
    if [ "$CARCH" == "x86_64" ]; then
    local _libdir=libs_bin64
    else
    local _libdir=libs_bin32
    fi
    cd "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/356/${_libdir}/"
    install -m 755 -t "${pkgdir}/usr/lib/" \
    libcnbpcmcm356.so* \
    libcnbpcnclapi356.so* \
    libcnbpcnclbjcmd356.so* \
    libcnbpcnclui356.so* \
    libcnbpess356.so* \
    libcnbpo356.so* \
    "${srcdir}/cnijfilter-source-${_pkgrealver}-${_pkgrealrel}/com/${_libdir}/"libcnnet.so*
    Things to note:
    1. Versions are not needed on the deps unless it needs something different than what is in the main repos
    2. Anything included in base-devel should not be in the makedeps.
    3. The libdir variable was changed to _libdir and declared local. Need to avoid conflicting with other potential variables from the environment.
    Last edited by Scimmia (2014-04-05 18:04:26)

  • Help with Sort function in Terminal

    Hello all... this is my first post on here as I'm having some trouble with some Termianl commands. I'm trying to learn Terminal at the moment as it is but I would appreciate some help with this one....
    I'm trying to sort a rather large txt file into alphabetical order and also delete any duplicates. I've been using the following command in Terminal:
    sort -u words.txt > words1.txt
    but after a while I get the following error
    sort: string comparison failed: Illegal byte sequence
    sort: Set LC_ALL='C' to work around the problem.
    sort: The strings compared were `ariadnetr\345dens\r' and `ariadnetr\345ds\r'.
    What should my initial command be? What is Set LC_ALL='C'?
    Hope you guys can help?

    Various languages distinct sorting - collation - sequences. 
    The characters can and variously do sort differently, depending on what language is involved. 
    Languages here can include the written languages of humans, and a few settings associated with programming languages.  This is all part of what is known as internationalization and localization, and there are are various documents around on that topic.
    The LC_ALL environment variable sets all of the locale-related settings en-mass, including the collation sequence that is established via LC_COLLATE et al, and the sort tool is suggesting selecting the C language collation.
    Here, the tool is suggesting the following syntax:
    LC_ALL=C sort -u words.txt > words1.txt
    This can also be done by exporting the LC_ALL, but it's probably better to just do this locally before invoking the tool.
    Also look at the lines of text in question within the files, and confirm the character encoding of the file.
    Files can have different character encodings, and there's no reliable means to guess the encoding.  For some related information, see the file command:
    file words.txt
    ...and start reading some of the materials on internationalization and localization that are posted around the 'net. Here's Apple's top-level overview.
    In this case, it looks like there's an "odd" character and probably an å character on that line and apparently the Svenska ariadnetrådens. 
    Switching collation can help here, or - if the character is not necessary - removing it via tr or replacing it via sed can be equally effective solutions. 
    Given it appears to be Svenska, it might work better to switch to Svenska collation thanto  the suggested C collation.
    I think that's going to be sv_SE, which would make the command:
    LC_ALL=sv_SE sort -u words.txt > words1.txt
    This is all generic bash shell scripting stuff, and not specific to OS X.  If you haven't already seen them, the folks over at tldp have various guides including a bash guide for beginners, and an advanced bash scripting guide - both can be worth skimming.  They're not exactly the same as bash on OS X and some specific commands and switches can differ, and as bash versions can differ, but bash is quite similar across all the platforms.

  • Help with cat

    Hi, i need help with formating output from text.
    For example i have this output:
    /dev/sda: WDC WD1600BEVT-22ZCT0: 37°C
    And i need format this output to "37°C" only or "/dev/sda" only or "WDC WD1600BEVT-22ZCT0" only.
    I know only how i can format output to "/dev/sda" :
    cat text.txt | head -c 8
    Thanks
    Last edited by STANKAR (2011-01-02 17:16:53)

    This is getting repetitive...
    awk '/^charging state/{ print $NF }' /proc/acpi/battery/BAT1/state
    sed -n '/^charging state/s/.*:\(.*\)/\1/p' /proc/acpi/battery/BAT1/state
    while IFS=':' read label val; do
    [[ $label == charging state ]] && { echo $val; exit; }
    done < /proc/acpi/battery/BAT1/state
    There's many ways to do these things. I advise you to learn a little on your own as it will make your life in linux much easier and more productive.
    http://mywiki.wooledge.org/BashGuide
    http://mywiki.wooledge.org/BashFAQ
    http://wiki.bash-hackers.org/doku.php
    Last edited by falconindy (2011-01-02 17:50:00)

  • Editing bugged jsp with sed.

    I have a problem with my jsp pages, because after moving them, addresses are not resolved correct anymore. There are lots of tags such as:
    <img src"/*"
    which need to be rewritten into something like this:
    <img src"<html:rewrite page="/*" />"
    i tried doing this with sed:
    sed -e 's/<[^>]img src="/*"/<img src="<html:rewrite page="&"/>"/g filename
    but it doesnt work. It wouldnt even work with tags inserted in tags (in same <img src tags are <% %> tags). Could someone keen on all this line editors and regular expressions help me?

    It nearly works:
    sed -e 's]<img src="/.\([^"]*\)"]<img src="<html:rewrite page="/\1"/>"]g'
    could someone tell me, how to make this aware of <% %> tags?

  • HELP with my Radiobutton & Checkbox script

    ////the problem is that when I select the Officer RadioButton, only the RT021 checkbox is marked with "X", when I select the Reenlistment RadioButton, everything annotated is selected as it should, when I select the Enlisted RadioButton, nothing happens, all checkboxes are still empty
    all 3 RadioButtons are grouped and I have enetered the script at the group level and not individaul
    I believe that I missed something to actually link the script, not sure
    here is the script:
    ---- from1.NJWPage2.RadioButtonList::change: - (JavaScript, client) ----------------------
    if (Officer.rawValue == 1)
    ISC1.rawValue = "1";
    TAT1.rawValue = "1";
    DD28071.rawValue = "1";
    QCRE1.rawValue = "1";
    RT021.rawValue = "1";
    SOU1.rawValue = "1";
    else
    ISC1.rawValue = "0";
    TAT1.rawValue = "0";
    DD28071.rawValue = "0";
    QCRE1.rawValue = "0";
    RT021.rawValue = "0";
    SOU1.rawValue = "0";
    if (Enlisted.rawValue == 1)
    ISC1.rawValue = "1";
    TAT1.rawValue = "1";
    DD28071.rawValue = "1";
    QCRE1.rawValue = "1";
    SOU1.rawValue = "1";
    else
    ISC1.rawValue = "0";
    TAT1.rawValue = "0";
    DD28071.rawValue = "0";
    QCRE1.rawValue = "0";
    SOU1.rawValue = "0";
    if (Reenlistment.rawValue == 1)
    ISC1.rawValue = "1";
    TAT1.rawValue = "1";
    DD28071.rawValue = "1";
    DD28081.rawValue = "1";
    DD2141.rawValue = "1";
    QCRE1.rawValue = "1";
    RT071.rawValue = "1";
    ENLM1.rawValue = "1";
    SOU1.rawValue = "1";
    PRIVACYACT1.rawValue = "1";
    RELM1.rawValue = "1";
    DD41.rawValue = "1";
    COMPWRKS1.rawValue = "1";
    else
    ISC1.rawValue = "0";
    TAT1.rawValue = "0";
    DD28071.rawValue = "0";
    DD28081.rawValue = "0";
    DD2141.rawValue = "0";
    QCRE1.rawValue = "0";
    RT071.rawValue = "0";
    ENLM1.rawValue = "0";
    SOU1.rawValue = "0";
    PRIVACYACT1.rawValue = "0";
    RELM1.rawValue = "0";
    DD41.rawValue = "0";
    COMPWRKS1.rawValue = "0";
    Your help is greatly appreciated
    Thank You

    Well,
    I installed kedpm with my first working PKGBUILD script.  I was able to import my "fpm" password file.  Once I get my gnucash stuff transfered into grisbi, I will be able to switch my main machine completely to archlinux.
    I know it is trivial for you guys, but here is my script -- it might save you some typing.
    Kev
    pkgname=kedpm
    pkgver=0.4.0
    pkgrel=1
    pkgdesc="Ked Password Manager helps to manage large amounts of passwords and related information"
    url="http://kedpm.sourceforge.net/"
    depends=(python pygtk pycrypto)
    makedepends=()
    conflicts=()
    replaces=()
    backup=()
    install=
    source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=('6b83a646873f8ea00af9c6403aa259bc')
    build() {
    cd $startdir
    mkdir -p pkg/usr
    cd $startdir/src/$pkgname-$pkgver
    python setup.py install --prefix=$startdir/pkg/usr

  • OFF TOPIC: Anyone familiar with sed?

    Apologies for the off topic nature of the post...
    I'm looking for a little help with a "sed" query.
    I'm trying to insert a "header" row above the first line of my file but I can't quite get it.
    I've been trying:
    sed -e '1i\header...\' test.csv
    sed -e '1i\header...\' test.csv > test2.csv
    If I read it right, I'm issuing the sed command, I'm specifiying my edit command which is to match line 1 and insert "header..." above that line.
    I was trying to edit the file in situ but I then read that sed produces a copy of the file, leaving the original untouched. So I tried to redirect the output to a second file.
    The sed command runs okay but I'm only getting a copy of test.csv in my second file.
    Can anyone spot my mistake?
    Cheers,
    Mark

    Sed uses regex, and \ is an escape.
    The normal separator is /. You can use a different character (common ones are ! and # I think) if you have / literals that you don't want to have to escape, but I don't know if you can use \ as the separator. If you can, you'd at least have to escape it.
    I'm too tired right now to look for any other errors.
    If you want to edit in place, you might look into ed. It's kind of vi-ish, and lets you do sed-ish operations, and works okay as a non-interactive batch-command processing kind of thingy for performing edits on a file and then saving it.
    Of course, if it was me, I'd just be lazy and do (echo whatever ; cat test.csv) > test2.csv

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

Maybe you are looking for

  • Mission control + Itunes

    Hi, I'm on OSX LION with a Imac 27''. I use Itunes in full screen mode. Then, when I want to quit Itunes : I use Cmd+Q (but at this time Itunes is always in full screen) And then, when I want to launch Itunes again... icon jumps... jumps... jumps...

  • Pacman seg fault(Solved but with comments on pacman-db-upgrade)

    Performed an install from FTP and booted into root login. Performed pacman -Syu  and received report system up to date. Performed downloads via pacman of twelve packages including xorg and xfce4. Performed download of abs package.  Downloaded abs rep

  • Process dimensions and Applications after Restore

    We are using BPC 7.0MS.  We need to process dimensions and Applications after the database restore in case of any Optimization failures. It takes around 3 hours for us to do this process. Can we skip the BPC process by taking backup of Database and S

  • Process step for Investment Management

    Hi SAP Gurus Our client is into BOT projects - Build, operate adn transfer projects. Till the time of transfer the asset is the property of our client. So the client builds an assets, maintains & operates and transfers the rights only after certain y

  • Location of datafiles

    I had a query with regard to the location of datafiles at the time of creation. Should it be in the path like $ORACLE_BASE/oradata/$ORACLE_SID/<file-name>.dbf as in the command CREATE TABLESPACE CRESTELMEDIATIONPRD501 DATAFILE '$ORACLE_BASE/oradata/$