[Unknown] Bash: Why does this script break my environment?

I'm trying to build a script to do a couple makepkg tasks and it looks like I'm having trouble with a function breaking the environment.  The function does several commands and then breaks makepkg.  After I run the script, makepkg runs as if no options are entered:
makepkg -g
==> Check: Installer is the correct size.
==> Extracting archive...
==> Copying files...
cp: cannot overwrite non-directory `/var/abs/local/personal/worldofgoo/pkg/usr/share/games/worldofgoo/WorldOfGoo' with directory `WorldOfGoo'
==> ERROR: An unknown error has occurred. Exiting...
Instead of the expected:
makepkg -g
==> Retrieving Sources...
-> Found worldofgoo.desktop in build dir
==> Generating checksums for source files...
md5sums=('e49849a66aa50065d4d548653a33cc23')
Here's the script it just started happening when I added the function.  I think it has to do with the curly brackets that awk uses.
#!/bin/bash
# mp - makepkg package building tasks
# Add md5sums following source array in PKGBUILD
md5add () {
# Delete previous md5sum entries
sed -i '/^md5sums/,/).*$/d' PKGBUILD
# Add md5sums to end if PKGBUILD
makepkg -g >> PKGBUILD
# Move md5sums to follow source array
awk 'BEGIN {
checkAt = 0
filesAt = 0
scanning = 0
/md5sums=\(/ {
checkAt = NR
scanning = 1
/source=\(/ {
filesAt = NR
scanning = 1
/)$/ {
if (scanning) {
if (checkAt > filesAt) {
checkEnd = NR
} else {
filesEnd = NR
scanning = 0
lines[NR] = $0
END {
for (i = 1; i <= NR; ++i) {
if (checkAt <= i && i <= checkEnd) {
continue
print lines[i]
if (i == filesEnd) {
for (j = checkAt; j <= checkEnd; ++j) {
print lines[j]
}' PKGBUILD > /tmp/PKGBUILD.tmp
if [ -f /tmp/PKGBUILD.tmp ]; then
mv /tmp/PKGBUILD.tmp PKGBUILD
fi
# Remove trailing blank lines
while [ "$(tail -n 1 PKGBUILD)" == "" ]; do
sed -i '$d' PKGBUILD
done
# Options
case $1 in
p ) if [ ! -f ./PKGBUILD ]; then
echo "No PKGBUILD in this directory ($(pwd))"
exit; else
makepkg -sf
fi
s ) if [ ! -f ./PKGBUILD ]; then
echo "No PKGBUILD in this directory ($(pwd))"
exit 1; else
echo "adding md5sums"
md5add
makepkg -f --source
fi
* ) # Display usage if full argument isn't given
echo " ${0##*/} <option> - makepkg building tasks:"
echo " p - build package (also installs dependencies)"
echo " s - build source-only tarball (adds md5sums, tars for submission)"
exit
esac
I have to restart to reset the environment (logout doesn't work) so I'l like to be able to fix this .  Any ideas?
Last edited by Gen2ly (2009-10-30 15:19:17)

Just reinstalled and not having it come up again.  Putting this in wonderland.
Last edited by Gen2ly (2009-10-30 15:18:44)

Similar Messages

  • Why does this script behavior change with the phase of the moon ?

    Can anyone from adobe corp or non-adobe volunteers tell me where to look in their docs to find out why this script change its behavior or how to use the debugger to figure out the same. I read the guide and the whole section on debugger and break points etc well.
    try{
    this.getField('Button4').strokeColor = color.red   ;
    app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 500 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 1000 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 1500 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 2000 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 2500 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 3000 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 3500 );
    app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 4000 );
    catch(e){}
    Sometimes the above script cycle thru all the colors in proper order and other time it get stuck.
    I have linked it to a button so its part of the button javascript.
    Is there a way to craft setTimeOut calls that it becomes a reliable delay ?
    How to craft it such that the file does not change and does not have to be saved ? This is wanted in addition but not the essential issue at the moment.
    Thanks,
    Rainbow

    MAXcount=20
    // Create a simple color animation on a field called “Color” that changes every second.
    function DoIt() {
      var f = this.getField("Button4");
      var nColor = (timeout.count++ % 10 / 10);
      // Various shades of red.
      var aColor = new Array("RGB", nColor, 0, 0);
      f.fillColor = aColor;
      console.println( 'change' + ' ' + nColor + '; count=' + timeout.count );
      if (timeout.count >= MAXcount)
        app.clearInterval ( timeout );
    console.show();
    console.clear();
    console.println('Start');
    // save return value as a variable
    timeout = app.setInterval("DoIt()", 1000);
    // Add a property to our timeout object so that DoIt() can keep a count going.
    timeout.count = 0;
    console.println('End of code');
    // And observe the results. I expect your new timer events are conflicting with each other. Note that in the above code the change is performed within the called function and not as new line of code.
    I ran it but did not follow your last comment and acrobat disk icon prompts for saving the file. Can anyone remove this "latter problem" ? Can it be solved by any means ?

  • Why does this script changes modification date???

    Hello All,
    I am using this script with an Acrobutton to advise my users of the current PDF version.
    var stmDoc = Collab.documentToStream(this)
    var strDoc = util.stringFromStream(stmDoc);
    var strVer = strDoc.substr(5,3)
    app.alert({cMsg: "The PDF version is: " + strVer, nIcon: 3, nType: 0, cTitle: "PDF Version Check"});
    Problem is that when closing the document, even though not prompted, the file is saved (assumed, since the modification date changes).
    Is there anything about this script that is doing this?

    I added a "this.dirty = false;" to the end, but it does not do as I had hoped. The pdf does not prompt for a save, which is what I understand the dirty flag to be effecting. The modification date changes anyway. Am I not using the dirty flag correctly? Thanks in advance for your help.

  • Why does this script error on shutdown?

    it's the one from this package: http://aur.archlinux.org/packages.php?d … =1&ID=2885
    http://aur.archlinux.org/packages/oss2j … ck/os2jack
    Although it works good it spouts some ugly error on shutdown(although it manages to shutdown correctly)
    Now i just copied the code from some other script so i don't know what could be wrong. So please, all you bash ppl out there!
    /me makes mental note to read the rest of RUTE linux manual to 'get' this stuff more.

    Well, at a first glance, the script backgrounds the kill command and then checks the return status, which I'm pretty sure doesn't work... so it probably does it's job, but looks as if it's failing.

  • Why does this script beep at me :-(

    Writing a script that creates job folders and duplicates files, all works great, but when I save the script as an application, I get a beep after every file is copied.
    Perhaps I am doing something wrong, so I created a test script just that just copies files and the same thing happens, when I run it the files get copied, and at the end it beeps once, save it as an application, the files get copied, but I get four beeps.
    this is sample script:
    -- move file test
    tell application "Finder"
    set FromFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveFromFiles:"
    set ToFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveToFiles:"
    set FileName to "NewJob1.txt"
    set MvFile1 to FromFolder & FileName
    set FileName to "NewJob2.txt"
    set MvFile2 to FromFolder & FileName
    set FileName to "test1.tif"
    set MvFile3 to FromFolder & FileName
    set FileName to "test2.tif"
    set MvFile4 to FromFolder & FileName
    duplicate file MvFile1 to ToFolder
    duplicate file MvFile2 to ToFolder
    duplicate file MvFile3 to ToFolder
    duplicate file MvFile4 to ToFolder
    end tell
    as I said this is just a test, my original intent is to copy files from different locations, but this test has the same one beep per file after saving as an application.
    Can I turn off the beep, or am I doing something wrong?
    Thanks

    Hi ErstO. Welcome to Apple Discussions!
    You can hear a beep even when you duplicate a file with ⌘D in the Finder. That's normal. Try this:
    *set FromFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveFromFiles:"*
    *set ToFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveToFiles:"*
    *set MvFile1 to FromFolder & "NewJob1.txt"*
    *set MvFile2 to FromFolder & "NewJob2.txt"*
    *set MvFile3 to FromFolder & "test1.tif"*
    *set MvFile4 to FromFolder & "test2.tif"*
    *set volume with output muted* -- StandardAdditions.osax > Miscellaneous Commands
    *tell application "Finder"*
    *   duplicate file MvFile1 to folder ToFolder* -- the word folder is required before the path
    *   duplicate file MvFile2 to folder ToFolder*
    *   duplicate file MvFile3 to folder ToFolder*
    *   duplicate file MvFile4 to folder ToFolder*
    *end tell*
    *delay 1* -- should be enough
    *set volume without output muted*
    Hope it can help.
    (The script seems to work even without the word folder being put before the ToFolder path. However, if you open the Event Log History window after having run the script, you will see a huge difference.)
    Message was edited by: Pierre L.

  • Why does this script fail with OS X Lion?

    The following AppleScript has been woorking just fine ronning Snow Leopard. Under Lion only the first site is loaded and the other Safari tabs are Untitled. Does anyone know what is wrong and how do I fix it? Thanks for any help.
    Hugh
    ---------------------------------------------------- Non-working script ---------------------------------------------------------------------
    tell application "Safari"
              open location "http://www.macrumors.com/"
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macworld.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macnn.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://reviews.cnet.com/macfixit/?tag=mfiredir"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macintouch.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://arstechnica.com/apple/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.appleinsider.com/"}
    end tell

    Does anyone know what is wrong and how do I fix it?
    Actually, I don't know why your script fails with Mac OS X Lion. I can only suggest the following workaround, which seems to work properly:
    set myURLs to {"http://www.macworld.com/", "http://www.macnn.com/", "http://reviews.cnet.com/macfixit/?tag=mfiredir", "http://www.macintouch.com/", "http://arstechnica.com/apple/", "http://www.appleinsider.com/"}
    open location "http://www.macrumors.com/"
    tell application "Safari"
        activate
        tell window 1 to repeat with thisURL in myURLs
            set current tab to make new tab
            my newTab(thisURL)
        end repeat
    end tell
    on newTab(theURL)
        tell application "System Events"
            keystroke "l" using command down
            keystroke theURL & return
        end tell
    end newTab

  • Why does this script not work when run with osascript cli?

    I wrote the following to interface with geektool to display a list of todo's on my desktop (i'm sure it's been done elsewhere, but I wanted to try it myself). I had it working fine until I tried ordering the output to place the highest priority items at the top of the list. The following code works properly during development in Script Editor, but when geektool launches the command using osascript ~/Library/Scripts/todos.scpt it only displays the initial "TODOS:" without displaying the rest of the info. Searching the Applescript Release notes, I found that some versions of Applescript 1.8 had issues with null characters when using the osascript cli, however, I'm running 1.10.7 so it shouldn't be an issue (and I'm not sure how to check for null characters in Applescript even if it were). Anybody have any ideas on what's going on here?
    set output to {"TODOS:
    set highpri to {}
    set medium to {}
    set low to {}
    set nada to {}
    tell application "iCal"
    repeat with i in calendars
    repeat with j in todos of i
    if (completion date of j as string) is equal to "" then
    if priority of j as string is equal to "high priority" then
    copy summary of j & "
    " to end of highpri
    end if
    if priority of j as string is equal to "medium priority" then
    copy summary of j & "
    " to end of medium
    end if
    if priority of j as string is equal to "low priority" then
    copy summary of j & "
    " to end of low
    end if
    if priority of j as string is equal to "no priority" then
    copy summary of j & "
    " to end of nada
    end if
    end if
    end repeat
    end repeat
    end tell
    return (output & highpri & medium & low & nada) as string

    well, i'd been pulling my hair out for quite a while with this and decided it was time to ask for help, but I thought I'd give it one last shot and found a resolution almost immediately. I figured that problem had to be caused by the way applescript was concatenating the lists, so I got rid of the lists completely and it still wouldn't work. This convinced me that it must be newline related since that was the only special character left in the string. I opened up the script in vi, but the default compiled script format is not human readable. The osascript man page indicated that it would accept both compiled and text scripts, so I gave it a try, and osascript handled the raw text file wonderfully.

  • Why does this script only work on mobile devices?

    Is there any reason this conditional statement would work on mobile devices and not in a desktop browser i.e. Chrome, Safari? I am using it in a scroll activated project to trigger a symbol to play forwards or backwards depending on where the playhead is in the symbol. Works great on an iPad but not Chrome, Safari on my desktop.
    if (sym.getSymbol("icons_sym").getPosition("back") ) {
    sym.getSymbol("icons_sym").playReverse();
    else {
       sym.getSymbol("icons_sym").play("front");
    Thanks,
    Mark

    Ivan
    Sorry, my original posting was complete rubbish - I'll try and find the right answer...
    HTH
    Regards Nigel
    Message was edited by:
    nthomas

  • Why does this formula break VLOOKUP?

    I have the table below.  The formula in B3 is causes the VLOOKUPS in C3 to be off.  If I just use the value 0.20 in B3, I get "sixty" in C3.
    The B3 formula is:
    =ABS(A2-A4)
    and C3 is:
    =VLOOKUP(B3,D1:E5, 2)
    What needs to change for this to work correctly?

    Functionally, there's no difference between the original VLOOKUP formula, where the 4th argument is omitted, and the one suggested by Wayne, where the 4th argument is given the value 1 (or TRUE).
    As described in the excerpt from the Formulas and Functions User Guide shown in Wayne's post:
    Wayne Contello wrote:
    close match (TRUE, 1, or omitted): If there’s no exact match, select the column with the largest top-row value that is less than the search value.
    Reproducing the table shown on my own machine produces the value (fifty-five) with either version of the formula.
    I suspect that the result in C3, like any other spreadsheet cal\culation, is subject to a rounding error caused when the values in A2 and A4 are translated to binary for the calculation, then reinterpreted as a decimal value for the display. If C3 is set to show two decimal places, the actual value could be anything in the range 0.195 - 0.2099999999999. VLOOKUP uses the actual value, not the displayed value, so any actual value in the range 0.195-0.1999999999999999999 will display in C3 as 0.20, but will return the result for 0.10, 'the largest search-for value that is less than the search value.'
    Try revising your C3 formula to =ROUND(ABS(A2-A4),2)
    On my test table, this produced the expected result (sixty).
    Regards,
    Barry

  • When people call me, "Unknown" lights up the screen. There's no number or name. Why does this happen?

    When people call me, "Unknown" lights up the screen. There's no number or name. Why does this happen?
    This happend suddenly a few days ago, it has never happend before... Where does this come from?
    - Cathrine

    The people who are calling you may have their numbers blocked.

  • Why does Apple keep breaking the podcast app?

    Why does Apple keep breaking the podcast app?

    Here are my issues, maybe you can help... And yes "breaking" and "nightmare" are accurate descriptions of this update...
    1. Syncing is now impossible without WiFi or a Cellular connection. I've tried your guide in the other thread, but it didn't help.
    When I sync podcasts with iTunes, they DO NOT SHOW UP in the app unless I connect my iPhone 5S to WiFi or Cellular. As soon as I connect it to something, new episodes that I manually synced finally show up and can be played.
    2. Arranging the podcasts in any order is now pointless. Any sort of wireless connection will reset my order to a randomized one. It's not even "podcasts with the newest episodes on top", it's just random.
    3. Apple doesn't seem to allow any other podcast app to use the manual sync in iTunes. Am I wrong about that? I looked at countless paid apps and they all have their own cloud or system to only deliver episodes wirelessly...
    4. And that constant prompt about Cellular data access could drive anyone insane!
    I have never been this frustrated with an Apple product in my life...

  • Why does the eraser break calligraphic strokes?

    Hi,
    When creating strokes with the calligraphic brush (using an Intuos5), I noticed that the eraser tool breakes the stroke thickness when apllied to the calligraphic stroke.
    The entire stroke defaults to an undesired,uniform thickness.
    See video here:
    http://bit.ly/10AN9WV
    So why does this happen?
    Is there some way to prevent the eraser from destroying the stroke thickness?
    Input appreciated.
    Kind Regards / Alex

    http://blogs.adobe.com/adobeillustrator/2009/04/mysteries_of_the_eraser_tool_r.html

  • I cannot send an email from my iPad 2? No problem receiving, why does this happen? Have tried the suggestions for setting up email and after doing the sync mail through iTunes receiving worked great but still cannot send? Any help would be great

    I cannot send an email from my iPad 2? No problem receiving, why does this happen? Have tried the suggestions for setting up email and after doing the sync mail through iTunes receiving worked great but still cannot send? Any help would be great!

    The fact that you can receive means you have a valid e mail address, and have established the connection to the incoming server, so all of that works.  Since the send does not work, that means your outgoing server is rejecting whatever settings you used formthe outgoing set up.  Try them again. 
    Google your particular isp, and ipad and many times you will find the exact settings needed for your isp.  Or tell us here, and soneone else may be on the same isp.  Some mail services need you to change a port, or have a unique name for the outgoing server.  
    Kep trying.

  • HT201209 iTunes will not use the redeemed gift cards on my account, I have a $30 credit and when I try to purchase a song it goes right to my credit card on file. Why does this keep happening

    iTunes will not use the redeemed gift cards on my account, I have a $30 credit and when I try to purchase a song it goes right to my credit card on file. Why does this keep happening???

    Any time you've changed anything in your billing, it does this once to very things.

  • TS4062 when i sync my iphone a large portion of my music does not download but rather stays in the cloud. then i must download it from the cloud. why does this happen and how can i stop it from happening

    every time that i sync my iphone with a cord to my imac some large portion of my music is placed in the cloud so that i must down load it from the cloud. this includes music that i have purchased on itunes and other music. it seems random.
    why does this happen? is it a setting? i want to stop it. and music that w

    It was gift back in September. You can follow the instructions in the link below to remove them:
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases - Apple Support

Maybe you are looking for

  • Can't find the harddrive connected to AirPort Extreme from NETGEAR EVA9100

    Hey all, Like the subject sais... I have a setup in my appartment where I have a USB Harddrive connected to my AirPort Extreme. I put my media on that disk, and now I want to access these files from my new NETGEAR EVA9100 media streamer, but for some

  • I have a Skype account for my work but want to hav...

    It kept asking me "Request permission from Skype manager" which is my work account. I do have a personal email that I could use but couldn't find any link to starting a new private personal Skype account - help!! Skype site isn't very user friendly i

  • Data Guard Broker fails with ORA-16635 and ORA-03135

    Hi All, I configured Oracle RAC with Dataguard 11.2 on Windows 2003. I've already configured Standby without Data Guard Broker and everything is working fine, but when I try to use Data Guard Broker, he can not synchronize the files from the Data Gua

  • Using credentials with a web service -- what our my options?

    Hi All, I'm trying to determine what options I have in regards to setting credential requirements on my web services. The two options seem to be: -Basic authentication -SOAP header authentication. I see that the WebService class has a "setCredentials

  • DME format to be called

    hi  Guys,                  we are using classic payment Payment medium program  RFFOUS_T. Now i have got a change request to modify the current DME format. In case i got  a new format what settings to made to call that format from RFFOUS_T.  does the