You are not logged in.

#1 2004-12-26 08:22:23

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

weird ghost packages in repo dbase with gensync

I'm having a weird and frustrating issue with gensync, here is what is happening:

[$] : ls /var/abs/heaton/
alsa-driver  bootsplash  gkrellm       kernel26-nitro4    splashutils
baghira      comix     gtk2fontsel       kernel26-nitro4-cl5    thinkeramik
bmp-cvs      gd         kernel26-ck3-fbs  progsreiserfs

[$] : ls /home/pkgs/heaton/
alsa-driver-1.0.6a-custom.pkg.tar.gz  gtk2fontsel-0.1-1.pkg.tar.gz
baghira-0.6-1.pkg.tar.gz          kernel26-ck3-fbs-2.6.9-1.pkg.tar.gz
bmp-cvs-20041028-2.pkg.tar.gz          kernel26-nitro4-2.6.9-1.pkg.tar.gz
bootsplash-3.1-3.pkg.tar.gz          kernel26-nitro4-cl5-2.6.9-1.pkg.tar.gz
comix-0.1.3-1.pkg.tar.gz          progsreiserfs-0.3.0.4-1.pkg.tar.gz
gd-2.0.28-1.pkg.tar.gz              splashutils-0.9-pre10.pkg.tar.gz
gkrellm-2.1.28-1.pkg.tar.gz          thinkeramik-3.2.1-1.pkg.tar.gz

[$] : gensync /var/abs/heaton/ /home/pkgs/heaton/heaton.db.tar.gz
gensync: building database entries, generating md5sums...
gensync: missing package file: /home/pkgs/heaton/kernel26-2.6.9-1.pkg.tar.gz

Clearly I have no kernel26 pkg - none of my builds are of this package.  Before this it was complaining that I had no initscripts-0.7-7.pkg.tar.gz - does this version even currently exist?

Offline

#2 2005-01-02 19:33:24

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: weird ghost packages in repo dbase with gensync

Let's see the kernel26-* PKGBUILDs.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#3 2005-01-02 23:12:54

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: weird ghost packages in repo dbase with gensync

also an

ls -lR /var/abs/heaton/

You might have an errant pkbuild file in there somewhere that you just forgot about.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2005-01-03 10:19:47

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: weird ghost packages in repo dbase with gensync

no probs - i'll post them

Offline

#5 2005-01-05 03:51:08

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: weird ghost packages in repo dbase with gensync

# $Id: PKGBUILD,v 1.36 2004/12/07 08:59:32 judd Exp $
# Maintainer: judd <jvinet@zeroflux.org>
pkgname=kernel26
pkgver=2.6.9
pkgrel=1
pkgdesc="The Linux 2.6.9 Kernel 2.6.9 and modules (IDE support), built with Con Kolivas patchset (ck3) and a modified fbsplash"
url="http://www.kernel.org"
backup=('boot/kconfig26')
depends=('module-init-tools')
install=kernel26.install
source=(config clockfix-0.1.patch fbsplash-0.9-r8-2.6.9-ck3.patch 
  http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/release/$pkgver/acpi-20041015-26-latest-release.diff.bz2 
http://ck.kolivas.org/patches/2.6/2.6.9/2.6.9-ck3/patch-2.6.9-ck3.bz2 
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2 )

md5sums=('a91393d5c6e5b4f3c434b28b8b53df2e' 'c1304525ab03507d0d61cab5e4092890'
         '6d2889362bbb075fc3d82c5adf9a9023' '73141763e84cde8710d12dc14a630da4'
         'b22c946207ad504d511756043929c6ac' 'e921200f074ca97184e150ef5a4af825')

# Function to grab var from src
getvar() {
  old=$(cat Makefile | grep "^$1")
  echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*(.*)[ ]*/1/g")
  return 0
}

