Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => dCore X86 => Topic started by: jls on March 19, 2016, 08:54:47 PM

Title: how does sce-update behaves if an sce was imported with -R?
Post by: jls on March 19, 2016, 08:54:47 PM
?
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: Jason W on March 20, 2016, 12:29:28 PM
The same way as always, it is just a bigger SCE with more packages inside it.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: jls on September 21, 2016, 04:40:37 AM
Hi
Shouldn't the -R flag need to be stored in the sce?
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: netnomad on September 21, 2016, 05:39:23 AM
hi friends,

the -R flag is not mentioned in the -h info.
as far as i remember the -R flag includes all recommended files?
are there more flags and options that are not in help -h?
perhaps you want to update the help file that it explains the -R flag.

thank you for your help.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: jls on September 21, 2016, 05:56:23 AM
In the latest RC I see it is mentioned:
Code: [Select]


sce-import -R PKG      Include recommended Debian packages, warning large SCE.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: Jason W on September 21, 2016, 06:00:11 AM
I will ponder a way for sce-update to recognize if an SCE was imported with the -R and/or -S option. 
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: nitram on September 21, 2016, 09:54:30 AM
Hi netnomad. Last check all sce-import options are in --help, the -R option was added some time ago. The SCE scripts are in /usr/bin, let me know if you see a case option not listed in --help.

Just learning and having fun, if anything is inaccurate please forgive :)

Seems importupdatecheck is only aware whether Recommended or Suggested packages were installed, not whether the -RS flags were used [1].

Code: [Select]
## Determine if SCE exists in SCE dir, SCE/update dir, or is mounted and then mount.
if [ -f "$SCEDIR"/update/"$SCE".sce ]; then
   [ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
   sudo busybox mount "$SCEDIR"/update/"$SCE".sce /tmp/sceupdatetest
   DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
   FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif sudo busybox mount | grep "/tmp/tcloop/$SCE " > /dev/null 2>&1; then
   DATADIR=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"
   FILE=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif [ -f "$SCEDIR"/"$SCE".sce ]; then
   DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
   [ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
   sudo busybox mount "$SCEDIR"/"$SCE".sce /tmp/sceupdatetest
   FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
fi

Adding this just before mksquashfs command towards the bottom of deb2sce:
Code: [Select]
else
touch ""$TARGET"/usr/local/tce.installed/"$TARGET"_import_data"
echo "====  "$TARGET"  ====" > "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
echo "Import date: `date`" >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
if [ -f /tmp/.recommends ]; then
echo "Imported with -R option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
if [ -f /tmp/.suggests ]; then
echo "Imported with -S option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
mksquashfs "$TARGET" "$TCEDIR"/sce/"$TARGET".sce -noappend

...and running sce-import -RS nano produces a usr/local/tce.installed/nano_import_data file:
Code: [Select]
====  nano  ====
Import date: Wed Sep 21 06:39:57 UTC 2016
Imported with -R option.
Imported with -S option.

Unsure whether /tce.installed/ is appropriate for such a file, probably superfluous anyway. Something like this or simpler could be used to read case options for an update re-import.

[1] Importing nano with -RS flags, there were no Recommended packages. So the SCE contains only a  /tmp/tcloop/usr/local/sce/$SCE/suggests file. The absent recommends file, therefore, misleads both the user and importupdatecheck into thinking the -R option was not used during the initial import, even though it was. Maybe future bug if Debian/Ubuntu add Suggested and Recommended packages between update checks, not sure they do that.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: netnomad on September 21, 2016, 01:28:14 PM
hi nitram,

it was my fault... i tried sce-update -h, and looked there for the -R option, although it makes not very much sense ;-)
... and i missed to look in the sce-import options.

thank you for your reply.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: Jason W on September 21, 2016, 04:03:41 PM
We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense.  I like to have a file name like recommends or a one word entry in a file that is easy to grep for in the scripted routines.  But we also could create a human readable file that has the information like in the $target_import_data example above, that can include the flags the SCE was imported with and date so the user can refer to it.  And then a command like "sce-info" to basically echo that file.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: nitram on September 22, 2016, 06:49:05 PM
We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense.
Yes please, may prevent future bugs.

I created a function to be used just before mksquashfs in deb2sce to create /tce.installed/SCE_import_data file like:
Code: [Select]
nano.sce
 
Thu Sep 22 16:40:03 UTC 2016
 
Dependency import using:
xorg-all
 
Used -R option, added:
0 packages
 
Used -S option, added:
spell
 
Total import 9 packages (19 - 10 dependency provided):
dictionaries-common
emacsen-common
iamerican
ienglish-common
ispell
libtext-iconv-perl
nano
perlapi-5.20.0
spell

Archives some useful information during import. Not sure if necessary or just bloat. May help with troubleshooting in some instances. Personally would not use an sce-info script. Most dCore users would know where to find this tce.installed data file or could be directed by forum members if it helps with import/update troubleshooting.

Just let me know what you all think and i can submit a script update...or not. Thanks.
Title: Re: how does sce-update behaves if an sce was imported with -R?
Post by: Jason W on September 22, 2016, 07:22:36 PM
Yes, please send an update.  I think it can be done with no noticeable performance loss as installed package names and such already exist in files in user/local/sce.