-
- 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
- sed "s/@dist@/$dist/g" <${confdir}/${F}.in |sed "s/@architectures@/${architectures}/g" > $F
- # Don't know if clean is needed!
- # apt-ftparchive clean apt-ftparchive.conf
- apt-ftparchive generate apt-ftparchive.conf
- echo "Done generate $dist"
-
- # release
- r=dists/$dist/Release
- F=apt-release.conf
- sed "s/@dist@/$dist/g" <${confdir}/${F}.in | sed "s/@architectures@/${architectures}/g" >$F
- # Move Release file away while calling using release
- rm $r
- apt-ftparchive -c $F release dists/$dist >tmp_Release
- mv tmp_Release $r
-
- # sign
- if true; then
- r=dists/$dist/Release
+ if test -n "$sections"; then
+ F=apt-ftparchive.conf
+ sed "s/@dist@/$fdist/g" <${confdir}/${F}.in | \
+ sed "s/@architectures@/${architectures}/g" | \
+ sed "s/@sections@/${sections}/g" > $F
+ apt-ftparchive generate apt-ftparchive.conf 2>&1
+ r=dists/$fdist/Release
+ rm -f $r # Move Release file away while calling using release
+ apt-ftparchive -c $F release dists/$fdist >tmp_Release
+ if $noauto; then
+ sed -e 's/^Suite:/NotAutomatic: yes\nButAutomaticUpgrades: yes\nSuite:/g' <tmp_Release >$r
+ else
+ mv tmp_Release $r
+ fi