build() {
  cd $startdir/src/linux-$pkgver

  # Create build stats
  echo "Build started at `date +%c`" > $startdir/buildstats

  # Start build
  patch -Np1 -i ../patch-2.6.9-ck3 || return 1
  patch -Np1 -i ../acpi-20041015-26-latest-release.diff || return 1
  patch -Np1 -i ../fbsplash-0.9-r8-2.6.9-ck3.patch || return 1
  patch -Np1 -i ../clockfix-0.1.patch  || return 1

  # Arch logo!
  #cp ../logo_linux_clut224.ppm drivers/video/logo/

  # get rid of the 'i' in i686
  carch=`echo $CARCH | sed 's|i||'`
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config

  # load configuration
  #yes "" | make config
  #make oldconfig || return 1
  #make menuconfig
  #make xconfig
  make gconfig

  # save the configuration with today's date
  cp ./.config $startdir/config-$(date +%b%d)

  # get EXTRAVERSION to create unique /lib/modules/ subdirectories
  _kernextra=$(getvar "EXTRAVERSION")

  # build the full kernel version to use in pathnames
  . ./.config
  # Kernel release will be the same as Makefile
  _kernrel="${pkgver}${_kernextra}${CONFIG_LOCALVERSION}"
  # Kernel custom - to create a unique pkgname (see below) and unique /boot files
  _kerncust="${_kernextra}${CONFIG_LOCALVERSION}"
  pkgname="${pkgname}${_kerncust}"

  # Add more build stats
  echo >> $startdir/buildstats
  echo "Package Info" >> $startdir/buildstats
  echo "  Package name: $pkgname" >> $startdir/buildstats
  echo "  Package  ver: $pkgver" >> $startdir/buildstats
  echo "  Package desc: $pkgdesc" >> $startdir/buildstats
  echo >> $startdir/buildstats
  echo "  Kernel EXTRAVERSION: $_kernextra" >> $startdir/buildstats
  echo "  Kernel LOCALVERSION: ${CONFIG_LOCALVERSION}" >> $startdir/buildstats
  echo "  Kernel RELEASE: $_kernrel" >> $startdir/buildstats

  # build!
  make clean bzImage modules || return 1
  mkdir -p $startdir/pkg/{lib/modules,boot}
  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
  cp System.map $startdir/pkg/boot/System.map26${_kerncust}
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26${_kerncust}
  install -D -m644 Makefile 
    $startdir/pkg/usr/src/linux-${_kernrel}/Makefile
  install -D -m644 .config 
    $startdir/pkg/usr/src/linux-${_kernrel}/.config
  install -D -m644 .config $startdir/pkg/boot/kconfig26${_kerncust}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/include
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/arch/i386/kernel
  for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-${_kernrel}/include/
  done
  # copy files necessary for later builds, like nvidia and vmware
  cp -a scripts $startdir/pkg/usr/src/linux-${_kernrel}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/.tmp_versions
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-${_kernrel}/arch/i386/
  cp arch/i386/kernel/asm-offsets.s 
    $startdir/pkg/usr/src/linux-${_kernrel}/arch/i386/kernel/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do 
    mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-${_kernrel}/$i
  done
  cd $startdir/pkg/usr/src/linux-${_kernrel}/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-${_kernrel}
  cd $startdir/pkg/lib/modules/${_kernrel} && 
    (rm -f source build; ln -sf /usr/src/linux-${_kernrel} build)

  # Finalize build stats
  echo >> $startdir/buildstats
  echo "Build finished at `date +%c`" >> $startdir/buildstats
  mv $startdir/buildstats $startdir/buildstats-$(date +%b%d)
}

Offline

#6 2005-01-05 04:36:10

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: weird ghost packages in repo dbase with gensync

Ok, a little bit of programming/bash/interpreted language theory for you:

When you source a script, it's run through the bash interpreter and all the executable code is executed.  Things like "pkgname=kernel26" and "backup=('boot/kconfig26')" are executed.  As are function declarations.

NB: the function declaration is executed, not the function itself.

Now, look at your PKGBUILD.  What is the pkgname set to?

If you're not paying attention you'll say, "But I change the pkgname later on!"  That's when I shake my head and say, "You change the pkgname within the build() function.  Because the build() function isn't executed when you source a PKGBUILD (probably for the better...), your pkgname variable isn't being set by your clever getvar() function."

You tried to be smart, but ended up shooting yourself in the foot.  If you want it to make those "dynamic" PKGBUILDs work, you have to change the pkgname within something other than the build() function.  Have fun with that.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#7 2005-01-05 10:50:21

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: weird ghost packages in repo dbase with gensync

school boy error! thanks Xentac - i appreciate that!

what if i set the package name to the name i want at the start but immediately change it in the first line of the build function?  that'd work right?  of course i could just change the pkgname in all my package builds after i built them right?

EDIT:

I intend to make these changes to the PKGBUILD:

# Function to grab var from src 
getvar() { 
  old=$(cat $2 | grep "^$1") 
  echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*(.*)[ ]*/1/g") 
  return 0 
} 



_kernextra=$(getvar "EXTRAVERSION" "Makefile")

# Change pkgname in PKGBUILD to correct kernel version
newpkgname=$(getvar "Package name:" "$startdir/PKGBUILD")
cat $startdir/PKGBUILD | sed "s|pkgname=kernel26|pkgname={$newpkgname}|g" >$startdir/PKGBUILD

as long as i use a fresh PKGBUILD.kernel_proto each time, where pkgname=kernel26 when this is all copied to my repo it will work perfectly big_smile - the alternative is simply to know what final extraversion will be set by the kernel build process and set it at the start - it's a crappy hack but the alternative is a bit sucky too - not like these kernels are for public consumption either - this is just for my private repo - so you may ask what's the point but hell, it's just a hobby!

this does not explain the original problem i had tho with the initscripts-0.7-7.pkg.tar.gz  ting - they were actually called pkgname=initscripts-custom but it complained about not being able to find initscripts-0.7-7.pkg.tar.gz?  riddle me that one, batman?  please smile

Offline

