Changeset 10280


Ignore:
Timestamp:
2008-01-27T16:08:58+01:00 (10 years ago)
Author:
nbd
Message:

scripts/feeds: Add support for git feeds.

Invokes 'git clone' on initial feed-update and 'git pull' later on.

Signed-off-by: Michel Marti <mcdmx@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/feeds

    r10252 r10280  
    7777 
    7878        system("ln -sf $src ./feeds/$name"); 
     79        -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1; 
     80        -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1; 
     81 
     82        system("make -s prepare-mk TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\""); 
     83        system("make -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=4 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\""); 
     84        system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index"); 
     85 
     86        return 0; 
     87} 
     88 
     89sub update_git($$) { 
     90        my $name = shift; 
     91        my $src = shift; 
     92 
     93    if ( ! -d "./feeds/$name" ) { 
     94        system("git clone $src ./feeds/$name") == 0 or return 1; 
     95    } else { 
     96        system("GIT_DIR=./feeds/$name/.git git pull") == 0 or return 1; 
     97    } 
     98 
    7999        -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1; 
    80100        -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1; 
     
    345365        'src-svn' => \&update_svn, 
    346366        'src-cpy' => \&update_cpy, 
    347         'src-link' => \&update_link 
     367        'src-link' => \&update_link, 
     368        'src-git' => \&update_git 
    348369); 
    349370 
Note: See TracChangeset for help on using the changeset viewer.