diff -Nru ppasearch-0.6.2/debian/changelog ppasearch-0.6.4/debian/changelog --- ppasearch-0.6.2/debian/changelog 2010-07-18 22:52:32.000000000 +0100 +++ ppasearch-0.6.4/debian/changelog 2010-08-03 15:40:00.000000000 +0100 @@ -1,5 +1,5 @@ -ppasearch (0.6.2-0ubuntu1~karmic) karmic; urgency=low +ppasearch (0.6.4-0ubuntu1~karmic) karmic; urgency=low - * Sixth point two. Fixes dependency problem.`` + * Sixth point four. Added option to update sources.`` - -- David Ainley Sun, 18 Jul 2010 17:47:24 -0400 + -- David Ainley Tue, 03 Aug 2010 10:39:47 -0400 diff -Nru ppasearch-0.6.2/ppasearch ppasearch-0.6.4/ppasearch --- ppasearch-0.6.2/ppasearch 2010-07-13 23:48:33.000000000 +0100 +++ ppasearch-0.6.4/ppasearch 2010-08-01 13:51:08.000000000 +0100 @@ -6,7 +6,11 @@ require 'net/https' require 'openssl' require 'optparse' - + +#to stop a problem from coming out when the program is exited via cntrl+c +stty_save = `stty -g`.chomp +trap('INT') { system('stty', stty_save); exit } + # This hash will hold all of the options # parsed from the command-line by # OptionParser. @@ -25,7 +29,7 @@ end opts.on( '-c', '--changes', 'Display changes for current version.' ) do -puts "Changes for ppasearch version 0.6 => added parameters." +puts "Changes for ppasearch version 0.6.3 => added easy source updating." exit end end @@ -72,7 +76,7 @@ #this makes a nice list of data needed for the users choice later on. (linkz).inject([]) do |links,anchor| - sweetassarray << anchor.attributes['href'] +sweetassarray << anchor.attributes['href'] end #creating an array to be used later, to keep the names / numbers of ppas orderly. @@ -124,9 +128,22 @@ else end +puts "Do you want to update your sources now? [Y/N]" +updateanswer=STDIN.gets + +if updateanswer.include? 'Y' +system ('sudo apt-get update') +else +end + +if updateanswer.include? 'y' +system ('sudo apt-get update') +else +end + #creates the last array lastarray = Array.new else puts "No results found. Try refining your search." -end \ No newline at end of file +end