#8 2005-01-06 09:23:26

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: weird ghost packages in repo dbase with gensync

that sed command up there was bollocks - a good idea but flawed - i am sticking to changeing the name in the PKGBUILD by hand after i build each kernel smile

here is one of the pkgbuilds for initscripts - why am i getting probs with this one?

# Maintainer: Brice Carpentier <brice@daknet.org>
# Contributor: Brice Carpentier <brice@daknet.org>
# This package is only a modified version of the arch initscripts package
# (incorporated a patch by Truls Becken <becken@stud.ntnu.no>)

pkgname=initscripts-bootsplash
pkgver=0.7
pkgrel=2
pkgdesc="System initialization/bootup scripts"
backup=(etc/inittab etc/rc.conf etc/rc.local)
depends=('bash' 'mawk' 'grep' 'coreutils' 'sed' 'bootsplash')
#makedepends=('cvs' 'openssh')
provides=('initscripts')
conflicts=('initscripts')
source=(initscripts-0.7-7.tgz initscripts-bootsplash.diff)
md5sums=('f28aff96e81b2b5baea8e693e7befbc9' '53a00c6e85aa520673f5ce9a99eb0655')

build() {
  # had to give up on the following and include an archive instead :-/

  # fetch files from the stock initscripts package
  #export CVSROOT=:pserver:anonymous@cvs.archlinux.org:/home/cvs-arch/base
  #msg "When asked for a password, type 'anonymous' and press <enter>"
  #cvs -Q login
  #cvs -Q -z3 co initscripts || return 1

  # rudely rip out and execute the content of build() from initscripts' PKGBUILD
  cd initscripts
  export startdir
  sed '1,/^build() {$/d; /^}$/d' PKGBUILD | sh

  # and finally patch things up for bootsplash
  cd $startdir/pkg/etc
  patch -Np1 -i $startdir/src/initscripts-bootsplash.diff
}

Offline

#9 2005-01-06 18:43:53

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: weird ghost packages in repo dbase with gensync

just a guess, but it may be that since you are piping the build text to sh, it is spawning a new shell. So, your previous variables are no longer meaningful.
Not sure though. I don't remember offhand whether child shells inherit the parent variables like that or not.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#10 2005-01-17 08:21:58

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: weird ghost packages in repo dbase with gensync

you were right cactus - i fixed this by not using the other pkgs PKGBUILD and simply grabbing the actual pkg decompressing it and using it's components as src smile works like a charm!

# Contributor: dibblethewrecker <dibblethewrecker@jiwe.org> 
# This package is only a modified version of the arch initscripts package 
# It allows you to easily checkout the latest initscripts and patch them 
# (based on a pkg by Brice Carpentier <brice@daknet.org>) 
# (incorporated a patch by Truls Becken <becken@stud.ntnu.no>) 

pkgname=initscripts-custom 
pkgver=0.1 
pkgrel=1 
pkgdesc="System initialization/bootup scripts with bootsplash support" 
backup=(etc/inittab etc/rc.conf etc/rc.local) 
depends=('bash' 'mawk' 'grep' 'coreutils' 'sed' 'bootsplash') 
provides=('initscripts') 
conflicts=('initscripts') 
source=(initscripts-bootsplash.diff) 
md5sums=('53a00c6e85aa520673f5ce9a99eb0655') 

build() { 
  # check the latest version of initscripts, grab it, copy and extract it to src 
  latestver=`pacman -Ss initscripts | grep current | sed "s|current/initscripts ||g"` 
  echo 
  echo "  : Latest version in current repo is initscripts-$latestver" 
  echo -n "  : Press any key to continue " 
  read anykey 
  pacman -Sw --noconfirm initscripts 
  cp /var/cache/pacman/pkg/initscripts-$latestver.pkg.tar.gz $startdir/src 

  cd $startdir/src 
  gunzip -cd initscripts-$latestver.pkg.tar.gz | tar xf - 

  # create the pkg - no compile required 
  mkdir -p $startdir/pkg/etc/{rc.d,conf.d} 

  cd $startdir/src/etc 
  install -D -m644 inittab $startdir/pkg/etc/inittab 
  install -D -m644 rc.conf $startdir/pkg/etc/rc.conf 
  for i in rc.local rc.multi rc.shutdown rc.single rc.sysinit; do 
    install -D -m755 $i $startdir/pkg/etc/$i 
  done 

  cd $startdir/src/etc/rc.d 
  install -D -m755 network $startdir/pkg/etc/rc.d/network 
  install -D -m755 netfs $startdir/pkg/etc/rc.d/netfs 
  install -D -m644 functions $startdir/pkg/etc/rc.d/functions 

  cd $startdir/src/sbin 
  install -D -m755 minilogd $startdir/pkg/sbin/minilogd 

  # apply your patches 
  cd $startdir/pkg/etc 
  patch -Np1 -i $startdir/src/initscripts-bootsplash.diff 
}

Offline

Board footer

Powered by FluxBB