#!/usr/bin/env perl # The above is a portable way to invoke Perl, according to the GNU Autotools # book. It is useful since we don't know where perl is installed. # # evolution-move-tasks: a Perl script to move tasks from the Calendar folder # to the new Tasks folder. # use diagnostics; # You may have to change this if your Evolution files are somewhere else. $EVOLUTION_DIR = "$ENV{'HOME'}/evolution"; $CALENDAR_DIR = "$EVOLUTION_DIR/local/Calendar"; $TASKS_DIR = "$EVOLUTION_DIR/local/Tasks"; # Create the Tasks folder if needed. &EnsureTasksFolderExists ($TASKS_DIR); # Get any tasks from the calendar .ics file. $tasks = &LoadTasks ("$CALENDAR_DIR/calendar.ics"); # Get any tasks already in the tasks .ics file. $tasks .= &LoadTasks ("$TASKS_DIR/tasks.ics"); # Create a new Tasks .ics file containing all the tasks. &OutputTasks ("$TASKS_DIR/tasks.new", $tasks); # Move the existing tasks file to a backup. if (-e "$TASKS_DIR/tasks.ics") { rename "$TASKS_DIR/tasks.ics", "$TASKS_DIR/tasks.bak" || die "Can't rename $TASKS_DIR/tasks.ics to $TASKS_DIR/tasks.bak"; } # Move the new file into position. rename "$TASKS_DIR/tasks.new", "$TASKS_DIR/tasks.ics" || die "Can't rename $TASKS_DIR/tasks.new to $TASKS_DIR/tasks.ics"; # Move the new Calendar file (without the Tasks) into position. rename "$CALENDAR_DIR/calendar.ics.new", "$CALENDAR_DIR/calendar.ics" || die "Can't rename $TASKS_DIR/tasks.new to $TASKS_DIR/tasks.ics"; 0; # If the evolution/local/Tasks folder does not exist, this creates it and # creates the metadata XML file. sub EnsureTasksFolderExists { my ($tasks_dir) = @_; return if (-e $tasks_dir); print "Creating Tasks folder in: $tasks_dir\n"; mkdir ($tasks_dir, 0777) || die "Can't create Tasks folder directory: $tasks_dir"; $metadata = "$tasks_dir/folder-metadata.xml"; open (METADATA, ">$metadata") || die "Can't create metadata file: $metadata"; print METADATA < tasks Tasks EOF close (METADATA); } sub LoadTasks { my ($icalendar_file) = @_; return "" if (! -e $icalendar_file); open (ICSFILE, $icalendar_file) || die "Can't open iCalendar file: $icalendar_file"; open (NEWICSFILE, ">$icalendar_file.new") || die "Can't open iCalendar file: $icalendar_file.new"; $tasks = ""; $in_task = 0; while () { if ($in_task) { $tasks .= $_; if (m/^END:VTODO/) { $in_task = 0; } } else { if (m/^BEGIN:VTODO/) { print "Found task\n"; $tasks .= $_; $in_task = 1; } else { print NEWICSFILE $_; } } } close (NEWICSFILE); close (ICSFILE); return $tasks; } sub OutputTasks { my ($icalendar_file, $tasks) = @_; open (ICSFILE, ">$icalendar_file") || die "Can't create iCalendar file: $icalendar_file"; print ICSFILE <archivers/makeself
'master'>master
Commit message (Expand)AuthorAgeFilesLines
* Remove ${PORTSDIR}/ from dependencies, Mk and categories a, b, and c.mat2016-04-01lass='insertions'>+1
* Reduce unnecessary bsd.port.options.mk inclusions by using OPTIONS helpers.adamw2014-07-041-0/+2
* Support stagebapt2013-12-261-15/+6
FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Perl is only needed for building this.trevor2004-04-071-1/+1
* Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-051-1/+1
* Borrow from the OpenLDAP ports, and refuse to build if bind has beenmarcus2004-03-191-0/+6
* Fix build with freetype2-2.1.7.marcus2004-03-171-0/+12
* Chase the new location of libXft.marcus2004-03-171-1/+1
* If building with debugging, don't enable binary stripping.marcus2004-03-051-1/+2
* Fix up the port-install substitutions so that we operate on the correct files.marcus2004-02-141-2/+2
* Remove the ugly libnspr hack, and be a little more clever when addingmarcus2004-02-132-5/+41
* Fix the window ID in firefox.rb (new PORTREVISION).trevor2004-02-132-2/+2
* Add a symlink from libnspr4.so to libnspr4.so.1 in the LOCAL_PREFIX tomarcus2004-02-121-0/+3
* * Add ${LOCALBASE} to the list of include and lib search paths so we canmarcus2004-02-121-5/+7
* Avoid REINPLACE_CMD dependency.trevor2004-02-121-6/+6
* We don't need to use "touch" to make an empty PLIST file.trevor2004-02-121-1/+0
* Add comments explaining the installation process.trevor2004-02-121-0/+7
* Don't install unnecessary MacOS/Windows-related material.trevor2004-02-121-0/+6
* * Fix broken installation (grrr..this fake thing is more trouble than it'smarcus2004-02-122-12/+26
* Backuo the previous commit before anyone notices. I have a big patch comingmarcus2004-02-122-2/+2
* Fix accidental change of %%PREFIX%% to %PREFIX%% intrevor2004-02-122-2/+2
* Fix a bug where @PREFIX@ was being substituted with the fake package prefixmarcus2004-02-111-1/+2
* * Import the JPI_LIST changes from www/mozilla so that multiple JPI versionsmarcus2004-02-112-6/+15
* Add Firefox after a repo copy from mozilla-firebird. Firefox is the nextmarcus2004-02-1130-3695/+182
* * Fix a bug where Firebird would lock up after typing any text. This had tomarcus2004-02-093-79/+83
* Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-1/+1
* Port ia64 support from www/mozilla.marcel2004-02-026-11/+74
* Use the SORT macro defined in bsd.port.mk.trevor2004-01-221-2/+0
* Port to amd64 (note: needs ld-elf.so.1 bugfix to actually work)peter2003-12-1413-122/+680
* Don't build these ports on amd64.marcus2003-11-241-0/+2
* Add a new patch-Double.cpp that fixes the recent core dumps during post-buildmarcus2003-11-171-6/+54
* * Update the extensions list with a modern mozconfig.inmarcus2003-10-243-106/+46
* Correct the packing list.trevor2003-10-221-2/+0
* Update to 0.7 with patch-config_preprocess.pl updated by obraun.trevor2003-10-197-6850/+3488
* Mark as IGNORE on -STABLE Alpha.marcus2003-10-131-0/+4
* Use ${PTHREAD_LIBS} instead of hardcoded -pthread and -lc_r in a few places.marcus2003-09-071-0/+7
* Add back the PKGNAMEPREFIX was the accidentally removed in my previousmarcus2003-09-041-0/+1
* Change the MASTER_SITE back to the official Mozilla FTP servers. Note,marcus2003-08-252-7/+4
* Restore the patch to stop mozilla from crashing on some russian sites.kan2003-08-121-0/+57
* Fix the PLIST link.marcus2003-08-071-2/+2
* Fix the GTK+-1.2 plist. To do this, we create one plist for GTK1 and one formarcus2003-08-013-0/+3394
* Update to 0.6.1. This is mainly a bug fix release according to the releasemarcus2003-07-306-3447/+3425
* Create a static plist file to fix the package building problem with themarcus2003-07-252-6/+3361
* Try my hand at removing the Perl 5.6.1 dependency. This port now buildsmarcus2003-06-192-6/+61
* Use ${PERL5} to properly locate perl.marcus2003-06-032-1/+2
* Add mozilla-firebird after a repo move from phoenix.marcus2003-06-0316-85/+1146
* transfer to gnome@alane2003-05-211-2/+2
* Remove USE_GNOMENG.marcus2003-04-211-1/+0
* Clear moonlight beckons.ade2003-03-072-1/+1
* Remove the renaming of Xft headers and library from the Xft (Xft2) port.anholt2003-02-181-7/+1
* remove ignore setting based on lfp fontsalane2003-01-181-19/+0
* add missing dependencyalane2002-12-221-1/+2
* Patch by Greg Rumple & JMC to hopefully fix end-of-download crash. I'llalane2002-12-184-3/+139
* Fix really messed up BROKEN= blocks that happened with 0.5.alane2002-12-161-11/+10
* Put back link to java now that fonts have been identified as cause ofalane2002-12-151-2/+2
* The problem wasn't the patch, it was third party font ports. The patch hasalane2002-12-153-6/+67
* Finally, a release Phoenix that works and does not crash all the time.alane2002-12-135-72/+67
* Backed down to 0.4_10 because 0.5 was borked.alane2002-12-103-6/+12