###### # # E-scripts on apt, "Packages" files, apt caches... # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at # or at . # See also , # , # , # , # and . # ####### # «.Packages» (to "Packages") # «.override» (to "override") # «.rebuilding-the-Packages-file» (to "rebuilding-the-Packages-file") # «.Release» (to "Release") # «..disk» (to ".disk") # «.apt-move» (to "apt-move") # «.apt-move0» (to "apt-move0") # «.missing_upstream_debs1» (to "missing_upstream_debs1") # «.mini-potato» (to "mini-potato") # «.mini-potato:override» (to "mini-potato:override") # «.mini-potato:Packages» (to "mini-potato:Packages") # «.mini-potato:Release» (to "mini-potato:Release") # «.mini-potato:.disk» (to "mini-potato:.disk") # «.mini-potato:disks-i386» (to "mini-potato:disks-i386") # «.mini-potato:other_files» (to "mini-potato:other_files") # «.apt-get_update_upgrade» (to "apt-get_update_upgrade") # «.apt-howto» (to "apt-howto") # «.apt-get-source» (to "apt-get-source") # (find-fline "/etc/apt/sources.list") ##### # # Notes about apt and the many styles of .deb names # 2000jun13 # ##### A .deb starts (huh) as a .dsc, a .orig.tar.gz and a .diff.gz, that are uncompressed in a directory that has a name taken from the .dsc; running the debian/rules script on that dir we generates one or more .debs with names not necessarily similar to the .dsc and the directory (see the "control" files) and that have endings like _all.deb or _i386.deb; then we usually strip the "_all" or "_i386" part and move the .debs to the "local" sections of our repository of .debs (the other sections are generally parts of a mirror of (ftp|http).debian.org). If our local .debs are serious enough (if they have a "section" field in their control files?) then some tool that I don't know should be able to move them to an "upstream" place in main, contrib, non-free or non-US. The "binary-all" directories exist only to save space; things would work the same if we moved copies of its packages to each binary_arch directory. Apt never touches the "binary-all" dirs, except if it gets there through simlinks. Apt is able to check for new versions in the upstream distribution by reading the remote "Packages" files. It can download the new .debs and store them in /var/cache/apt/, where they get the long names with "_" and with epochs (but as ':'s as '%3a's: "bsdutils_1%3a2.10f-5_i386.deb", for example). I don't know if the long nomes of the .debs built from source also have explicit epochs. # (find-fline "/usr/bin/apt-move" "%3a") ##### # # apt # 2000apr01 # ##### # (find-status "apt") # (find-vldifile "apt.list") # (find-fline "/usr/doc/apt/") # (find-fline "/usr/doc/apt/guide.text.gz") # (find-fline "/usr/doc/apt/guide.text.gz" "apt-get check") # (find-fline "/usr/doc/apt/offline.text.gz") # (find-fline "/usr/doc/apt/offline.text.gz" "--print-uris") # (find-fline "/usr/doc/apt/examples/") # (find-fline "/usr/doc/apt/examples/sources.list") # (find-fline "/usr/doc/apt/examples/apt.conf.gz") # (find-udw3 "apt/guide.html/") # (find-udw3 "apt/guide.html/ch4.html" "Extra") # (find-udw3 "apt/offline.html/") dpkg -l |& tee ~/o # (find-fline "~/o") # (eeman "apt-get") # (eeman "apt-cache") # (eeman "apt-config") # (eeman "apt-cdrom") ##### # # The "Packages" files # 2000jul04 # ##### # «Packages» (to ".Packages") # (find-es "apt" "mini-potato:Packages") cd /new/potatojun2000/dists/potato/ ar p main/binary-i386/devel/icont_9.3.2-2.deb control.tar.gz \ | tar -xOzf - ./control \ > /tmp/control # (find-fline "$SDEBIAN/indices/override.potato" "icont") # (find-fline "$SPOTATO/main/binary-i386/Packages" "age: icont\n") # (find-fline "$SDEBIAN/indices/Packages-Master-i386" "age: icont\n") # (find-status "icont") # (find-fline "/tmp/control") # (find-pl5file "Debian/Package/") # (find-pl5file "Dpkg/Package/") dpkg -S '*Package*' # (find-debfaqfile "debian-faq.en.txt.gz" "Packages.gz") # (find-debfaqfile "debian-faq.en.txt.gz" "reads the file \"Packages.gz\"") # (find-es "dpkg" "dpkg-dev") # (eeman "8 dpkg-scanpackages") # (find-fline "/usr/bin/dpkg-scanpackages") ##### # # The "override" files # 2000jul04 # ##### # «override» (to ".override") # (find-es "apt" "mini-potato:override") # (find-fline "$SDEBIAN/indices/") # (find-fline "$SDEBIAN/indices/override.potato") # (find-fline "$SDEBIAN/indices/override.potato.contrib") # (find-fline "$SDEBIAN/indices/override.potato.non-free") # (find-fline "$SNUDEBIAN/indices/") # (eeman "8 dpkg-scanpackages" "THE OVERRIDE FILE") ##### # # dpkg-scanpackages # 2000jun06 # ##### # (eeman "8 dpkg-scanpackages") # (eeman "8 dpkg-scanpackages" "THE OVERRIDE FILE") # (find-fline "$SDEBIAN/indices/") # (find-es "dpkg" "dpkg-dev") dmissingp dpkg-scanpackages ##### # # Rebuilding the "Packages" files # 2000mar27 # ##### # «rebuilding-the-Packages-file» (to ".rebuilding-the-Packages-file") psnedeb <<'---' 408260 indices/Packages-Master-i386.gz 1053 indices/override.potato.contrib.gz 25044 indices/override.potato.gz 2587 indices/override.potato.non-free.gz 931 indices/override.slink.contrib.gz 14837 indices/override.slink.gz 2417 indices/override.slink.non-free.gz --- # (find-fline "$SDEBIAN/indices/") # (find-fline "$SDEBIAN/indices/Packages-Master-i386.gz") # (find-fline "$SDEBIAN/ls-lR.i" "Packages") # (find-fline "$SDEBIAN/dists/potato/contrib/binary-i386/Packages") # (find-fline "$SDEBIAN/dists/potato/main/binary-i386/Packages") # (find-fline "$SDEBIAN/dists/potato/non-free/binary-i386/Packages") # (find-fline "$SNUDEBIAN/dists/potato/non-US/main/binary-i386/Packages") # (find-fline "$SNUDEBIAN/dists/potato/non-US/non-free/binary-i386/Packages") # (find-fline "$SDEBIAN/dists/potato/contrib/binary-i386/Release") # (find-fline "$SDEBIAN/dists/potato/main/binary-i386/Release") # (find-fline "$SDEBIAN/dists/potato/non-free/binary-i386/Release") # (find-fline "$SNUDEBIAN/dists/potato/non-US/main/binary-i386/Release") # (find-fline "$SNUDEBIAN/dists/potato/non-US/non-free/binary-i386/Release") cd /big/potato/ (dpkg-scanpackages dists/frozen/contrib/binary-i386 \ $SDEBIAN/indices/override.potato.contrib \ > /tmp/Packages.contrib ) |& tee /tmp/o.contrib cd /big/potato/ (dpkg-scanpackages dists/frozen/non-free/binary-i386 \ $SDEBIAN/indices/override.potato.non-free \ > /tmp/Packages.non-free ) |& tee /tmp/o.non-free cd /big/potato/ (dpkg-scanpackages dists/frozen/main/binary-i386 \ $SDEBIAN/indices/override.potato \ > /tmp/Packages.main ) |& tee /tmp/o.main cp -v /tmp/Packages.contrib \ /big/potato/dists/potato/contrib/binary-i386/Packages cp -v /tmp/Packages.non-free \ /big/potato/dists/potato/non-free/binary-i386/Packages cp -v /tmp/Packages.main \ /big/potato/dists/potato/main/binary-i386/Packages # emacs lisp stuff... (set-windows 10 0 ' (find-fline "/tmp/Packages.contrib") 10 0 ' (find-fline "$SDEBIAN/dists/potato/contrib/binary-i386/Packages") 10 0 ' (find-fline "$SDEBIAN/indices/override.potato.contrib") 10 0 ' (find-fline "/tmp/o.contrib" "missing from override file:") ) (set-windows 10 0 ' (find-fline "/tmp/Packages.non-free") 10 0 ' (find-fline "$SDEBIAN/dists/potato/non-free/binary-i386/Packages") 10 0 ' (find-fline "$SDEBIAN/indices/override.potato.non-free") 10 0 ' (find-fline "/tmp/o.non-free" "missing from override file:") ) (set-windows 10 0 ' (find-fline "/tmp/Packages.main") 10 0 ' (find-fline "$SDEBIAN/dists/potato/non-free/binary-i386/Packages") 10 0 ' (find-fline "$SDEBIAN/indices/override.potato") 10 0 ' (find-fline "/tmp/o.main" "missing from override file:") ) # (find-node "(zsh)Redirection") # (find-fline "/usr/bin/dpkg-scanpackages") ##### # # apt source # 2000jun13 # ##### # (find-status "apt") # (find-vldifile "apt.list") # (find-fline "/usr/doc/apt/") pdsc $SDEBIAN/dists/potato/main/source/admin/apt_0.3.11.dsc /usr/src/apt-0.3.11/ # (find-aptsrcfile "") # (find-aptsrcfile "apt-pkg/") # (find-aptsrcfile "apt-pkg/packagemanager.cc") # (find-aptsrcfile "apt-pkg/packagemanager.h") # (find-aptsrcfile "apt-pkg/pkgcache.cc") # (find-aptsrcfile "apt-pkg/pkgcache.h") # (find-aptsrcfile "apt-pkg/pkgcachegen.cc") # (find-aptsrcfile "apt-pkg/pkgcachegen.h") # (find-aptsrcfile "apt-pkg/pkgrecords.cc") # (find-aptsrcfile "apt-pkg/pkgrecords.h") # (find-aptsrcfile "doc/files.sgml" "Binary Package Cache") # (find-aptsrcfile "doc/cache.sgml") # (find-aptsrcfile "doc/") # (find-aptsrcfile "doc/apt-cdrom.8.yo") ##### # # Dumping apt's /var/cache/apt/{,src}pkgcache.bin files # 2000jun13 # ##### # (eeman "8 apt-cache") apt-cache stats apt-cache dump apt-cache dumpavail > ~/o # (find-fline "~/o") grep-dctrl '' -s Package,Source,Version,Filename ~/o \ | tee ~/o2 # (find-fline "~/o2") # Oops - at which point do the packages get the "Filename" field? I # don't think it's present at packages that I recompile myself... # (find-fline "/usr/bin/dpkg-scanpackages" "has Filename field!") # (find-fline "/usr/src/.debs/") ar p /usr/src/.debs/dbuild_1.15_all.deb control.tar.gz \ | tar -O -xvzf - control ar p $POTATO/main/binary-i386/devel/dbuild_1.15.1.deb control.tar.gz \ | tar -O -xvzf - ./control # Weird: local has filenames with "./", upstream has filenames without! ##### # # The "Release" files # 2000jun13 # ##### # «Release» (to ".Release") # (find-es "apt" "mini-potato:Release") # (find-aptsrcfile "") # (find-aptsrcfile "doc/files.sgml" " The Release File") # (find-fline "$SPOTATO/") # (find-fline "$SPOTATO/main/binary-i386/Release") # (find-fline "$SPOTATO/contrib/binary-i386/Release") # (find-fline "$SPOTATO/non-free/binary-i386/Release") # (find-fline "$SDEBIAN/dists/potato/contrib/binary-i386/Release") # (find-fline "$SDEBIAN/dists/potato/main/binary-i386/Release") # (find-fline "$SDEBIAN/dists/potato/non-free/binary-i386/Release") # (find-fline "$SNUDEBIAN/dists/potato/non-US/main/binary-i386/Release") # (find-fline "$SNUDEBIAN/dists/potato/non-US/non-free/binary-i386/Release") # (find-fline "/var/state/apt/lists/") ##### # # The ".disk" directory of cdroms # 2000jun13 # ##### # «.disk» (to "..disk") # (find-es "dpkg" ".disk/info") # (find-aptsrcfile "doc/files.sgml" "'.disk/info'") # (find-aptsrcfile "doc/apt-cdrom.8.yo" "does not have a proper bf(.disk/)") # (find-aptsrcfile "cmdline/apt-cdrom.cc" ".disk") # (eeman "8 apt-cdrom" "\\.disk") # (find-fline "/var/state/apt/") # (find-fline "/var/state/apt/cdroms.list") # (find-fline "/usr/share/debian-cd/Makefile" ".disk") # (find-fline "/hdc6/bin1/.disk/info") # Debian GNU/Linux slink (2.1) 1/4 main binary-i386 section 1 SAM19990627 # (find-fline "/usr/share/debian-cd/Makefile" "BINDISKINFO") # (find-fline "/usr/share/debian-cd/CONF.sh") # (find-fline "/usr/share/debian-cd/tools/add_dirs") cd /usr/share/debian-cd/ agrep BINDISKINFO $(find *) ##### # # apt-move (trying again) # 2000dec19 # ##### # «apt-move» (to ".apt-move") # laf /etc/apt-move* if [ ! -e /etc/apt-move.conf.orig ]; then mv -v /etc/apt-move.conf /etc/apt-move.conf.orig fi cat > /etc/apt-move.conf <<'---' # (find-fline "/etc/apt-move.conf.orig") ARCH=i386 LOCALDIR=/big/potato DEBSTABLE= DEBUNSTABLE= DEBFROZEN= DIST=potato PKGTYPE=binary SECTIONS="main" USSITE=127.0.0.1 NONUSSITE=ftp.unioeste-foz.br/pub FILECACHE=/var/cache/apt/archives LISTSTATE=/var/state/apt/lists DELETE=no MAXDELETE=20 LOGFILE=/var/log/apt-move.log MONITOR=/dev/null --- cd /var/cache/apt/archives/ # # (find-fline "/etc/apt/sources.list") # (find-fline "/usr/bin/apt-move") # (find-fline "/usr/bin/apt-move" "Usage:") /usr/bin/apt-move -t getlocal |& tee /tmp/o1 sh -x /usr/bin/apt-move -t getlocal |& tee /tmp/o1 /usr/bin/apt-move -t packages |& tee /tmp/o2 sh -x /usr/bin/apt-move -t packages |& tee /tmp/o2 /usr/bin/apt-move -t move |& tee /tmp/o2 sh -x /usr/bin/apt-move -t move |& tee /tmp/o2 /usr/bin/apt-move -t update |& tee /tmp/o sh -x /usr/bin/apt-move -t update |& tee /tmp/oa # (find-fline "/tmp/o") # (find-fline "/tmp/oa") # (find-fline "/big/potato/.apt-move") # ##### # # apt-move # 2000jun14 # ##### # «apt-move0» (to ".apt-move0") # Still too obscure to me; I'm synthesizing its functionality with the # Icon program used in the next block. # (find-status "apt-move") # (find-status "apt-move" "installed-packages only") # (find-vldifile "apt-move.list") # (find-fline "/usr/doc/apt-move/") # (eeman "8 apt-move") # (find-fline "/usr/bin/apt-move") # (find-fline "/etc/apt-move.conf") # (find-fline "/usr/doc/apt-move/README.gz") # (find-fline "/usr/doc/apt-move/README.gz" "apt-move -t update") # (find-fline "/usr/doc/apt-move/README.gz" "apt-move -bt mirror") # (find-fline "/usr/doc/apt-move/README.Debian") # (find-fline "/usr/doc/apt-move/examples/SAMPLE.exclude") # egrep -v '^ *(#|$)' /etc/apt-move.conf \ | tee ~/o # (find-fline "~/o") # sed s:/etc/apt-move.conf:$HOME/tmp/apt-move.conf:g \ < /usr/bin/apt-move \ > ~/tmp/apt-move chmod 755 ~/tmp/apt-move echo -n > ~/tmp/apt-move.conf # export ARCH=i386 export LOCALDIR=/big/potato export DEBSTABLE= export DEBUNSTABLE= export DEBFROZEN= export DIST=potato export PKGTYPE=binary export SECTIONS="main" #export USSITE=ftp.unioeste-foz.br/pub export USSITE=127.0.0.1/debian export NONUSSITE=ftp.unioeste-foz.br/pub export FILECACHE=/var/cache/apt/archives export LISTSTATE=/var/state/apt/lists export DELETE=no export MAXDELETE=20 export LOGFILE=/var/log/apt-move.log export MONITOR=/dev/null cd /var/cache/apt/archives/ ~/tmp/apt-move -t update |& tee /tmp/oa # (find-fline "~/tmp/apt-move") # (find-fline "/tmp/oa") # mkdir /hdd6/debian/indices/ cp -iv /debian/indices/* /hdd6/debian/indices/ cd $SDEBIAN/indices/ # (eeman "1 dpkg-name") # (find-fline "/usr/bin/dpkg-name") # (find-es "dpkg" "dpkg-dev") cd /var/cache/apt/archives/ apt-move -t move # (find-fline "/usr/bin/apt-move" "No master override files exist!") # (find-fline "/usr/bin/apt-move" "getout \"$funct\" \"$?\"") # (find-fline "/usr/bin/apt-move" "move)") # (find-fline "/usr/bin/apt-move" "makelist ()") # (find-fline "/usr/bin/apt-move" "domove ()") # (find-fline "/usr/bin/apt-move" "Creating Lists...") # (find-fline "/usr/bin/apt-move" "echo \"Move: $pname\"") cd /var/cache/apt/archives/ sh -x /usr/bin/apt-move -t move cd /var/cache/apt/archives/ apt-move -t getlocal # ls /var/state/apt/lists/ # (find-fline "/var/state/apt/lists/") # (find-fline "/etc/apt-move.conf") # (find-fline "/etc/apt/sources.list") egrep -v '^(#|$)' /etc/apt-move.conf debtartvzf $POTATO/main/binary-i386/admin/apt-move_3.0-13.deb getdatatargz $POTATO/main/binary-i386/admin/apt-move_3.0-13.deb \ | tar -xOvzf - ./etc/apt-move.conf ./etc/apt-move.conf # (find-fline "/etc/cron.weekly/apt-move") # (find-fline "/usr/doc/apt-move/TODO") # (find-fline "/usr/doc/apt-move/TODO.Debian") # (find-fline "/usr/doc/apt-move/changelog.Debian.gz") # (find-fline "/usr/doc/apt-move/changelog.gz") # (find-fline "/usr/doc/apt-move/copyright") # (find-fline "/usr/doc/apt-move/examples") # (find-fline "/usr/doc/apt-move/examples/SAMPLE.exclude") # (find-fline "/usr/bin/apt-move" "%3a") # (eeman "8 apt-move") # (find-fline "/var/cache/apt/") # (find-fline "/var/cache/apt/archives/") ##### # # Cross the data in the lists of local debs and upstream debs # 2000jun25 # ##### # «missing_upstream_debs1» (to ".missing_upstream_debs1") # mkdir ~/DEBREP/ cd ~/DEBREP/ grep-status --show-field=Package,Version --field=Status ' installed' \ | perl -nle ' m/Package: (.*)/ and $s = $1; m/Version: ([0-9]+:)?(.*)/ and print "$s", "_$2.deb"; ' \ | sort \ | tee oinstalleddebs # Add some standard packages that are not installed but that I want in # the CD anyway cat >> oinstalleddebs <<'---' exim_3.12-10.deb kernel-image-2.2.15-idepci_2.2.15-2.deb kernel-image-2.2.15_2.2.15-2.deb --- # All debs in the local machine that weren't compiled by me: locate '' \ | grep '\.deb$' \ | egrep '/potato/|/slink/|/cache/' \ | grep -v 'potatojun2000/' \ | sort \ > alldebs_locate wc alldebs_locate # Almost the same as the previous one (in my home machine!), # but without symlinks and without needing an updatedb: find \ /hda2/ivoxpotato/ \ /hda2/potato/ \ /hdd2/snarf/ftp/ftp.debian.org/ \ /hdd2/debian/ \ /hda6/debian0/ \ /potato/ \ /var/cache/apt/archives \ /hda2/otherdebs \ -type f -and -name '*.deb' \ | grep -v binary-hurd-i386 \ > alldebs wc alldebs # /hdc6/bin1/dists/ \ # /hdc6/bin2/dists/ \ # /hdd2/slinkb1/ \ cat alldebs_locate \ | perl -nle 's:^(.*)/([^/]*)$:\1:; print' | sort | uniq \ > alldebdirs_locate cat alldebs \ | perl -nle 's:^(.*)/([^/]*)$:\1:; print' | sort | uniq \ > alldebdirs # diff alldebdirs alldebdirs_locate | sort | l -S # function shortandlong () { perl -nle ' $s = $_; s/[0-9](:|%3a)//; s:^.*/([^/]*)$:\1:; s/_(i386|all)\.deb$/.deb/; print "$_\t$s" ' } cd ~/DEBREP/ shortandlong < alldebs \ | sort \ > alldebsshortandlong cat $SDEBIAN/ls-lR.i \ $SNUDEBIAN/ls-lR.i \ | perl -nle ' s/^([ 0-9]+[^ ]+)( ->.*$)?/\1/; print' \ | grep 'binary-i386.*\.deb$' \ | grep 'potato.*binary-i386' \ > upstreamdebs+ cat upstreamdebs+ \ | perl -nle 's/^[ 0-9]+(.*)/\1/; print' \ > upstreamdebs cat upstreamdebs \ | perl -nle 's:^(.*)/([^/]*)$:\1:; print' \ | sort \ | uniq \ | grep 'potato.*binary-i386' \ > upstreamdebdirs (cd ~/ICON/; icont -s debreputil.icn) # Show which installed packages do not correspond to .debs in the # upstream. # ~/ICON/debreputil -idebs_notin_upstream \ ~/DEBREP/oinstalleddebs \ ~/DEBREP/upstreamdebs+ \ |& tee ~/DEBREP/idebs_notin_upstream # Show which upstream files correspond to the installed debs, in case # we want to make a mini-mirror with only the installed packages. # ~/ICON/debreputil -idebs_as_upstream \ ~/DEBREP/oinstalleddebs \ ~/DEBREP/upstreamdebs+ \ |& tee ~/DEBREP/idebs_as_upstream # Classify the .debs in a file in basename/tab/localfilename form in # three groups: first copies of an upstream deb, redundant copies, and # debs that do not correspond to upstream versions. The first copies # are meant to be copied to the mirror, the redundant copies are to be # deleted, and the non-upstream debs are to be left in place. # ~/ICON/debreputil -upstream_fdebs_as_cpsrms \ ~/DEBREP/upstreamdebs+ \ ~/DEBREP/alldebsshortandlong \ > ~/DEBREP/upstream_fdebs_as_cpsrms # This one is even nicer if we want just one big repository. # ~/ICON/debreputil -upstream_fdebs_as_mvsrms \ ~/DEBREP/upstreamdebs+ \ ~/DEBREP/alldebsshortandlong \ > ~/DEBREP/upstream_fdebs_as_mvsrms l -S ~/DEBREP/upstream_fdebs_as_mvsrms egrep -v '^(rm|#)' ~/DEBREP/upstream_fdebs_as_cpsrms \ > ~/DEBREP/upstream_fdebs_as_cps egrep '^(rm|#)' ~/DEBREP/upstream_fdebs_as_cpsrms \ > ~/DEBREP/upstream_fdebs_as_rms # Almost the same but now to copy only the installed upstream debs. # Incomplete. # ~/ICON/debreputil -upstream_fdebs_as_cpsrms \ ~/DEBREP/idebs_as_upstream \ ~/DEBREP/alldebsshortandlong \ | egrep -v '^(rm|#)' \ > ~/DEBREP/upstream_idebs_as_cps # sh these only with EXTREME care or you'll end up by mixing i386 and # hurd-i386 debs and messing up with slink, home-compiled and # alien-compiled debs. # cd /new/potatojun2000/ && . ~/DEBREP/upstream_fdebs_as_cps |& tee ~/o # cd /new/potatojun2000/ && . ~/DEBREP/upstream_fdebs_as_cpsrms |& tee ~/o # # This one would be pretty safe once it's tested... mkdir /debian/ cd /debian/ mkdir -p $(<~/DEBREP/upstreamdebdirs) # (find-node "(zsh)Description of Options" "ERR_EXIT") # (find-fline "~/DEBREP/upstream_fdebs_as_mvsrms") (unalias mv_or_rm; set -e; . ~/DEBREP/upstream_fdebs_as_mvsrms) |& tee ~/o # # This is a dirty hack for an emergency... I need space, I need to # list all old debs that are old versions of debs stored in my main # repository, to delete the ones I don't want anymore... cd /debian/ find * -type f -and -name '*.deb' \ | perl -nle 'm:(/[^/_]+_): && print $1' \ | sort \ > /tmp/f find /potato /hda2/potato /hda6/debian0 /hda2/ivoxpotato /hdd2/{potato2,potatojun2000} $SPOTATO /hda2/otherdebs\ -type f -and -name '*.deb' \ | fgrep -f /tmp/f \ | awk '{ print "rm -v", $0 }' \ > /tmp/rms # find /potato /hda2/potato /hda6/debian0 /hda2/ivoxpotato /hdd2/{potato2,potatojun2000} \ -type f -and -name '*.deb' \ | fgrep -v -f /tmp/f \ | awk '{ print "store_deb", $0 }' \ > /tmp/norms # function mv_or_rm () { if [[ -e $2 ]]; then if [[ $1 -ef $2 ]]; then echo '# same as dest:' $1 else echo rm $1; rm $1 fi else echo mv $1 $2; mv $1 $2 fi } function store_deb () { mv_or_rm $1 $(debbasename $1) } # # (find-fline "~/DEBREP/oinstalleddebs") # (find-fline "~/DEBREP/idebs_as_upstream") # (find-fline "~/DEBREP/idebs_notin_upstream") # (find-fline "~/DEBREP/alldebdirs") # (find-fline "~/DEBREP/alldebdirs_locate") # (find-fline "~/DEBREP/alldebs") # (find-fline "~/DEBREP/alldebs_locate") # (find-fline "~/DEBREP/alldebsshortandlong") # (find-fline "~/DEBREP/upstream_fdebs_as_cps") # (find-fline "~/DEBREP/upstream_fdebs_as_cpsrms") # (find-fline "~/DEBREP/upstream_fdebs_as_rms") # (find-fline "~/DEBREP/upstreamdebdirs") # (find-fline "~/DEBREP/upstreamdebs") # (find-fline "~/DEBREP/upstreamdebs+") # (find-fline "$SDEBIAN/ls-lR.i") # (find-fline "$SNUDEBIAN/ls-lR.i") # (find-fline "~/ICON/debreputil.icn") # (find-fline "~/ICON/debrepository.icn") # (find-fline "$ES/apt.e" "icone") ##### # # mini-potato # 2000jul13 # ##### # «mini-potato» (to ".mini-potato") # After running the two parts of the preceding block we're now able to # prepare a .deb repository with the installed packages; with a few # tricks more it can become the image of an installation CD, so... #rm -Rv /new/debian/ # # Copy the .debs: mkdir /new/debian/; cd /new/debian/ && mkdir -p $(<~/DEBREP/upstreamdebdirs) cd /new/debian/ && . ~/DEBREP/upstream_idebs_as_cps |& tee ~/o # Make an important link: [[ -e dists/frozen ]] || ln -s potato dists/frozen # I don't know if I need this one; it's for local packages. [[ -e dists/unstable ]] || ln -s potato dists/unstable # cd /new/debian/dists/potato/ mkdir -p local/main/binary-i386/ mkdir -p local/non-free/binary-i386/ # Copy some .debs to local. I'm putting some old kernels too just # because it was too painful to keep the kernels in sync with the # upstream (and old kernels are better than no kernels at all :-). # (find-fline "~/DEBREP/idebs_notin_upstream") # (find-fline "/usr/src/.debs/") # (find-angg ".zshrc" "debbasename") # for i in \ /hdd2/potatojun2000/dists/potato/main/binary-i386/base/kernel-image-2.2.15-idepci_2.2.15-2.deb \ /hdd2/potatojun2000/dists/potato/main/binary-i386/base/kernel-image-2.2.15_2.2.15-2.deb \ /usr/src/.debs/mktclapp_* do cp -v $i local/main/binary-i386/$(debbasename $i) done for i in \ /usr/src/.debs/glimpse_* \ /usr/src/.debs/ivox-server_* do cp -v $i local/non-free/binary-i386/$(debbasename $i) done # # «mini-potato:override» (to ".mini-potato:override") # (find-es "apt" "override") # Copy the override files: cd /new/debian/ function cpzcat () { mkdir -p $2 cp -v $1/$2/$3 $2/$3 zcat $2/$3 > $2/$(basename $3 .gz) } cpzcat $SDEBIAN indices override.potato.contrib.gz cpzcat $SDEBIAN indices override.potato.gz cpzcat $SDEBIAN indices override.potato.non-free.gz cpzcat $SNUDEBIAN indices-non-US override.potato.contrib.gz cpzcat $SNUDEBIAN indices-non-US override.potato.gz cpzcat $SNUDEBIAN indices-non-US override.potato.non-free.gz laf indices indices-non-US # # «mini-potato:Packages» (to ".mini-potato:Packages") # (find-es "apt" "Packages") cd /new/debian/ function dpkg-scanp () { mkdir -p dists/$1/$2/binary-i386/ (dpkg-scanpackages dists/$1/$2/binary-i386 $3 \ > dists/$1/$2/binary-i386/Packages \ ) |& tee /tmp/odsp$4 } dpkg-scanp frozen contrib indices/override.potato.contrib c dpkg-scanp frozen main indices/override.potato m dpkg-scanp frozen non-free indices/override.potato.non-free nf dpkg-scanp frozen non-US/contrib indices-non-US/override.potato.contrib nuc dpkg-scanp frozen non-US/main indices-non-US/override.potato num dpkg-scanp frozen non-US/non-free indices-non-US/override.potato.non-free nunf dpkg-scanp unstable local/main /dev/null lm dpkg-scanp unstable local/non-free /dev/null lnf # What about Packages-Master-i386? # # «mini-potato:Release» (to ".mini-potato:Release") # (find-es "apt" "Release") function write-release () { mkdir -p $2/binary-$6 (echo "Archive: $1\nComponent: $2\nVersion: $3\nOrigin: $4\nLabel: $5" echo "Architecture: $6" ) > $2/binary-$6/Release # echo " $2/binary-$6/Release:" # cat $2/binary-$6/Release # echo } cd /new/debian/dists/potato/ write-release frozen contrib 2.2 Debian Debian i386 write-release frozen main 2.2 Debian Debian i386 write-release frozen non-free 2.2 Debian Debian i386 write-release frozen non-US/contrib 2.2 Debian Debian i386 write-release frozen non-US/main 2.2 Debian Debian i386 write-release frozen non-US/non-free 2.2 Debian Debian i386 write-release unstable local/main 2.2 Edrx Edrx i386 write-release unstable local/non-free 2.2 Edrx Edrx i386 # # «mini-potato:.disk» (to ".mini-potato:.disk") # (find-es "apt" ".disk") # I'm supposing that .disk/info is more or less free-form... cd /new/debian/ mkdir .disk date "+Debian GNU/Linux potato (2.2) Ivox binary-i386 %Y%b%d" > .disk/info # # «mini-potato:disks-i386» (to ".mini-potato:disks-i386") cd /new/debian/ # rm -Rv dists/potato/main/disks-i386/ mkdir -p dists/potato/main/disks-i386/ cd $SDEBIAN/dists/potato/main/disks-i386/ # find * cp -diPpvR \ 2.2.15-2000-06-07/base2_2.tgz \ 2.2.15-2000-06-07/drivers.tgz \ 2.2.15-2000-06-07/images-1.44/rescue.bin \ 2.2.15-2000-06-07/images-1.44/root.bin \ 2.2.15-2000-06-07/images-2.88/rescue.bin \ /new/debian/dists/potato/main/disks-i386/ cd /new/debian/ ln -s 2.2.15-2000-06-07 dists/potato/main/disks-i386/current # # «mini-potato:other_files» (to ".mini-potato:other_files") cd $SDEBIAN/ cp -diPpvR \ README.mirrors.html \ README.mirrors.txt \ README.non-US \ dists/potato/Contents-i386.gz \ tools/fips20.zip \ tools/gzip124.exe \ tools/lodlin16.zip \ tools/rawrite1.zip \ tools/rawrite2.zip \ tools/unz512x3.exe \ /new/debian/ cd /new/debian/ zcat dists/potato/Contents-i386.gz \ > dists/potato/Contents-i386 # Add later: pu, pz, qedit, 4dos, dos622 images # README.mirrors.html README.mirrors.txt README.non-US dists/potato/Contents-i386.gz ##### # # apt-get update / apt-get upgrade # 2000aug03 # ##### # «apt-get_update_upgrade» (to ".apt-get_update_upgrade") # (eeman "apt-get") # Uncomment the lines that refer to an externel Debian repository: # (find-fline "/etc/apt/sources.list") apt-get update apt-get upgrade ##### # # apt-howto # 2008jul25 # ##### # «apt-howto» (to ".apt-howto") # «apt-get-source» (to ".apt-get-source") # (find-status "apt-howto-en") # (find-vldifile "apt-howto-en.list") # (find-udfile "apt-howto-en/") # (find-apthowtofile "") # (find-apthowtofile "apt-howto.en.txt.gz") # (find-apthowtow3m "apt-howto.en.html") # (find-apthowtow3m "ch-sourcehandling.en.html") # (find-apthowtow3m "ch-sourcehandling.en.html" "build-essential") # (find-apthowtow3m "ch-sourcehandling.en.html#s-build-dep" "apt-get build-dep") # (find-apthowtow3m "ch-sourcehandling.en.html#s-build-dep" "apt-cache showsrc") # (find-man "8 apt-get" " build-dep") # (find-man "8 apt-cache" "showsrc pkg(s)") # (find-man "1 dpkg-buildpackage") # http://packages.debian.org/bc # http://packages.debian.org/src:bc # http://ftp.debian.org/debian/pool/main/b/bc/  (eepitch-shell)  (eepitch-kill)  (eepitch-shell) apt-cache showsrc bc rm -Rv /tmp/d/ mkdir /tmp/d/ cd /tmp/d/ apt-get source bc sudo apt-get build-dep bc cd /tmp/d/bc-1.06/ dpkg-buildpackage -rfakeroot -uc -b cd /tmp/d/ ls -lAF ls -lAF *.deb sudo dpkg -i *.deb # (find-zsh "dmissing libapt-pkg-doc") # (find-status "libapt-pkg-doc") # (find-vldifile "libapt-pkg-doc.list") # (find-udfile "libapt-pkg-doc/") # (find-fline "/usr/doc/libapt-pkg-doc/files.text.gz") # (find-fline "/usr/doc/libapt-pkg-doc/cache.text.gz") # (find-fline "/usr/doc/libapt-pkg-doc/design.text.gz") # (find-fline "/usr/doc/libapt-pkg-doc/dpkg-tech.text.gz") # (find-fline "/usr/doc/libapt-pkg-doc/method.text.gz") # (find-apthowtofile "apt-howto.en.txt.gz" "sources repository") # (find-man "apt-get" "\n source") # mkdir ~/debsrc/ cd ~/debsrc/ apt-get --download-only --no-download source glibc # ##### # # fakeroot debian/rules binary vs. dpkg-buildpackage -us -uc -b -rfakeroot # 2005jan08 # ##### # (find-man "1 dpkg-buildpackage") # (find-man "1 dpkg-checkbuilddeps") dpkg-buildpackage invokes dpkg-checkbuilddeps, that will check a control file and list (in a format that is easy to use) which packages in the build-depends field haven't been installed. # (find-fline "/usr/bin/dpkg-buildpackage" "debian/rules build") # 2008jan29: # (find-fline "/etc/apt/sources.list") deb file:/dvds/etch/debian etch main contrib deb http://ftp.squeak.org/debian/ stable main deb http://ftp.debian.org/ etch main contrib non-free deb file:/dvds/etch/debian etch main contrib # (find-dekooningfile "") # Local Variables: # coding: raw-text-unix # ee-delimiter-hash: "\n#\n" # ee-delimiter-percent: "\n%\n" # ee-anchor-format: "«%s»" # End: