• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • AudioLink
  • Mailing Lists

[AudioLink-cvs]audiolink/code alsearch,1.24,1.25

Status: Alpha
Brought to you by: amitshah
  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • Bugs
  • News
  • Git
  • CVS
Menu ▾ ▴
  • audiolink-cvs

[AudioLink-cvs]audiolink/code alsearch,1.24,1.25

[AudioLink-cvs]audiolink/code alsearch,1.24,1.25
From: <ami...@us...> - 2003-12-05 12:32:42
Update of /cvsroot/audiolink/audiolink/code
In directory sc8-pr-cvs1:/tmp/cvs-serv5956

Modified Files:
	alsearch 
Log Message:
1. config file isn't perl code now; simple "a = b" stuff
2. command-line args override config file options


Index: alsearch
===================================================================
RCS file: /cvsroot/audiolink/audiolink/code/alsearch,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** alsearch	4 Dec 2003 16:13:07 -0000	1.24
--- alsearch	5 Dec 2003 12:32:39 -0000	1.25
***************
*** 141,151 ****
  
  # execution starts here
- $config_file = "$ENV{HOME}/.audiolink/config";
- 
- unless ($file_ret = do $config_file) {
-     die "Couldn't parse the config file, $config_file: $@" if $@;
-     die "Couldn't read the config file, $config_file: $!";
-     die "Some problem occured with the config file, $config_file";
- }
  
  # check for command-line arguments
--- 141,144 ----
***************
*** 183,186 ****
--- 176,198 ----
  }
  
+ $config_file = "$ENV{HOME}/.audiolink/config";
+ 
+ if (-e $config_file) {
+     open(CONFFILE, $config_file);
+ 
+     # go through the config file
+     while (<CONFFILE>) {
+ 	if (/^\s*user\s*\=+\s*(\w+)/) {
+ 	    chomp($user = $1) unless $user;
+ 	} elsif ( /^\s*pass(word)?\s*=\s*(\w+)/) {
+ 	    chomp($password = $2) unless $password;
+ 	} elsif ( /^\s*host\s*=\s*(\w+)/) {
+ 	    chomp($host = $1) unless $host;
+ 	}
+     }
+ } else {
+     warn "WARNING: config file not found. Use the audiolink script to create one.\n";
+ }
+ 
  my $i = 0;
  
***************
*** 218,223 ****
  $dbh = DBI->connect($dbi_string,$user,$password) 
      or die "$0: Error: Could not connect to the database! \
!  Make sure that the DBI_PASS and DBI_USER environment variables are set.\n";
! 
  
  if ($target_dir_name) {
--- 230,234 ----
  $dbh = DBI->connect($dbi_string,$user,$password) 
      or die "$0: Error: Could not connect to the database! \
!  Check the user, password and host fields for the MySQL connection.";
  
  if ($target_dir_name) {





View entire thread

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2025 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
×
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
✔
✘
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL: