From 6e737cb4eed4695b9b5d85df64309e3f49cbb5ef Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 18 Dec 2009 21:38:18 +0100 Subject: [PATCH] Introduce non-free area for APT. apt-ftparchive.sh scans /home/ftp/pub/product - for Debian and Ubuntu packages. If .htaccess exist in /home/ftp/pub/product , it is considered non-free and .htacces will used as AP2 access. If .htaccess does not exist product will be part of main. --- update-archive/apt-ftparchive.conf.in | 6 +-- update-archive/apt-release.conf.in | 2 +- update-archive/update-archive.sh | 93 +++++++++++++++++++-------------- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/update-archive/apt-ftparchive.conf.in b/update-archive/apt-ftparchive.conf.in index c0bfa35..a93988d 100644 --- a/update-archive/apt-ftparchive.conf.in +++ b/update-archive/apt-ftparchive.conf.in @@ -26,15 +26,15 @@ Default { // }; TreeDefault { - Directory "pool/$(DIST)/$(ARCH)"; - SrcDirectory "pool/$(DIST)/source"; + Directory "pool/$(DIST)/$(SECTION)/$(ARCH)"; + SrcDirectory "pool/$(DIST)/$(SECTION)/source"; Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages"; Sources "$(DIST)/$(SECTION)/source/Sources"; Contents "$(DIST)/Contents-$(ARCH)"; }; Tree "dists/@dist@" { - Sections "main"; + Sections "main non-free"; Architectures "source @architectures@"; SrcOverride "/dev/null"; }; diff --git a/update-archive/apt-release.conf.in b/update-archive/apt-release.conf.in index 49ec1a2..ad82cad 100644 --- a/update-archive/apt-release.conf.in +++ b/update-archive/apt-release.conf.in @@ -3,5 +3,5 @@ APT::FTPArchive::Release::Label "Indexdata"; APT::FTPArchive::Release::Suite "@dist@"; APT::FTPArchive::Release::Codename "@dist@"; APT::FTPArchive::Release::Architectures "@architectures@"; -APT::FTPArchive::Release::Components "main"; +APT::FTPArchive::Release::Components "main non-free"; APT::FTPArchive::Release::Description "Index Data Debian packages"; diff --git a/update-archive/update-archive.sh b/update-archive/update-archive.sh index 17d4b29..f7a6252 100755 --- a/update-archive/update-archive.sh +++ b/update-archive/update-archive.sh @@ -29,51 +29,64 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm # Uncomment to clean the .db (cache) # rm tmp/* - # Prepare pool - d=pool/dists/$dist - if test ! -d $d; then mkdir -p $d; fi - mkdir -p $d/source - # Remove invalid symlinks (source, i386, amd64,..) - for l in $d/*/*; do - if test -L $l; then - if test ! -f $l; then - rm $l + for section in main non-free; do + # Prepare pool + d=pool/dists/$dist/$section + if test ! -d $d; then mkdir -p $d; fi + mkdir -p $d/source + # Remove invalid symlinks (source, i386, amd64,..) + for l in $d/*/*; do + if test -L "$l"; then + if test ! -f "$l"; then + rm $l + fi fi - fi - done - # Make symlinks from the regular FTP archive - ln -sf /home/ftp/pub/*/$vendor/$dist/*.dsc $d/source - ln -sf /home/ftp/pub/*/$vendor/$dist/*.gz $d/source - for arch in $architectures; do - mkdir -p $d/${arch} - for f in /home/ftp/pub/*/$vendor/$dist/*_${arch}.* \ - /home/ftp/pub/*/$vendor/$dist/*_all.*; do - if test -f $f; then - ln -sf $f $d/${arch} + done + # Make symlinks from the regular FTP archive + for pdir in /home/ftp/pub/*; do + use=false + if test -f $pdir/.htaccess -a $section = "non-free"; then + use=true + fi + if test ! -f $pdir/.htaccess -a $section = "main"; then + use=true + fi + if $use; then + distdir=$pdir/$vendor/$dist + if test -d $distdir; then + ln -sf $distdir/*.dsc $d/source + ln -sf $distdir/*.gz $d/source + for arch in $architectures; do + mkdir -p $d/${arch} + for f in $pdir/.htaccess \ + $distdir/*_${arch}.* \ + $distdir/*_all.*; do + if test -f $f; then + ln -sf $f $d/${arch} + fi + done + done + fi fi done - #ln -sf /home/ftp/pub/*/$vendor/$dist/*_${arch}.* $d/${arch} - #ln -sf /home/ftp/pub/*/$vendor/$dist/*_all.* $d/${arch} - done - - # ${confdir}/symclean.sh $d - - for arch in $architectures; do - d=dists/$dist/main/binary-$arch - if test ! -d $d; then mkdir -p $d; fi - echo "Archive: $dist" >$d/Release - echo 'Component: main' >>$d/Release - echo 'Origin: Indexdata' >>$d/Release + # ${confdir}/symclean.sh $d + + for arch in $architectures; do + d=dists/$dist/$section/binary-$arch + if test ! -d $d; then mkdir -p $d; fi + echo "Archive: $dist" >$d/Release + echo "Component: $section" >>$d/Release + echo 'Origin: Indexdata' >>$d/Release echo "Architecture: $arch" >>$d/Release + done + + d=dists/$dist/$section/source + if test ! -d $d; then mkdir -p $d; fi + echo "Archive: $dist" >$d/Release + echo "Component: $section" >>$d/Release + echo 'Origin: Indexdata' >>$d/Release + echo 'Architecture: source' >>$d/Release done - - d=dists/$dist/main/source - if test ! -d $d; then mkdir -p $d; fi - echo "Archive: $dist" >$d/Release - echo 'Component: main' >>$d/Release - echo 'Origin: Indexdata' >>$d/Release - echo 'Architecture: source' >>$d/Release - # generate echo "Begin Generate $dist" F=apt-ftparchive.conf -- 1.7.10.4