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
Similar Messages
-
[SOLVED] Need a little help with ACPI handler.sh script.
By using ACPI I'm trying to get my laptop to hibernate at critical power state. So far I've made a few test scripts to test how to do this, with one of these scripts I'm stuck. My scripting skills are not that good to solve it.
This is the script:
if [ `awk '{print $3}' /proc/acpi/battery/C1E9/state` == "ok" ]
then
logger "battery is ok"
else
logger "battery is not ok"
fi
If I run the script I get an error (while "battery is not ok" is logged):
┌─[~]
└─> ./test2
./test2: line 1: [: too many arguments
┌─[~]
└─>
When I run the awk-command from the script, I get the following output:
┌─[~]
└─> awk '{print $3}' /proc/acpi/battery/C1E9/state
ok
discharging
2341
1824
10969
┌─[~]
└─>
I think the problem lies in the multiple output of the awk-command, but I'm stuck in solving it.
Any help would be great.
Last edited by NeoXP (2009-11-16 22:40:45)@ skanky
Thanks for the suggestion, but you're right I'm not gonna change a working script. It is working exactly as expected.
@ all
When interested this is my current handler.sh
#!/bin/sh
# Default acpi script that takes an entry for all actions
# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to
# modify it to not use /sys
minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
set $*
case "$1" in
button/power)
echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
button/sleep)
case "$2" in
SLPB) echo -n mem >/sys/power/state ;;
*) logger "ACPI action undefined: $2" ;;
esac
ac_adapter)
case "$2" in
AC)
case "$4" in
00000000)
echo -n $minspeed >$setspeed
#/etc/laptop-mode/laptop-mode start
00000001)
echo -n $maxspeed >$setspeed
#/etc/laptop-mode/laptop-mode stop
esac
*) logger "ACPI action undefined: $2" ;;
esac
battery)
if [ `awk '{print $2}' /proc/acpi/ac_adapter/C1E8/state` == "off-line" ];
then
logger "battery discharging"
if (( `awk '{if (NR==5) {print $3}}' /proc/acpi/battery/C1E9/state` >= "250" ))
then
logger "battery ok"
else
logger "battery not ok"
/usr/sbin/pm-hibernate;
fi
else logger "battery charging"
fi
button/lid)
if [ `awk '{print $2}' /proc/acpi/button/lid/C1ED/state` == "closed" ];
then
logger "ACPI lid closed"
/usr/sbin/pm-suspend
fi
logger "ACPI group/action undefined: $1 / $2"
esac
Still working on it though -
Help with eclipse Qt4 pkgbuild [solved]
Hello!
I want to use qt integration with eclipse.
I looked in Aur and found a pkgbuild but he is out of date so I decided to modify it and
I would like to ask someone to look at it to be sure I did a right job.
I always fear to kill permission when I play with abs
The pkgbuild:
# Contributor: Alex Rodin <[email protected]>
# Contributor: Shaika-Dzari <[email protected]>
pkgname=eclipse-qt4
pkgver=1.0.1
pkgrel=1
pkgdesc="Qt4 integration for Eclipse"
arch=('i686')
url="http://trolltech.com/company/newsroom/announcements/press.2007-05-24.8884335791"
license=('custom')
depends=('eclipse>=3.2.1' 'eclipse-cdt>=3.1.1' 'qt4')
provides=('qt4eclipse')
source=("http://trolltech.com/developer/download/qt-eclipse-integration-linux.x86-$pkgver.tar.gz")
md5sums=('d01ad9bc4cd953340b9db806f49dac8f')
build()
mkdir -p $startdir/pkg/usr/share/eclipse
cp -R $startdir/src/eclipse/plugins $startdir/pkg/usr/share/eclipse
mkdir -p $startdir/pkg/usr/share/licenses/$pkgname
cp $startdir/src/eclipse/features/com.trolltech.qtcpp.feature_1.0.1/license.txt $startdir/pkg/usr/share/licenses/$pkgname/COPYNG
I changed:
* new version 1.0.1
* new download url
* switch to /usr/share for eclipse plugins
Thank you for your help.
@+
Last edited by Shaika-Dzari (2008-01-10 01:29:05)Merci Snowman
-
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 YouWell,
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 -
Help for compiling first Java script
Friends,
I am a begginer java programmer. Iam trying to compile a java script using .bat file which contains
c:\j2sdk\bin\javac -classpath <c:\j2sdk\lib\dt.jar> . ReadOnlyMaker.java
But it comes back with error as below
>c:\j2sdk\bin\javac -classpath ReadOnlyMaker.java 0<c:\j2sdk\lib\dt.jar 1>.
Access is denied.
I have admin rights on this machine but the directory j2sdk , where java is installed, is always staying readonly even after changing permissions in properties tab.
Not sure what is going wrong , Any one can Pl. help ?
Thanks,First of all you don't need to be in the ..\..\bin directory to execute the javac.exe, java.exe, etc pgms as commands. If not already set up correctly, you can just add this to your System PATH.
Next, start by executing from the directory your .java PGM is in.
Then, what is that <...> stuff?
Lastly, if it's a .java file, it's a pgm file and not a javascript. Javascript goes is only for web work, embedded in html.
~Bill -
I require help with my first website
As you can see from many of my recent posts, I am new to web development, and I have decided that I am going to need some help.
This forum has been a huge help, and I will continue using it, but the reality of the situation is that progress is slow as I am learning as I go, each junction I reach and require help with is holding up progress, which wouldn't be a problem if I had more spare time, but I simply don't.
Is anybody willing to help me? It would be paid work so I would need to discuss how this would work with rates etc... here are some details:
The domain is already setup, and you can see the first page I have been working on here: http://www.elliotnewman.com/index/test7.html
The closet website I can find for your reference is: http://www.jaspaljandu.com/home/
My site will initially not be quite as established as Jaspal's, but in essence the functionality will be similar. The things I know of that I will need help on are:
Setting up the ordering and payment process when a customer wants to order a print, including automated email notifications, and check out forms ( this may also require membership fields or maybe through paypal)
Setting up the interactive framing graphics - ref - http://www.markgray.com.au/gallery/limited-edition-prints/forgotten-island.php
Potentially helping to setup a blog
Work with me on integration - and updates (ie build the all the templates needed so updates and new images can be posted by myself easily)
Automation of the counts of the limited editions
Setting up links to Facebook, twitter, linkedin etc
Reviewing and testing any code that I create
Along with these points I will also need standby help with the code I am directly working on, so file sharing may have to be setup. It is also worth noting that I will supply all the graphics and the design elements for every page, I will also be very specific with briefs as I know exactly what I want to achieve.
If anybody is interested please send me a private message, I would need to see some examples of your experience, details on your availability and your rate - whether thats per day, per hour and a rough estimate on how long you think the work will take.
Also, if anybody knows somebody outside this forum that you think could help me then please also forward this on.
Apologies if this is not the best place to post this.
Elliot.Hi
In addition to Nancy s comments, reading the following line -
Along with these points I will also need standby help with the code I am
directly working on, so file sharing may have to be setup.
What you are basically after is a tutor, to guide you in what you are doing. In this respect it may be worth your while to read-up on designing web pages,as after a quick glance of the code, (from your previous post regarding the background image ) the main problem you are having is that you are not 'implementing' a consistent design/development procedure.
Try reading the following -
General tutorials on html, css, etc - http://www.w3schools.com/.
Design of web site, general - http://articles.sitepoint.com/article/principles-beautiful-web-design.
PZ
www.pziecina.com -
A little help with my first 2 column liquid hybrid effort.
Hello all:
I am attempting my first liquid hybrid layout using DW's "2 column hybrid, left column, header, footer". layout and it's going pretty good but... I can't seem to get rid of the black line just below the top area that contains the two samle graphics. I believe it may be an gap between the "topcontainer" div and the "container" div below it. I just can't figure out how to fix it.
Here's a link to show you what I am trying to accomplish. http://reynolds-marketing.com/twotest/atest.html
Attached are the html and css files.
Any suggestions would be very much appreciated. TIA!Hi
No, that is what I was expecting.
You will have to use IE conditional comments (also called conditional statements), they go just above the closing </head> in your html or place the IE only css in a separate css file (what I normally do), and link to them inside the IECC in your html file.
My previous suggestions apply for correcting the problem, and for IECC usage see - http://www.quirksmode.org/css/condcom.html,
(use initially)
<!--[if IE]>
I get nothing for the following, but -
Have you checked out the 'css anthology' book from sitepoint, as this will help with such problems, see the post from Nadia - http://forums.adobe.com/thread/497065?tstart=0, these are an excellent help (and on offer at the moment), I can personally recommend the "Everything you know about css is wrong" book, especially once you are happy creating 'standard' css layouts, and there is a plug-in for IE6 & 7 to enable the css layout mode it discusses.
PZ -
Help me with my first PKGBUILD and concerns.
This is my first-time-ever PKGBUILD. I'm noobie-noobie, my questions must be silly-silly.
pkgname=iat-git
pkgver=0.1.7
pkgrel=1
pkgdesc="Iso9660 Analyzer Tool is a tool for detecting the structure of many types of image file."
arch=('i686' 'x86_64')
url="http://iat.berlios.de"
license=('GPL')
depends=('')
makedepends=('git')
provides=('iat')
conflicts=('')
source=()
md5sums=()
_gitroot="git://git.berlios.de/iat"
_gitname=master
build() {
msg "Connecting to GIT server..."
if [[ -d $srcdir/$pkgname ]]; then
cd $srcdir/$pkgname && git pull . $_gitname || return 1
else
git clone $_gitroot $srcdir/$pkgname || return 1
cd $srcdir/$pkgname
git checkout $_gitname || return 1
fi
msg "GIT checkout done or server timeout"
./autogen.sh || return 1
./configure --prefix=/usr || return 1
make || return 1
make DESTDIR="$pkgdir/" install
# vim:set ts=2 sw=2 et:
It builds on my machine.
What makes me feel uncomfortable is
$ tree pkg
pkg
`-- usr
|-- bin
| `-- iat
|-- include
| |-- calculate_pregap.h
| |-- cmdline.h
| |-- convert_2_iso.h
| |-- debug.h
| |-- define.h
| |-- ecma119.h
| |-- ecma167.h
| |-- mkcore.h
| |-- mkcue.h
| |-- mktoc.h
| |-- mmc2r11.h
| `-- util.h
`-- share
`-- man
`-- man1
`-- iat.1.gz
define.h? debug.h? util.h?
Those names are too common! My /usr/include/ directory already contains utils.h.
I wonder what would happen if there is already a util.h in my /usr/include?
What do poeple do to avoid conflictions like this?
Well, do I even need to install those *.h files to /usr/include/? Why, that iat in [community] installs only /usr/bin/iat and nothing else. I can't open the SVN entries at the package page so I don't know what is in that PKGBUILD.
Last edited by lolilolicon (2009-08-28 06:28:10)@Allan
Yes you're right. Those files are redundant. The binary alone is enough. Did a great job converting one of my .bin image to .iso.
So I'm gonna up this to AUR? Lemmesee...
@Stefan
Yep, it is overwritten... Strange (or smart!).
It looks like this now.
pkgname=iat-git
pkgver=20090828
pkgrel=1
pkgdesc="Iso9660 Analyzer Tool is a tool for detecting the structure of many types of image file."
arch=('i686' 'x86_64')
url="http://iat.berlios.de"
license=('GPL')
makedepends=('git')
provides=('iat')
conflicts=('iat')
source=()
md5sums=()
_gitroot="git://git.berlios.de/iat"
_gitname=master
build() {
msg "Connecting to GIT server..."
if [[ -d $srcdir/$pkgname ]]; then
cd $srcdir/$pkgname && git pull . $_gitname || return 1
else
git clone $_gitroot $srcdir/$pkgname || return 1
cd $srcdir/$pkgname
git checkout $_gitname || return 1
fi
msg "GIT checkout done or server timeout"
./autogen.sh || return 1
./configure --prefix=/usr --includedir=/usr/include/iat || return 1
make || return 1
make DESTDIR="$pkgdir/" install || return 1
rm -rf $pkgdir/usr/include #comment this out if you want include files...
# vim:set ts=2 sw=2 et:
Last edited by lolilolicon (2009-08-28 07:17:43) -
[SOLVED]Would be grateful for help with im notification shell script
Hi all,
Playing with finch (a console im client), and haven't found any notification plugins for it that work the way I want.
What I have been doing is using tail to watch the logs. As the logs are in html, I use sed to strip the html tags:
tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g'
I would like to use notify-send or dzen2 to create popup windows when the log file changes, but I'm not sure how (I am not an experienced programmer).
This, for example, does not work:
tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' | while read line ; do notify-send "${line}" ; done
Removing sed from the stream above allows notify-send to pop up notifications. How can I have the same happen with sed in there?
Last edited by hellomynameisphil (2011-10-22 17:49:34)hellomynameisphil wrote:
tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' | while read line ; do notify-send "${line}" ; done
Removing sed from the stream above allows notify-send to pop up notifications. How can I have the same happen with sed in there?
The problem here is that sed is buffering its output to improve efficiency in pipes. Try with:
tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' -u | while read line ; do notify-send "${line}" ; done
And should work as well
Regards -
Help with selecting files from script menu or drag and drop
I found this scale images applescript online. It works great when a bunch of files is dragged on top of the script but I would like it to also work when a folder or group of files is selected in the Finder and I activate it from the scripts menu.
I can't get my on run statement to work. I'm not really an Applescript guy so I'm really just asking if someone can help finish what I started in this on run.
-- save in Script Editor as Application
-- drag files to its icon in Finder
property target_width : 120
property save_folder : ""
on run
tell application "Finder"
activate
set folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
on open some_items
-- do some set up
tell application "Finder"
-- get the target width, the default answer is the property target_width
set new_width to text returned of ¬
(display dialog "Target width:" default answer target_width ¬
buttons {"OK"} default button "OK")
if new_width as integer > 0 then
set target_width to new_width
end if
-- if the save_folder property has not been set,
-- set it to the folder containing the original image
if save_folder is "" then
set save_folder to ¬
(container of file (item 1 of some_items) as string)
end if
-- get the folder to save the scaled images in,
-- default folder is the property save_folder
set temp_folder to ¬
choose folder with prompt ¬
"Save scaled images in:" default location alias save_folder
set save_folder to temp_folder as string
end tell
-- loop through the images, scale them and save them
repeat with this_item in some_items
try
rescaleand_save(thisitem)
end try
end repeat
tell application "Image Events" to quit
end open
on rescaleand_save(thisitem)
tell application "Finder"
set new_item to save_folder & "scaled." & (name of this_item)
end tell
tell application "Image Events"
launch
-- open the image file
set this_image to open this_item
set typ to this_image's file type
copy dimensions of this_image to {current_width, current_height}
scale this_image by factor (target_width / current_width)
save this_image in new_item as typ
end tell
end rescaleandsaveWhen items are dragged to your script's icon they are passed in to the on open handler, so this triggers:
on open some_items
and the dragged items are passed in as some_items
In contrast, when you double-click on the script, or invoke it via the Script menu, this runs the on run handler:
on run
tell application "Finder"
activate
folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
However, there's nothing in this block that actually does anything with the selection - you (dangerously) assume that the selection is a folder (you really should check first), and just set theItems to every file in that folder then you exit.
So to do what you want you'll need to edit your run handler to filter the selection and pass files over to the code that does the hard work.
You already have the basis for this - your rescaleandsave() handler, so it's just a matter of identifying the files in the selection and passing those over to that handler:
on run
tell application "Finder"
set cur_selection to (get selection) -- get the selection
repeat with each_item in cur_selection -- iterate through
if class of each_item is folder then -- do we have a folder?
set theFiles to every file of each_item -- if so, get its contents
repeat with each_file in theFiles -- iterate through them
my rescaleand_save(eachfile) -- and process them
end repeat
else if class of each_item is document file then -- do we have a file selected?
my rescaleand_save(eachitem) -- if so, process it
end if
end repeat
end tell
end run
So the idea here is that the run handler gets the selection and works through the (potentially-numerous) items. For each selected item it checks whether its a folder or a file, if its a folder it gets all the files within and passes them to the rescaleandsave handler.
Note that this is not recursive - it won't catch files within folders within folders - since it only looks at the top level of selected folders, but it wouldn't be hard to rework the script to handle that if that's what you need. -
Flash Newbie needs help with Movie Clips/Action Scripting
Hi -
I'm having a problem with my movie clips playing
simultaneously and cannot, for the life of me, figure out what I
have done wrong. I'm new to flash, so I may have set something up
incorrectly, but here's what I have so far:
11 layers, total: 1 layer with 10 control buttons, each
button with the following actionscript:
on (release) {
gotoAndPlay(85);
Where the number changes in relation to which keyframe the
next movie is on.
I have 10 movies, total, but they are only movie clips,
essentially photo slide shows with audio, made all in the library.
The problem happens when I click on the second or third
button. Not only does the movie that I have selected begin to play,
but all of the previous clips do as well, so it all sounds quite
garbled. I don't know what I am missing in the action script, as my
Action Layer has a stop command on it at each keyframe where there
is a new clip to play.
I have tried to add a stopAllSounds command, but I'm afraid
that doesn't do anything because it is not a "sound file" per se,
playing in the timeline.
I'm at the end of my rope and really need some help in
figuring this one out. My project is hanging in the balance on
this, as I have scripted everything else correctly and it runs
beautifully.
Please help!
Thanks,
CarolineEach layer has a blank keyframe before and after each
movieclip. Each movie clip is at a different frame. Even with the
blank keyframes added, the second video starts to play and then the
first video begins to play. Same happens if I click on the third
button. Third plays, and starts 1st and 2nd shortly thereafter. Is
there an action script I can put in that will tell the timeline
that, when a button is clicked, no matter where the movieclip is,
it will stop and start the newly selected movieclip? -
Help with Difficult Sorting Task - Script Inside
Hello,
I have a very time consuming task that I would like to adjust the script below to help cut down the labor. The script below, will ask for a root folder and will copy all the folders inside that root folder to a secondary location. It will only copy the folders and not the files inside them. This works great. But my next step is to manually drag and drop the ".cos" files from the "master drive" from each shot folder to the emtpy "Settings50" folder that has been duplicated to my desktop. Is it possible in any way, to first copy the whole folder structure, and then only copy the "Settings50" folder and the files inside them to the secondary location? The image attached shows what I need duplicated in green and what I do not want duplicated in red. The reason I cannot simply copy the whole root folder is because the RAW files in red are very very large and takes forever to copy. I ONLY need the folder structure duplicated with the Settings50 folder copied with files inside them to a secondary location. If you can help out I would very very much apprecieate it!
on run
set source_folder to choose folder with prompt "Select folder to be duplicated:" as string
my do_main_script(source_folder)
end run
on open of source_folder_list
repeat with i from 1 to number of items in the source_folder_list
set this_folder_path to item i of the source_folder_list as string
if last character of this_folder_path is ":" then
my do_main_script(this_folder_path)
end if
end repeat
end open
on do_main_script(source_folder)
tell application "Finder" to set source_folder to folder (source_folder)
set the target_folder to (choose folder with prompt "Where would you like the duplicated folders to be moved to?")
if source_folder is not "" and target_folder is not "" then
set new_folder_name to (name of source_folder as string) & " duplicate"
set source_folder to source_folder as string
set target_folder to target_folder as string
my create_new_folder(target_folder, new_folder_name)
my duplicate_folder_structure(source_folder, target_folder & new_folder_name & ":")
end if
end do_main_script
on duplicate_folder_structure(source_folder, target_folder)
tell application "Finder"
try
get name of folders of folder (source_folder)
set folder_list to result
repeat with i from 1 to number of items in the folder_list
set this_folder_name to item i of the folder_list as string
my create_new_folder(target_folder, this_folder_name)
my duplicate_folder_structure(source_folder & this_folder_name & ":", target_folder & this_folder_name & ":")
end repeat
end try
end tell
end duplicate_folder_structure
on create_new_folder(target_folder, new_folder_name)
tell application "Finder"
try
if not (exists item (target_folder & new_folder_name)) then
make new folder at folder target_folder with properties {name:new_folder_name}
end if
end try
end tell
end create_new_folder
Thanks!
AnthonyWell, I think this will be close. test it and see what needs to be improved.
on run
set source_folder to choose folder with prompt "Select folder to be duplicated:" as string
my do_main_script(source_folder)
end run
on open of source_folder_list
repeat with this_item in the source_folder_list
if last character of (this_item as string) is ":" then
my do_main_script(this_item as string)
end if
end repeat
end open
on do_main_script(source_folder)
set the target_folder to (choose folder with prompt "Where would you like the duplicated folders to be moved to?")
if source_folder is not "" and target_folder is not "" then
tell application "System Events" to set new_folder_name to (name of source_folder) & " duplicate"
set new_folder to checkForFolder(target_folder as string, new_folder_name)
duplicate_folder_structure(source_folder as string, new_folder)
end if
end do_main_script
on duplicate_folder_structure(source_folder, target_folder)
tell application "System Events"
set folder_list to folders of folder source_folder
repeat with this_folder in the folder_list
set this_folder_name to name of this_folder
set new_folder to my checkForFolder(target_folder as string, this_folder_name)
my duplicate_folder_structure(path of this_folder, new_folder)
end repeat
end tell
tell application "Finder"
set cos_file_list to every file of folder source_folder whose name ends with ".cos"
duplicate cos_file_list to target_folder
end tell
end duplicate_folder_structure
to checkForFolder(fParent, fName)
tell application "System Events"
if not (exists folder fName of folder fParent) then
set output to path of (make new folder at end of folder fParent with properties {name:fName})
else
set output to (path of (folder fName of folder fParent))
end if
end tell
return alias output
end checkForFolder -
Help with EEM TCL / CLI scripting for re-direction/wccp counters
Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection. We are encountering ACL denial issues causing slow down and access issues. The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters. If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups. Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL. I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
sh ip wccp | inc Denied Red
Total Packets Denied Redirect: 0
Total Packets Denied Redirect: 0
Script thus far :
TCL
if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
set wccpcounter 0
} else {
set wccpcounter $result
} if [catch {cli_open} result] {
error $result
} else {
array set cli $result
} if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
error $result
} else {
set cmd_output $result
set count ""
catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
set count
set diff [expr $count - $wccpcounter]
if {$diff != 0} {
action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
error $result
context_save EEM_WCCP_ERROR_COUNTER count
CLI
event manager applet WCCP_COUNTER_WATCH
event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "no ip wccp 61"
action 004 cli command "no ip wccp 62"
action 005 wait 10
action 006 cli command "ip wccp 61"
action 007 cli command "ip wccp 62"
action 008 wait 15
action 009 cli command "clear ip wccp"
action 010 cli command "end"
Thanks for all the helpThis won't work as EEM cannot intercept its own syslog messages. However, I'm not sure why you need this form of IPC anyway. Why not just make the Tcl script perform the needed CLI commands?
And, yes, you could use all applets here. But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script. -
Help with UCCX 8.5 scripting and xmls
I have a customer with multiple scripts, we are moving them from 3.5 to 8.5 which is running on VMWare. Here's my scenario:
The caller can call the trigger 54779, enter a #, then a password of 12345. Then they can set a normal condition by dialing 1, an after-hours condition by dialing 2, or an emergency condition by dialing 3. I’m testing the “2” condition now. In the previous 3.5 system, if they dialed 2, the system copied the Doc “2.xml” and copied it to the Doc "Carolina_Access_Emergency_Check.xml", both of which are in the en_US folder in the Documents section.
I can’t get this thing to change my document "Carolina_Access_Emergency_Check.xml". All I know is that it goes, “unsuccessful”. I’m pretty sure the authentication is working since it gets by that step. If we can’t get the “copy” to work, really all I need to do with this option 2, is for the data in "Carolina_Access_Emergency_Check.xml" in <TYPE>1</TYPE> to change from a 1 to a 2." I'm attaching a zip with the old and new scripts along with the 2 xml files i'm referring to. I need help on this one, please!Has the user you setup have Application Admin rights? I had this issue when I was trying to create an Emergency shutdown script and the user did not have sufficient rights.
I don't mind sharing this script I created ,which effectively changes a value from 1 to a 2, which seems to be what you are trying to do but I can not figure out how to share it with you here. You could then use this as example to achieve what you are trying to do. -
Help with a program Option Script
I need some help writing a Option Frame for a Add-in on my program. The basic thing it will do is to call a KeyListener with a KeyAdapter, wait for a key to be pressed, assign the key that was pressed to an int (i.e. LEFT for e.VK_LEFT) and send it to my main program. I don't have the script completely written yet, but I'm not sure how I can send 7 int values to my main program at the same time. I was thinking of something like:
LEFT = KA_Options.getIntLEFT(int temp_LEFT);but if their is an easier way to get all the int's called at once instead of calling 7 different classes everytime a key is pressed in my main program (because of Beta testing, I don't exactly want to assign them to their own int values intill I get the code almost bug free). I would like to put my main program in this thread, but the hugeness of it, it would make reading the posts hard.
Thanks,
g@m3rThis is the basic working code for my KA_Options script
KA Option Pop-up
Version 0.1b
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class KA_Options extends Frame implements ActionListener
String title= "KA Options 0.1b";
int LEFT, RIGHT, UP, DOWN, A, S, D; //The Directional Ints
MenuBar kamenu = new MenuBar();
Menu file = new Menu("File");
MenuItem file_close = new MenuItem("Close");
Menu options = new Menu("Options");
MenuItem options_default = new MenuItem("Default Controls");
public static void main(String[] args)
KA_Options window = new KA_Options();
public KA_Options()
setTitle(title);
setSize(100,100);
setResizable(false);
setLocation(0,200);
KAMenuSetup_v1b();
setMenuBar(kamenu);
addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
{ setVisible(false); }
pack();
public void KAMenuSetup_v1b() //Beta
kamenu.add(file);
file.add(file_close);
file_close.setActionCommand("Close");
file_close.addActionListener(this);
kamenu.add(options);
options.add(options_default);
//options_default.setActionCommand("Default");
//options_default.addActionListener(this);
public int getIntLEFT()
return LEFT;
public int getIntRIGHT()
return RIGHT;
public int getIntUP()
return UP;
public int getIntDOWN()
return DOWN;
public int getIntA()
return A;
public int getIntS()
return S;
public int getIntD()
return D;
public void actionPerformed(ActionEvent e)
String arg = e.getActionCommand();
if(arg == "Close")
{ setVisible(false); }
} I'm still writing the bulk of the code.
Maybe you are looking for
-
How do I update my IPad air with contacts from a PC?
I have a new Air, and the contacts list from my old Ipad are no longer correct. How do I get an updated contact list from my Outlook 2007 to the new Air. Old guy here, so please dial back the tech jargon. Thank you all
-
Itunes wont open when i click on it but it never tells me why, so i went on troubleshoot and it found some problems and resolved them however it still says that a problem 'incompatible program' was detected and it doesnt give me an option to do anyth
-
Cant Access windows 8 after upgrading to mountain lion
a few weeks ago i upgraded my lion to mountain lion i had windows 8 installed with boot camp on a seperate partition (i only use windows 8 for my astrophotography as certain specilised apps i use are sadly windows only) now as i hadnt had any clear s
-
Office 2013 click-to-run does not honor deselecting 'Make Outlook the default program' checkbox
We use an email client other than Microsoft Outlook (let's say Thunderbird) Thunderbird is set as the default mail client for the machine (HKLM\Software\Clients\Mail\(default) set appropriately) Occasionally, we launch Outlook (but absolutely do not
-
How to change the width of the scrollbar
how to change the width of the scrollbar, I wanted to have a large scrollbar in all controls (for a touch screen app lets say) then is that possible? Either through CSS, code, skins anything really... Any ideas? Thanks in advance.