Find patches not available in linux

Source: Internet
Author: User
Find out the patches not available in linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. I first used a perl program to read the patch directory on ftp.kernl.org in a file list. Then I used shell to find the unpatched patch. It was written in C at the beginning, and it was quite troublesome, so I wrote it while watching the shell.

The perl program is as follows:
CODE :#! /Usr/bin/perl
Use Net: FTP;

My $ host = "www.kernel.org ";
My $ directory = "pub/linux/kernel/v2.6 ";
$ Ftp = Net: FTP-> new ($ host, Timeout => 240) or $ newerr = 1;
Push @ ERRORS, "Can't connect to ftp $ host: $! \ N "if $ newerr;
Myerr () if $ newerr;
Print "Connected \ n ";
$ Ftp-> login ("anonymous", "drinkey@163.com") or $ newerr = 1;
Print "Getting file list \ n ";
Push @ ERRORS, "Can't login to $ host: $! \ N "if $ newerr;
$ Ftp-> quit if $ newerr;
Myerr () if $ newerr;
Print "Logged in \ n ";

$ Ftp-> cwd ($ directory) or $ newerr = 1;
Push @ ERRORS, "Can't cd $! \ N "if $ newerr;
Myerr () if $ newerr;
$ Ftp-> quit if $ newerr;

Open (DIRC, "> list") or die "$! \ N ";
@ Files = $ ftp-> dir or $ newerr = 1;
Push @ ERRORS, "Can't get file list $! \ N "if newerr;
Print "Got file list \ n ";
Foreach (@ files ){
If ($ _ = ~ /Patch/& amp; $ _!~ /Sign/& amp; $ _!~ /Gz /){
Print DIRC "$ _ \ n ";
}
}
$ Ftp-> quit;
Sub myerr {
Print "Error: \ n ";
Print @ ERRORS;
Exit 0;
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.