diff --git a/etc/templates/includes/initrd/initrd.common b/etc/initrd/includes/initrd.common similarity index 100% rename from etc/templates/includes/initrd/initrd.common rename to etc/initrd/includes/initrd.common diff --git a/etc/templates/initrd.alpha b/etc/initrd/initrd.alpha similarity index 100% rename from etc/templates/initrd.alpha rename to etc/initrd/initrd.alpha diff --git a/etc/templates/initrd.i386 b/etc/initrd/initrd.i386 similarity index 89% rename from etc/templates/initrd.i386 rename to etc/initrd/initrd.i386 index 57501b24..b6c71784 100644 --- a/etc/templates/initrd.i386 +++ b/etc/initrd/initrd.i386 @@ -1,6 +1,6 @@ # initrd template -#include includes/initrd/initrd.common +#include includes/initrd.common # loader copy @instroot@ usr/lib/anaconda-runtime/loader/init to @initrd@ sbin/init diff --git a/etc/templates/initrd.ia64 b/etc/initrd/initrd.ia64 similarity index 100% rename from etc/templates/initrd.ia64 rename to etc/initrd/initrd.ia64 diff --git a/etc/templates/initrd.ppc b/etc/initrd/initrd.ppc similarity index 100% rename from etc/templates/initrd.ppc rename to etc/initrd/initrd.ppc diff --git a/etc/templates/initrd.ppc64 b/etc/initrd/initrd.ppc64 similarity index 100% rename from etc/templates/initrd.ppc64 rename to etc/initrd/initrd.ppc64 diff --git a/etc/templates/initrd.s390 b/etc/initrd/initrd.s390 similarity index 98% rename from etc/templates/initrd.s390 rename to etc/initrd/initrd.s390 index 50494cde..cf079699 100644 --- a/etc/templates/initrd.s390 +++ b/etc/initrd/initrd.s390 @@ -1,6 +1,6 @@ # initrd template -#include includes/initrd/initrd.common +#include includes/initrd.common # create required directories makedir @initrd@/var/empty/sshd mode 0111 diff --git a/etc/templates/initrd.s390x b/etc/initrd/initrd.s390x similarity index 100% rename from etc/templates/initrd.s390x rename to etc/initrd/initrd.s390x diff --git a/etc/templates/initrd.sparc b/etc/initrd/initrd.sparc similarity index 100% rename from etc/templates/initrd.sparc rename to etc/initrd/initrd.sparc diff --git a/etc/templates/initrd.x86_64 b/etc/initrd/initrd.x86_64 similarity index 100% rename from etc/templates/initrd.x86_64 rename to etc/initrd/initrd.x86_64 diff --git a/etc/modules/modules b/etc/modules/modules.all similarity index 100% rename from etc/modules/modules rename to etc/modules/modules.all diff --git a/etc/packages/packages.all b/etc/packages/packages.all index 62065d25..df07843e 100644 --- a/etc/packages/packages.all +++ b/etc/packages/packages.all @@ -1,260 +1,43 @@ -GConf2 -NetworkManager -ORBit2 -PolicyKit -acl -#anaconda -anaconda-yum-plugins -at-spi -atk -attr -audit-libs -bash -bitmap-fonts-cjk -btrfs-progs -bzip2 -bzip2-libs -cairo -cjkuni-uming-fonts -comps-extras -coreutils -cpio -cracklib -cracklib-dicts -cracklib-python -cryptsetup-luks -db4 -dbus -dbus-python -dejavu-sans-fonts -dejavu-sans-mono-fonts -device-mapper -device-mapper-libs -dhclient -dhcpv6-client -dmraid -dmraid-libs -dogtail -dosfstools -e2fsprogs -e2fsprogs-libs -echo-icon-theme -ethtool -elfutils-libelf -expat -firstboot -fontconfig -fonts-ISO8859-2 -freetype -gail -gawk -gdb-gdbserver -gdk-pixbuf -gfs2-utils -glib2 -glibc-common -gnome-python2-canvas -gnome-python2-gconf -gnome-python2-gtkhtml2 -gnome-themes -gpm -grep -gtk2 -gtk2-engines -gtkhtml2 -hal -hdparm -hwdata -initscripts -iproute -iputils -iscsi-initiator-utils -jfsutils -keyutils-libs -krb5-libs -libICE -libSM -libX11 -libXau -libXaw -libXcursor -libXdmcp -libXevie -libXext -libXfixes -libXfont -libXft -libXi -libXinerama -libXmu -libXpm -libXrandr -libXrender -libXt -libXtst -libXxf86misc -libacl -libart_lgpl -libattr -libbdevid -libbdevid-python -libbonobo -libfontenc -libgcc -libglade2 -libgnomecanvas -libgcrypt -libgpg-error -libjpeg -libnl -libpng -libselinux -libselinux-python -libsemanage -libsemanage-python -libsepol -libstdc++ -libthai -libuser -libuser-python -libvolume_id -libxcb -libxkbfile -libxml2 -lklug-fonts -lohit-assamese-fonts -lohit-bengali-fonts -lohit-gujarati-fonts -lohit-hindi-fonts -lohit-kashmiri-fonts -lohit-kannada-fonts -lohit-maithili-fonts -lohit-marathi-fonts -lohit-oriya-fonts -lohit-punjabi-fonts -lohit-sindhi-fonts -lohit-tamil-fonts -lohit-telugu-fonts -lvm2 -madan-fonts -mdadm -mesa-dri-drivers -mkinitrd -module-init-tools -nash -ncurses -neon -net-tools -newt -newt-python -nfs-utils -nspr -nss -ntfs-3g -pam -pango -parted -pciutils -pcre -policycoreutils -popt -prelink -procps -pycairo -pygobject2 -pygtk2 -pygtk2-libglade -pykickstart -pyparted -python -python-bugzilla -python-decorator -python-libs -python-pyblock -python-sqlite -python-urlgrabber -pyxf86config -readline -redhat-artwork -reiserfs-utils -rhpl -rpm -rpm-libs -rpm-python -sed -selinux-policy-targeted -setup -slang -smc-meera-fonts -specspo -sqlite -synaptics -system-config-date -system-config-keyboard -#${brandpkgname}-logos -#${brandpkgname}-release -taipeifonts -tcp_wrappers -tzdata -udev -un-core-fonts-dotum -urw-fonts -util-linux-ng -tigervnc-server -tigervnc-server-module -vlgothic-fonts -vim-minimal -wpa_supplicant -xkeyboard-config -xfsdump -xfsprogs -xorg-x11-auth -xorg-x11-drivers -xorg-x11-font-utils -xorg-x11-fonts-ethiopic -xorg-x11-fonts-misc -xorg-x11-server-utils -xorg-x11-server-Xorg -xorg-x11-xkb-utils -xorg-x11-xfs yum -yum-metadata-parser -zenity -zlib -#/etc/gtk-2.0/gtkrc -glibc -openssl - -# rescue -bzip2 -bzip2-libs -dump -libidn -findutils -ftp -gzip -iputils joe -krb5-libs -less -man -modutils -mtools -mt-st -mtr -net-tools -smartmontools -openssh -openssh-clients -pciutils -rsh -traceroute -tar -rsync -device-mapper -device-mapper-libs -dmraid -ntfsprogs -samba-client +gnome-icon-theme +fedora-icon-theme +xorg-x11-server-Xorg firstaidkit -firstaidkit-plugin-all -dialog +bzip2 +busybox +selinux-policy-targeted +python-imaging +hal +specspo +xorg-x11-fonts-misc +xorg-x11-drivers +rhpxl +ntfs-3g +ntfsprogs +xfsprogs +xfsdump +reiserfs-utils +gfs2-utils +jfsutils +nfs-utils +btrfs-progs +mesa-dri-drivers +dogtail +rsh +rsync +prelink +smartmontools +iscsi-initiator-utils +samba-client +mtr +gtk-nodoka-engine +ftp +openssh-clients +gtk+ +gdk-pixbuf +madan-fonts +lklug-fonts +xorg-x11-fonts-ethiopic +un-core-fonts-dotum +man +yum-fedorakmod \ No newline at end of file diff --git a/etc/packages/packages.i386 b/etc/packages/packages.i386 index f6d90190..c1aa3a2f 100644 --- a/etc/packages/packages.i386 +++ b/etc/packages/packages.i386 @@ -1,11 +1,7 @@ --glibc --openssl -glibc.i386 -openssl.i386 pcmciautils grub dmidecode efibootmgr gpart syslinux -memtest86+ +memtest86+ \ No newline at end of file diff --git a/etc/packages/packages.i586 b/etc/packages/packages.i586 deleted file mode 100644 index c5fb1549..00000000 --- a/etc/packages/packages.i586 +++ /dev/null @@ -1,11 +0,0 @@ --glibc --openssl -glibc.i586 -openssl.i586 -pcmciautils -grub -dmidecode -efibootmgr -gpart -syslinux -memtest86+ diff --git a/etc/packages/packages.i586 b/etc/packages/packages.i586 new file mode 120000 index 00000000..cd9dd23d --- /dev/null +++ b/etc/packages/packages.i586 @@ -0,0 +1 @@ +packages.i386 \ No newline at end of file diff --git a/etc/packages/packages.x86_64 b/etc/packages/packages.x86_64 deleted file mode 100644 index 6921bc17..00000000 --- a/etc/packages/packages.x86_64 +++ /dev/null @@ -1,7 +0,0 @@ -pcmciautils -grub -dmidecode -efibootmgr -gpart -syslinux -memtest86+ diff --git a/etc/packages/packages.x86_64 b/etc/packages/packages.x86_64 new file mode 120000 index 00000000..cd9dd23d --- /dev/null +++ b/etc/packages/packages.x86_64 @@ -0,0 +1 @@ +packages.i386 \ No newline at end of file diff --git a/rewrite/scripts/buildinstall b/rewrite/scripts/buildinstall deleted file mode 100755 index bdc7cef3..00000000 --- a/rewrite/scripts/buildinstall +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -# -# buildinstall -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -die() { - [ -n "$TREEDIR" ] && rm -rf $TREEDIR - [ -n "$BUILDINSTDIR" ] && rm -rf $BUILDINSTDIR - [ -n "$yumconf" ] && rm -rf $yumconf - echo "Aborting buildinstall" - echo "$@" - exit 1 -} - -usage() { - echo "Usage: buildinstall --version --product --release [--output outputdir] [--discs ] " >&2 - exit 1 -} - -PRODUCTPATH="anaconda" - -while [ $# -gt 0 ]; do - case $1 in - # general options affecting how we build things - --nogr) - NOGRSTR="--nogr" - shift - ;; - --debug) - DEBUGSTR="--debug" - shift - ;; - - # release information - --version) - VERSION=$2 - shift; shift - ;; - --release) - RELEASESTR=$2 - shift; shift - ;; - --product) - PRODUCTSTR=$2 - shift; shift - ;; - --variant) - VARIANT=$2 - shift; shift - ;; - --bugurl) - BUGURL=$2 - shift; shift - ;; - --output) - OUTPUT=$2 - shift; shift - ;; - --updates) - UPDATES=$2 - shift; shift - ;; - --mirrorlist) - MIRRORLIST="$MIRRORLIST $2" - shift; shift - ;; - - *) - if [ -z "$REPO" ]; then - REPO=$1 - else - EXTRA_REPOS="$EXTRA_REPOS $1" - fi - shift - ;; - esac -done - -if [ -z "$PRODUCTSTR" ]; then - usage -fi - -if [ -z "$VERSION" ]; then - usage -fi - -if [ -z "$REPO" ]; then - usage -fi - -if [ -z "$RELEASESTR" ]; then - usage -fi - -if [ -z "$BUGURL" ]; then - BUGURL="your distribution provided bug reporting tool." -fi - -if [[ "$REPO" =~ ^/ ]]; then - [ -n "$OUTPUT" ] || OUTPUT=$REPO - REPO="file://$REPO" -fi - -if [ -z "$OUTPUT" ]; then - usage -fi - -if [ ! -d "$OUTPUT" ]; then - mkdir -p $OUTPUT -fi - -# The first -release and -logos package we are going to look for is the lowercase -# equivalent of the PRODUCTSTR -export brandpkgname="`echo $PRODUCTSTR | tr '[:upper:]' '[:lower:]'`" - -BUILDINSTDIR=$(mktemp -d ${TMPDIR:-/tmp}/buildinstall.tree.XXXXXX) -TREEDIR=$(mktemp -d ${TMPDIR:-/tmp}/treedir.XXXXXX) -CACHEDIR=$(mktemp -d ${TMPDIR:-/tmp}/yumcache.XXXXXX) - -yumconf=$(mktemp ${TMPDIR:-/tmp}/yum.conf.XXXXXX) -cat > $yumconf <> $yumconf <> $yumconf </dev/null 2>&1 - case $? in - [02]) ;; - *) unset LDSO ;; - esac - if [ -z "$LDSO" ]; then - for ldso in $root/$LDSODIR/ld*.so* ; do - [ -L $ldso ] && continue - [ -x $ldso ] || continue - $ldso --verify $bin >/dev/null 2>&1 - case $? in - [02]) LDSO=$(echo $ldso |sed -e "s,$root,,") ; break ;; - esac - done - fi - - # I still hate shell. - declare -i n=0 - while read NAME I0 FILE ADDR I1 ; do - [ "$FILE" == "not" ] && FILE="$FILE $ADDR" - NAMES[$n]="$NAME" - FILES[$n]="$FILE" - let n++ - done << EOF - $(/usr/sbin/chroot $root env LD_TRACE_PRELINKING=1 LD_WARN= \ - LD_TRACE_LOADED_OBJECTS=1 $LDSO $bin) -EOF - - [ ${#FILES[*]} -eq 0 ] && return 1 - - # we don't want the name of the binary in the list - if [ "${FILES[0]}" == "$bin" ]; then - FILES[0]="" - NAMES[0]="" - [ ${#FILES[*]} -eq 1 ] && return 1 - fi - - declare -i n=0 - while [ $n -lt ${#FILES[*]} ]; do - FILE="${FILES[$n]}" - if [ "$FILE" == "not found" ]; then - cat 1>&2 <. -# - -ARCH=$1 -if [ -z "$ARCH" ]; then - echo "usage: $0 " - exit 1 -fi - -TOPDIR=`pwd` -OUTPUT=$2 -if [ -z "$OUTPUT" ]; then - echo "No output specified, using ${TMPDIR:-/tmp}/keymaps-$ARCH.$$" - OUTPUT=${TMPDIR:-/tmp}/keymaps-$ARCH.$$ -fi - -UTILDIR=$3 -if [ -z "$UTILDIR" ]; then - READMAP=../utils/readmap - MAPSHDR=$TOPDIR/../utils/mapshdr -else - READMAP=$UTILDIR/usr/lib/anaconda-runtime/readmap - MAPSHDR=$UTILDIR/usr/lib/anaconda-runtime/mapshdr -fi - -TMP=${TMPDIR:-/tmp}/keymaps.$$ - -rm -rf $TMP -mkdir -p $TMP - -if [ $ARCH = "sparc" ]; then - PATTERN={i386,sun} -else - PATTERN=i386 -fi - -MAPS=$(python -c "import rhpl.keyboard_models ; rhpl.keyboard_models.get_supported_models()") - -for map in $MAPS ; do - eval find /lib/kbd/keymaps/$PATTERN -name "$map.map*.gz" | while read n; do - /bin/loadkeys `basename $n .gz` >/dev/null - $READMAP $TMP/`basename $n .map.gz`.map - done -done - -loadkeys us - -rm -f $TMP/defkeymap* $TMP/ANSI* $TMP/lt.map - -(cd $TMP; $MAPSHDR *.map) > $TMP/hdr -cat $TMP/hdr $TMP/*.map | gzip -9 > $OUTPUT -rm -rf $TMP diff --git a/rewrite/scripts/getlangnames.py b/rewrite/scripts/getlangnames.py deleted file mode 100644 index b81d26d2..00000000 --- a/rewrite/scripts/getlangnames.py +++ /dev/null @@ -1,47 +0,0 @@ -# -# getlangnames.py -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -import sys -sys.path.append("..") -import language - -import gettext - -langs = language.Language() -names = {} -for k in langs.localeInfo.keys(): - found = False - for l in language.expandLangs(k): - try: - f = open("po/%s.mo" %(l,)) - except (OSError, IOError): - continue - cat = gettext.GNUTranslations(f) - cat.set_output_charset("utf-8") - names[langs.localeInfo[k][0]] = cat.lgettext(langs.localeInfo[k][0]) - found = True - break - if not found: - names[langs.localeInfo[k][0]] = langs.localeInfo[k][0] - -nameList = names.keys() -nameList.sort() - -for k in nameList: - print("%s\t%s" % (k, names[k])) diff --git a/rewrite/scripts/makestamp.py b/rewrite/scripts/makestamp.py deleted file mode 100755 index 0638c6de..00000000 --- a/rewrite/scripts/makestamp.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/python -# -# makes a .discinfo file. if information isn't provided, prompts for it -# -# Copyright (C) 2002 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -import os,sys,string -import getopt -import time - - -def usage(): - args = "" - for key in data: - args = "%s [--%s=%s]" %(args, key, key) - print("%s: %s" % (sys.argv[0], args)) - sys.exit(1) - -data = {"timestamp": None, - "releasestr": None, - "arch": None, - "discNum": None, - "outfile": None} -allDiscs = None - -opts = [] -for key in data.keys(): - opts.append("%s=" % (key,)) -opts.append("allDiscs") - -(args, extra) = getopt.getopt(sys.argv[1:], '', opts) -if len(extra) > 0: - print("had extra args: %s" % extra) - usage() - -for (str, arg) in args: - if str[2:] in data.keys(): - data[str[2:]] = arg - elif str == "--allDiscs": - allDiscs = 1 - else: - print("unknown str of ", str) - usage() - -if data["timestamp"] is None: - sys.stderr.write("timestamp not specified; using the current time\n") - data["timestamp"] = time.time() -else: - data["timestamp"] = float(data["timestamp"]) - -if data["releasestr"] is None: - print("What should be the release name associated with this disc?\n") - data["releasestr"] = sys.stdin.readline()[:-1] - -if data["arch"] is None: - print("What arch is this disc for?") - data["arch"] = sys.stdin.readline()[:-1] - -if data["discNum"] is None and allDiscs is None: - sys.stderr.write("No disc number specified; assuming disc 1\n") - data["discNum"] = "1" - -if data["outfile"] is None: - f = sys.stdout -else: - f = open(data["outfile"], "w") - -f.write("%f\n" % data["timestamp"]) -f.write("%s\n" % data["releasestr"]) -f.write("%s\n" % data["arch"]) -if allDiscs is None: - f.write("%s\n" % data["discNum"]) -else: - f.write("0\n") - - diff --git a/rewrite/scripts/maketreeinfo.py b/rewrite/scripts/maketreeinfo.py deleted file mode 100644 index 226d5139..00000000 --- a/rewrite/scripts/maketreeinfo.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/python -# -# makes a .treeinfo file. if information isn't provided, emit some warnings. -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Author(s): Will Woods -# - -import os,sys,string -import getopt -import time -import ConfigParser - - -def usage(): - args = "" - for key in data: - args = "%s [--%s=%s]" %(args, key, key) - print("%s: %s" % (sys.argv[0], args)) - sys.exit(1) - -# TODO: add composeid, images, etc. -# TODO: take releasestr as an option and break it up into family/variant/version? - -data = {"timestamp": time.time(), - "family": None, - "variant": None, - "version": None, - "arch": None, - "discnum": None, - "totaldiscs": None, - "packagedir": None, - "outfile": None} -allDiscs = None - -opts = [] -for key in data.keys(): - opts.append("%s=" % (key,)) -opts.append("allDiscs") - -(args, extra) = getopt.getopt(sys.argv[1:], '', opts) -if len(extra) > 0: - print("had extra args: %s" % extra) - usage() - -for (str, arg) in args: - if str[2:] in data.keys(): - data[str[2:]] = arg - elif str == "--allDiscs": - allDiscs = 1 - else: - print("unknown str of ", str) - usage() - -# Make sure timestamp is actually a float -if type(data["timestamp"]) != float: - data["timestamp"] = float(data["timestamp"]) - -if data["family"] is None: - sys.stderr.write("--family missing! This is probably bad!\n") - data["family"] = "" - -if data["variant"] is None: - sys.stderr.write("--variant missing, but that's OK.\n") - data["variant"] = "" - -if data["version"] is None: - sys.stderr.write("--version missing! This is probably bad!\n") - data["version"] = "" - -if data["arch"] is None: - sys.stderr.write("--arch missing! This is probably bad!\n") - data["arch"] = "" - -if data["discnum"] is None and allDiscs is None: - sys.stderr.write("--discnum missing; assuming disc 1\n") - data["discnum"] = "1" - -if data["totaldiscs"] is None and allDiscs is None: - sys.stderr.write("--totaldiscs missing; assuming 1\n") - data["totaldiscs"] = "1" - -if data["packagedir"] is None: - sys.stderr.write("--packagedir missing. This might cause some weirdness.\n") - data["packagedir"] = "" - - -if data["outfile"] is None: - f = sys.stdout -else: - f = open(data["outfile"], "w") - -section='general' -c=ConfigParser.ConfigParser() -c.add_section(section) -for k,v in data.items(): - if k != 'outfile': - c.set(section,k,v) -c.write(f) diff --git a/rewrite/scripts/makeupdates b/rewrite/scripts/makeupdates deleted file mode 100755 index a8947ed0..00000000 --- a/rewrite/scripts/makeupdates +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/env python -# -# makeupdates - Generate an updates.img containing changes since the last -# tag, but only changes that do not need to be compiled. If -# you need an updated _isys.so or a new loader, you should -# still compile things as usual. -# -# Copyright (C) 2009 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . -# -# Author: David Cantrell - -import getopt -import os -import shutil -import subprocess -import sys - -def getArchiveTag(configure, spec): - tag = "" - - f = open(configure) - lines = f.readlines() - f.close() - - for line in lines: - if line.startswith('AC_INIT('): - fields = line.split('[') - tag += fields[1].split(']')[0] + '-' + fields[2].split(']')[0] - break - else: - continue - - f = open(spec) - lines = f.readlines() - f.close() - - for line in lines: - if line.startswith('Release:'): - tag += '-' + line.split()[1].split('%')[0] - else: - continue - - return tag - -def doGitDiff(tag, args=[]): - proc = subprocess.Popen(['git', 'diff', '--stat', tag] + args, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate() - - lines = proc[0].split('\n') - return lines - -def copyUpdatedFiles(tag, updates, cwd): - def pruneFile(src, names): - lst = [] - - for name in names: - if name.startswith('Makefile') or name.endswith('.pyc'): - lst.append(name) - - return lst - - subdirs = [] - - lines = doGitDiff(tag) - for line in lines: - if line.find(' | ') == -1: - continue - - fields = line.split() - file = fields[0] - - if file.endswith('.spec.in') or file.startswith('Makefile') or \ - file.endswith('.c') or file.endswith('.h') or \ - file.endswith('.sh') or file == 'configure.ac': - continue - - if file.find('/') != -1: - fields = file.split('/') - subdir = fields[0] - - if subdir == 'installclasses' or subdir == 'storage' or \ - subdir == 'booty': - subupdates = os.path.realpath(updates + '/' + subdir) - if os.path.isdir(subupdates): - shutil.rmtree(subupdates) - - if not subdir in subdirs: - sys.stdout.write("Including %s/\n" % (subdir,)) - subdirs.append(subdir) - - shutil.copytree(os.path.realpath(cwd + '/' + subdir), - subupdates, ignore=pruneFile) - elif subdir == 'loader' or subdir == 'po' or \ - subdir =='scripts' or subdir == 'command-stubs' or \ - subdir == 'tests' or subdir == 'bootdisk' or \ - subdir == 'docs' or subdir == 'fonts' or \ - subdir == 'utils' or subdir == 'gptsync': - continue - else: - sys.stdout.write("Including %s\n" % (file,)) - shutil.copy2(file, updates) - -def isysChanged(tag): - lines = doGitDiff(tag, ['isys']) - - for line in lines: - if line.find(' | ') == -1: - continue - - fields = line.split() - file = fields[0] - - if file.startswith('Makefile') or file.endswith('.h') or \ - file.endswith('.c'): - return True - - return False - -def copyUpdatedIsys(updates, cwd): - os.chdir(cwd) - - if not os.path.isfile('Makefile'): - if not os.path.isfile('configure'): - os.system('./autogen.sh') - os.system('./configure') - - os.system('make') - - isysmodule = os.path.realpath(cwd + '/isys/.libs/_isys.so') - if os.path.isfile(isysmodule): - shutil.copy2(isysmodule, updates) - -def createUpdatesImage(cwd, updates): - os.chdir(updates) - os.system("find . | cpio -c -o | gzip -9cv > %s/updates.img" % (cwd,)) - sys.stdout.write("updates.img ready\n") - -def usage(cmd): - sys.stdout.write("Usage: %s [OPTION]...\n" % (cmd,)) - sys.stdout.write("Options:\n") - sys.stdout.write(" -k, --keep Do not delete updates subdirectory.\n") - sys.stdout.write(" -c, --compile Compile code if there are isys changes.\n") - sys.stdout.write(" -h, --help Display this help and exit.\n") - -def main(argv): - prog = os.path.basename(sys.argv[0]) - cwd = os.getcwd() - configure = os.path.realpath(cwd + '/configure.ac') - spec = os.path.realpath(cwd + '/anaconda.spec.in') - updates = cwd + '/updates' - keep, compile, help, unknown = False, False, False, False - - try: - opts, args = getopt.getopt(sys.argv[1:], 'kc?', - ['keep', 'compile', 'help']) - except getopt.GetoptError: - help = True - - for o, a in opts: - if o in ('-k', '--keep'): - keep = True - elif o in ('-c', '--compile'): - compile = True - elif o in ('-?', '--help'): - help = True - else: - unknown = True - - if help: - usage(prog) - sys.exit(0) - elif unknown: - sys.stderr.write("%s: extra operand `%s'" % (prog, sys.argv[1],)) - sys.stderr.write("Try `%s --help' for more information." % (prog,)) - sys.exit(1) - - if not os.path.isfile(configure) and not os.path.isfile(spec): - sys.stderr.write("You must be at the top level of the anaconda source tree.\n") - sys.exit(1) - - tag = getArchiveTag(configure, spec) - - if not os.path.isdir(updates): - os.makedirs(updates) - - copyUpdatedFiles(tag, updates, cwd) - - if compile: - if isysChanged(tag): - copyUpdatedIsys(updates, cwd) - - createUpdatesImage(cwd, updates) - - if not keep: - shutil.rmtree(updates) - -if __name__ == "__main__": - main(sys.argv) diff --git a/rewrite/scripts/mk-images b/rewrite/scripts/mk-images deleted file mode 100755 index 56a7a88d..00000000 --- a/rewrite/scripts/mk-images +++ /dev/null @@ -1,1019 +0,0 @@ -#!/bin/bash -# -# mk-images -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -LANG=C - -PATH=$PATH:/sbin:/usr/sbin -IMAGEUUID=$(date +%Y%m%d%H%M).$(uname -i) -TMPDIR=${TMPDIR:-/tmp} - -usage () { - echo "usage: mk-images